LunaLua events
Revision as of 16:34, 16 October 2014 by Kevsoft (talk | contribs) (Created page with "Category:LunaLua API {{API table|Events||2= {{API table/row|onLoad()|{{type|nil}}|'''onLoad''' is called when the level editor or the game engine loads the level.|odd...")
| Events | ||
|---|---|---|
| Function | Return values | Description |
| onLoad() | nil | onLoad is called when the level editor or the game engine loads the level. |
| onLoop() | nil | On each frame while the game runs onLoop is called. |
| onLoopSection#() | nil | On each frame while the game runs in the specific section # onLoopSection# is called. Replace # with the sectionnumber 0-20. |
| onLoadSection() | nil | In the first frameloop of a new section onLoadSection is called. |
| onLoadSection#() | nil | In the first frameloop of section # onLoadSection# is called. Replace # with the sectionnumber 0-20. |
| onJump(int playerIndex) | nil | When the player starts to jump, onJump is called. playerIndex is the index of the player (Player 1: playerIndex = 1; Player 2: playerIndex = 2). |
| onJumpEnd(int playerIndex) | nil | When the player hits the surface (jump ends), onJumpEnd is called. playerIndex is the index of the player (Player 1: playerIndex = 1; Player 2: playerIndex = 2). |
| onKeyDown(int keycode, int playerIndex) | nil | When a key is getting hit, onKeyDown is called. Keycode can be compared with the constants. playerIndex is the index of the player (Player 1: playerIndex = 1; Player 2: playerIndex = 2). |
| onKeyUp(int keycode, int playerIndex) | nil | When a key is getting released, onKeyUp is called. Keycode can be compared with the constants. playerIndex is the index of the player (Player 1: playerIndex = 1; Player 2: playerIndex = 2). |