Game Development Reference
In-Depth Information
Events
When it comes to objects, it is extremely important to know what an event is. This is due to
pretty much everything in a GameMaker game happening within some sort of event.
In general, an event is often referred to as a thing that happens, or takes place; often times,
the event is of some sort of importance. For example, you may attend an athletics event. In
GameMaker, it is much the same. GameMaker has a number of predefined events that al-
low us to easily make things happen when certain other events take place or when
something happens in the game, for example, a mouse button being pressed.
As an example, we will look at the first event of any object, the create event. The create
event is triggered when an instance is created within a room. It is always the first event to
be executed. The create event is commonly used to initialize variables for later use in an in-
stance, for example, a score variable.
How is an event triggered? In most cases, it is automatically triggered by GameMaker it-
self. When an instance is first created, the create event of that instance is automatically run.
However, it is possible to manually trigger an event using GameMaker Language code.
This is a piece of code manually triggering a create event:
Search WWH ::




Custom Search