GM: Order of events
From GMpedia.org Wiki
| This article (or section) may need to be wikified to meet GMpedia's quality standards. Please help improve this article, especially its categories, and wiki-links. |
When your game runs, it's run in a specific order of events, certain events run before other events and it's well to know in which order they are. Here is that order, from start to finish. All tests done in GM6.1 (Registered, Advanced Mode).
Contents |
[edit] Game Started
- Instance Creation Code
- Create
- Game Start
- Room - Creation code
- Room Start
- Room Start
- Draw
[edit] Normal Step
- Begin Step
- Alarm 0
- Keyboard and mouse
- Keyboard and mouse press
- Keyboard and mouse release
- Step
- End Of Path
- Outside room
- Intersect Boundary
- Collision events*
- End Step
- Draw
- Animation End**
[edit] Game Closed
- Room End
- Game End
[edit] Room Change***
- Room End
- Instance Creation Code (Only if object is not persistent from previous room)
- Create (Only if object is not persistent from previous room)
- Room - Creation code
- Room Start
- Draw
[edit] Other Events
- User Defined Events - Executed at call; doesn't wait for current event, or any other ones, to finish.
- Out of Health - Executed the moment they run out; doesn't wait for current event, or any other ones, to finish.
- Out of Lives - Same as Out Of Health
- Destroy – Will immediately execute when the object gets destroyed. Will not execute at the end of the game or at a room transition.
[edit] Notes
- (*) If the collision event is only in one object:
- Object(with event) - Collision with other object
If the collision event is in both objects: - Object1 - Collision with Object2
- Object2 - Collision with Object1
- Object2 - Collision with Object1
- Object1 - Collision with Object2
- Object(with event) - Collision with other object
- (**) Will execute once if sprite is animated (when it ends). Will execute every step with single image sprite or no sprite.
- (***) Doesn’t wait for rest of the events to finish, will execute immediately and then continue from the start of “Normal Step”.
This article was originally found at the Game Maker Knowledge Base, contributed by Tahnok100.
See the talk page for details
See the talk page for details

