123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607 |
- <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>
|