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