From ENIGMA
Events as they appear in the ENIGMA sister project, LateralGM.
In event-oriented scripting languages, and in ENIGMA, events are functions that are invoked when certain circumstances are met. For instance, in ENIGMA, an event can be invoked when a certain key is pressed. Events are shared with each instance of a given object. In LateralGM, they are presented visually in a tree view in the object editor dialog. Each event has an icon representing its type. From there, events can be added or removed, and users can add separate code to each of them.
Event types
For extensibility reasons, events in ENIGMA are stored and loaded from the file events.res. It is there that you can find a detailed listing of each offered event.
The events, however, do fall into a small set of generic categories:
- Instance create and destroy event
- Input-related events: Keyboard, mouse, controller, etc.
- Interaction events; Collision events, boundary events, etc.
- Control events: Step events, timer events, &c.
|
Timing
|
|
|
Alarm
Alarm events are used to sequence things to the number of updates or 'steps' the game has processed.
|
|
|
Step
Are for determining what happens each time the game updates.
|
|
|
|
Movement
|
|
|
Collision
Collision events occur when objects come in contact with each other.
|
|
20px
|
Physics
Are when events trigger in the Box2D physics engine.
|
|
|
|
Input
|
|
|
Keyboard
Are for handling keyboard input.
|
|
|
Key Press
For handling when keyboard keys are pressed.
|
|
|
Key Release
For handling when keyboard keys are released.
|
|
|
Mouse
Are for handling mouse input.
|
|
|
Joystick
Are for handling joystick input.
|
|
|
Gamepad
Are for handling controller/gamepad input.
|
|
|
|
Graphics
|
|
|
Draw
Occur after the end step event and are for when you are ready to draw objects to the screen.
|
|
|
Draw GUI
Is for drawing things on a layer on top of everything else rendered, basically buttons and things.
|
|
|
|
Other
|
|
|
Other
Events not covered in other categories, such as those defined by the user.
|
|
20px
|
Room
Are for when things happen to the room, such as it restarts or ends.
|
|
|
Create
Happen only once when an object is first created.
|
|
|
Destroy
Happen when objects are destroyed.
|
|
|