Order of Events

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).

 

 

Events List

 

Game started:

- Instance Creation Code

- Create

- Game Start

- Room - Creation code

- Room Start

- Room Start

- Draw

 

 

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**

 

 

Game closed:

- Room End

- Game End

 

 

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

 

 

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.

 

 

Event Comments:

* - 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

 

** - Will execute once if sprite is animated (when it ends). Will execute every step with single image sprite or no sprite.

 

*** - Doesnt wait for rest of the events to finish, will execute immediately and then continue from the start of “Normal Step”.

 

 

Order of Above Events

 

Order of sub-events:

The above groups of events will run in the game in the following order:

 

Game started

Normal step

Normal step

Normal step

Normal step (Continues to repeat)

Room Change (When called)

Normal step

Normal step

Normal step (Continues to repeat)

Game closed (When called)

 

 

Events with multiple objects:

With multiple objects, the events alternate:

Object1 Step

Object2 - Step

Object1 - End Of Path

Object2 - End Of Path

Object1 - Outside room

Object2 - Outside room

Object1 - Intersect Boundary

Object2 - Intersect Boundary

 

The order the objects are handled is determined by depth (lower numbers execute first) and then, for objects at the same depth, by the order they were created (placed in the room, first placed will execute first).

 

Tahnok100 - Revision #1