main.tfile | source file

************************************************************************** main.t

This module forms part of the adv3Lite library (c) 2012-13 Eric Eve. Based in part on code in the adv3 Library (c) Michael J. Roberts.

Summary of Classes

(none)

Summary of Global Objects

(none)

Summary of Global Functions

`main mainCommandLoop mainCommon mainRestore runGame`

Global Functions

`main (args)` | `main.t[20]`

Main program entrypoint. The core run-time start-up code calls this after running pre-initialization and load-time initialization. This entrypoint is called when we're starting the game normally; when the game is launched through a saved-position file, mainRestore() will be invoked instead.

`mainCommandLoop ( )` | `main.t[132]`

The main command loop. This repeatedly prompts the player for a command and then processes the command until the game ends.

`mainCommon (prop, [args])` | `main.t[45]`

Common main entrypoint - this handles starting a new game or restoring an existing saved state.

`mainRestore (args, restoreFile)` | `main.t[35]`

Main program entrypoint for restoring a saved-position file. This is invoked from the core run-time start-up code when the game is launched from the operating system via a saved-position file. For example, on Windows, double-clicking on a saved-position file on the Windows desktop launches the interpreter, which looks in the save file to find the game executable to run, then starts the game and invokes this entrypoint.

`runGame (look)` | `main.t[99]`

Run the game. We start by showing the description of the initial location, if desired, and then we read and interpret commands until the game ends (via a "quit" command, winning, death of the player character, or any other way of terminating the game).

This routine doesn't return until the game ends.

Before calling this routine, the caller should already have set the global variable gPlayerChar to the player character actor.

'look' is a flag indicating whether or not to look around; if this is true, we'll show a full description of the player character's initial location, as though the player were to type "look around" as the first command.

Adv3Lite Library Reference Manual
Generated on 01/03/2024 from adv3Lite version 1.6.2