Game Development Reference
In-Depth Information
Figure 3-8. The current state of the land Zool state object
Note If you run the game now, then the previous problem has fixed itself. The obj_zool_land object
now has its own Create event that overrides that of its parent and so prevents the infinite loop occurring.
Marching Order
So before moving on, it's worth looking at the order of events in Game Maker, as it is critical to
why this particular combination of events works. If you've ever wondered why there are three
different kinds of Step events in Game Maker, then this should help to explain things. In every
game step, Game Maker executes all the different events for all the different objects in the game.
However, it does this by performing each kind of event for every object before moving on to the
next kind of event. The order in which it does this is as follows:
Any Begin Step events for all objects
Any Alarm events for all objects
Any Keyboard , Key Press , and Key Release events for all objects (in that order)
Any Mouse Button , Mouse Press , and Mouse Release events for all objects (in order)
Any normal Step events for all objects
[At this point all instances are set to their new positions based on their current speed
and direction.]
Any Collision events for all objects with all other objects
Any End Step events for all objects
And finally, any Draw events for all objects
 
Search WWH ::




Custom Search