Each move made in a Smash-based game causes a number of different snippets
of code to execute. When programming a game, it's important to understand the
order in which things occur, lest you make false assumptions about what happens
when.
Sequence of Events That Occurs When a New Player Starts a
Game
When a new player starts a game, the following steps are taken:
- The current move number is set to 0.
- If a copts.sma file exists, it is executed.
- The start.sma, which must exist, is
executed.
- If a repeatpre.sma file exists, it is
executed.
- The code for the starting location (as specified by a
g command in the
start.sma file) is executed.
- If a repeatpost.sma file exists, it is
executed.
Sequence of Events That Occurs After the Player Makes Each
Move
When the player selects a move to make in the game, the following steps are
taken:
- The current move number is incremented by 1.
- Any and all timers set to values less than or equal to 0 are removed.
- All remaining timers are advanced by 1.
- The code for the user's selected action is executed.
- If a repeatpre.sma file exists, it is
executed.
- If a g command was encountered in any of the
above steps, the location change takes effect.
- The code for the current location (whether it changed or not in the
previous step) is executed.
- If a repeatpost.sma file exists, it is
executed.
|
|