Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
An event is created, many of these are created in the engine (game.events[]) but you can also create your own from within python using the Event class.
Event listeners and their handlers are assigned. These are functions which will be called whenever the event is invoked. Note that handlers (aka the functions called by an event) can take arguments. Normally this is done during registration.py
Events are invoked. This triggers all handlers listening to a single event and give them the variable passed (assuming they accept variables). Off the top of my head I think you can only pass one variable when invoking events, but just use a tuple to get around that. Events are invoked all throughout the code depending on the circumstance.
Event listeners are removed. Some events will naturally be destroyed in this case this isn't needed but others would persist between game sessions (for example, if you load a game, close it, then load another without ever closing the game itself). In this case we have to set some events to remove their listeners when closing out the game.
Hope this helps you understand how events work. The execution order of events has to do with when the event is invoked.