The Game class is the main class of your game. It is where the program begins, and where it ends.
-
Sets up all of the main classes and global variables in your game.
First, it sets up the cast (gCast), features (gFeatures), sFeatures (gSFeatures), sounds (gSounds), regions (gRegions), locales (gLocales), addToPics (gAddToPics) and timers
(gTimer). Next, it sets up the global gSaveDirPtr to a pointer to the save directory string buffer. Finally, it initalizes the inventory (Inv) and user (User).
-
Performs all of the main game actions.
It begins by checking the sounds and timers. If there's a print dialog (gPrintDlg), it checks it to see if it's timer is up and it should automatically close. It animates
the cast, and if gCastMotionCue is set, motion cues the cast. It then executes the script's doit() method if the script property is set. It calls doit() for each of the
regions, then if gRoomNumber is equal to gRoomNumberExit, calls User's doit(), otherwise, executes the newRoom() method. It deletes the timers, then returns whether the
game is restarting.
-
Calls the regions' showSelf() method.
-
This is the main method of your game. It is where the execution begins and ends.
It assigns the game class to the global gGame and the a pointer to the save directory to global gSaveDirPtr.If the game is not restarting, the obtains the current working
directory. It then sets the cursor to the loading cursor, calls the game instance's init() method, and sets it back to the normal cursor. It then loops calling the game
instance's doit() method and waiting according to the game speed until the global gQUIT_FLAG is set.
-
Similar to the play() method, but is called after a game is restored.
-
Changes the room to roomNum. This is called when the user enters doors, or hits the edge of the screen. To change a room in your game, you should use
global gRoom's newRoom() method.
-
Initalizes and sets up a new room.
-
Restarts the game.
-
Restores a game. If specified, it the default game to open will be the one which has a description matching strDescription.
It executes the SRDialog as a restore dialog, and if a game is selected, attempts to restore it.
-
Saves a game.
It executes the SRDialog as a save dialog, and if a game is selected, attempts to save to it.
-
Adds addPoints to the game's score (global variable gScore).
-
Calls the handleEvent() method from the regions class (pointed to by gRegions). If it returns TRUE, it will return whether pEvent has been claimed or
not. If it returns FALSE, it calls the handleEvent() method from the locales class (pointed to by gLocales). If it returns TRUE, it will return whether pEvent has been claimed
or not. Finally, if both are FALSE, and the script property is set, it calls the script's handleEvent() method. It then returns whether pEvent has been claimed or not.
-
Displays current memory information in a dialog box.
-
Sets the game's speed to newSpeed and returns the previous speed.
-
Adds the cast members which are extras to the picture, then calls kernel
Animate() for the cast.
-
In the Game class, this is just an empty place holder.
-
Disposes the current script pointed to by the script property. If newScript is not NULL, it initializes it with theCaller and theRegister is specified.
-
If the script property is set, it call's it's cue() method.
-
Prints "I don't understand <aWord>" to the screen in a dialog box. It always returns FALSE.
-
Prints a message indicating that the line parsed doesn't appear to be a proper sentence.
-
Prints a message indicating that the sentence parsed doesn't make sense.
-
Prints the message "You've left me responseless".