level_reset | the level is reseted either because it is loaded the first time or the hero died |
---|---|
Information | the hero is already spawned and can be modified |
tile_interact | an entity interacts with an interactable tile |
---|---|
Input |
entity tile_x tile_y |
Information | currently only the hero actively interacts with tiles |
auto_tile_interact | an entity automatically interacts with an interactable tile |
---|---|
Input |
entity tile_x tile_y |
tile_hit | a head hit tile is hit by an entity |
---|---|
Input |
entity tile_x tile_y |
entity_spawn | an entity is spawned |
---|---|
Input | entity |
Information | entity.spawn throws this event delayed |
entity_despawn | an entity is despawned |
---|---|
Input | entity |
level.getName | returns the name of the level |
---|---|
Format | level.getName() |
level.getWidth | returns the width of the level |
---|---|
Format | level.getWidth() |
level.getHeight | returns the height of the level |
---|---|
Format | level.getHeight() |
level.getLayers | returns the amount of layers of the level |
---|---|
Format | level.getLayers() |
level.getBackgroundIndex | returns the background index of the level |
---|---|
Format | level.getBackgroundIndex() |
level.getTile | returns a tile id of a specified position in the level |
---|---|
Format | level.getTile(layer, x, y) |
level.setTile | sets a tile id at a specified position in the level |
---|---|
Format | level.setTile(layer, x, y, tile_id) |
level.addMessage | adds a message to the level message queue |
---|---|
Format | level.settile(message) |
level.finish | marks the level as done and jumps back to the level navigation |
---|---|
Format | level.finish() |
tile.toTileCoord | returns a level coordinate tranformed to a tile coordinate |
---|---|
Format | tile.toTileCoord(level_coord) |
tile.toLevelCoord | returns a tile coordinate tranformed to a level coordinate |
---|---|
Format | tile.toLevelCoord(tile_coord) |
tile.scale | returns a value scaled by the tile size factor |
---|---|
Format | tile.scale(value) |
Information | this allows motion to be modified independent from tile size |
Example | entity.setMotionY(entity.getHero(), tile.scale(-40)); |
entity.getHero | returns the hero of a level |
---|---|
Format | entity.getHero() |
entity.getX | returns the x coordinate of an entity |
---|---|
Format | entity.getX(entity) |
entity.getY | returns the y coordinate of an entity |
---|---|
Format | entity.getY(entity) |
entity.teleport | moves an entity to a specified position |
---|---|
Format | entity.teleport(entity, x, y) |
entity.getMotionX | returns the motion of an entity along the x axis |
---|---|
Format | entity.getMotionX(entity) |
entity.getMotionY | returns the motion of an entity along the y axis |
---|---|
Format | entity.getMotionY(entity) |
entity.setMotionX | sets the motion of an entity along the x axis |
---|---|
Format | entity.setMotionX(entity, motion_x) |
entity.setMotionY | sets the motion of an entity along the y axis |
---|---|
Format | entity.setMotionY(entity, motion_y) |
entity.isHero | returns true if an entity is the hero |
---|---|
Format | entity.isHero(entity) |
entity.getHealth | returns the health of an entity |
---|---|
Format | entity.getHealth(entity) |
Information | health is a value between 0 and 1 including both |
entity.addHealth | adds a value to the health of an entity |
---|---|
Format | entity.addHealth(entity, value) |
Information | health will always stay within the range 0 to 1 including both |
entity.getEnergy | returns the energy of an entity |
---|---|
Format | entity.getHealth(entity) |
Information | energy is a value between 0 and 1 including both |
entity.addEnergy | adds a value to the energy of an entity |
---|---|
Format | entity.addEnergy(entity, value) |
Information | energy will always stay within the range 0 to 1 including both |
entity.spawn | spawns and returns an entity or null if the entity id is invalid |
---|---|
Format | entity.spawn(entity_id, x, y) |
entity.getType | returns the type of an entity |
---|---|
Format | entity.getType(entity) |
platform.spawn | spawns and returns a platform |
---|---|
Format | platform.spawn(x, y, tile_width) |
Arguments | tile_width should be greater than or equal to 2 |
platform.addMove | adds move data to a platform |
---|---|
Format | platform.addMove(platform, x, y, speedX, speedY, wait_ticks) |
Information | a platform will loop through its move data by moving from one specified position to the next position with the specified speed |
Arguments | speedX and speedY are taken absolute and can therefore be either negative or positive |
platform.clear | removes all move data from a platform |
---|---|
Format | platform.clear(platform) |
light.setAmbient | sets the ambient lighting of a level |
---|---|
Format | light.setAmbient(red, green, blue) |
Arguments | red, green and blue are within the range 0 to 1 including both |
light.setColor | sets the color of a light in a level |
---|---|
Format | light.setColor(index, red, green, blue) |
Arguments |
index is a value from 0 to 31 red, green and blue are within the range 0 to 1 including both |
light.setPosition | sets the position of a light in a level |
---|---|
Format | light.setPosition(index, x, y) |
Arguments | index is a value from 0 to 31 |
light.setPositionSmooth | sets the position of a light in a level and remembers the old position for interpolation |
---|---|
Format | light.setPositionSmooth(index, x, y) |
Arguments | index is a value from 0 to 31 |
light.setStrength | sets the strength of a light in a level |
---|---|
Format | light.setStrength(index, strength) |
Arguments |
index is a value from 0 to 31 strength is the loose of lighting per pixel, therefore a higher value means a smaller light |