Room

From AGI Wiki
Revision as of 13:42, 24 March 2019 by Andrew Branscom (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

A room in an AGI game is, roughly, a division between areas in the game. A room might also be called a "screen." In a loose sense, you know that ego has gone to a new room when the background picture changes.

In a technically accurate sense, to be "in a room" means that the current value of v0 is the number of the room that you are in. Normally, the logic resource with the same number as the current room number will be called on each interpreter cycle (this does not happen automatically, however; the AGI Studio Template Game has already included the appropriate code to do this in logic 0). This gives each room its own behavior. When the game switches to a new room, the flag f5 is set to indicate that this is the first interpreter cycle in the new room.

There is a limit of 255 rooms in an AGI game. Logic 0 is special, so a room number of 0 is not valid, but logics 1-255 are available. It should be noted, however, that the AGI Studio Template Game uses logics 90-99 for additional game functions and logic 1 for the game's introduction.

See also