BlinkenArea - GitList
Repositories
Blog
Wiki
Blinker
Code
Commits
Branches
Tags
Search
Tree:
bb0c093
Branches
Tags
master
Blinker
doc
tetris.html
add tetris doc
Stefan Schuermans
commited
bb0c093
at 2019-08-14 17:42:35
tetris.html
Blame
History
Raw
<html> <head> <title>Blinker - Tetris</title> </head> <body> <h1>Blinker - Tetris</h1> <p> The tetris module provides a tetris game on demand. If starts when the operator connection for the player is established. </p> <h2>Keys</h2> <p> The game is controlled via an operator connection, i.e., via telephone keys. The key have the following functions: <table> <tr><td><b>key</b></td> <td width="2em"></td> <td><b>description</b></td></tr> <tr><td><code>#</code></td> <td></td> <td>leave game</td></tr> <tr><td><code>*</code></td> <td></td> <td>play start sound to inform user about the active game</td></tr> <tr><td><code>1</code></td> <td></td> <td>rotate falling stone left (counter-clock-wise)</td></tr> <tr><td><code>2</code> / <code>3</code></td> <td></td> <td>rotate falling stone right (clock-wise)</td></tr> <tr><td><code>4</code></td> <td></td> <td>move falling stone to the left</td></tr> <tr><td><code>6</code></td> <td></td> <td>move falling stone to the right</td></tr> <tr><td><code>8</code></td> <td></td> <td>drop stone</td></tr> </table> </p> <h2>Configuration</h2> <p> The configuration of the tetris module with name <code>NAME</code> is located in the <code>tetrises/NAME</code> subdirectory. </p> <h3>Colors</h3> <p> The colors of the background and of the stones are configurable. They are given in web notation, i.e., as 6 hexadecimal digits - 2 digits for read, green and blue. The color is automatically converted to the selected format (i.e. number of channels and number of colors). Each color is defined in the appropriate file. If the file is missing or contains an invalid color code, the respective element is not drawn on the frames. The following color files exist: <table> <tr><td><b>file name</b></td> <td width="2em"></td> <td><b>element</b></td></tr> <tr><td><code>backgroundColor</code></td> <td></td> <td>background of the tetris field</td></tr> <tr><td><code>stoneColorColor</code></td> <td></td> <td>stones - falling stone as well as fixed stones</td></tr> </table> </p> <h3>Delays</h3> <p> Multiple timins of the tetris game can be configured. This is done by specifying the duration of certain times in the delay files. They contain a number that specifies the time in milliseconds. If the file is not present, a default value is used. The different settings, the valid value ranges and the defaults are listed in the following table: <table> <tr><td><b>file name</b></td> <td width="2em"></td> <td><b>description</b></td> <td width="2em"></td> <td><b>default</b></td></tr> <td width="2em"></td> <td><b>minimum</b></td> <td width="2em"></td> <td><b>maximum</b></td></tr> <tr><td><code>blinkDelay</code></td> <td></td> <td>time for blinking of completed rows before they vanish</td> <td></td> <td><code>50</code></td> <td></td> <td><code>50</code></td> <td></td> <td><code>250</code></td></tr> <tr><td><code>delay</code></td> <td></td> <td>time after which a falling stone moves down a pixel</td> <td></td> <td><code>400</code></td> <td></td> <td><code>200</code></td> <td></td> <td><code>1000</code></td></tr> <tr><td><code>dropDelay</code></td> <td></td> <td>time after which a dropped stone moves down a pixel</td> <td></td> <td><code>100</code></td> <td></td> <td><code>50</code></td> <td></td> <td><code>250</code></td></tr> <tr><td><code>gameOverDelay</code></td> <td></td> <td>time the tetris field is still shown after the stones have reached the top before the game ends</td> <td></td> <td><code>2000</code></td> <td></td> <td><code>100</code></td> <td></td> <td><code>5000</code></td></tr> </table> Please note that the game speeds up a little bit with each completed row. </p> <h3>Format</h3> <p> The file <code>format</code> describes the format of the canvas, i.e. its dimensions, the number of channels and the color depth on each channel. The file must contain a string <code><width>x<height>-<channels>/<colors></code>, e.g. <code>18x8-1/256</code> for 18 pixels width, 8 pixels height in 256 grayscales. </p> <h3>Locking</h3> <p> It is possible to interlock different games among each other, i.e., to make sure that only one of the those games can be started at the same time. If the file <code>lockName</code> exists, it defines the name of a mutual exclusion lock that is acquired when the game is started. If the lock with this name is already taken by another game, the game will not start. </p> <h3>Output Stream</h3> <p> The file <code>outstream</code> contains the name of the stream to send the frames to. No frames are sent when the game is inactive (i.e. the player has not connected yet). </p> <h3>Sound Names</h3> <p> It is possible to request playing a sound on certain events occuring during the game. The names of the sounds to play are configurable via the following files: <table> <tr><td><b>file name</b></td> <td width="2em"></td> <td><b>play sound on event</b></td></tr> <tr><td><code>gameOverSound</code></td> <td></td> <td>stones have reached top of field, game is about to end</td></tr> <tr><td><code>rowCompleteSound</code></td> <td></td> <td>one row (or multiple rows) have been completed and will vanish</td></tr> <tr><td><code>startSound</code></td> <td></td> <td>game starts</td></tr> </table> </p> <h2>Operator Connection Interface</h2> <p> The name of the operator connection interface provided by this module is the module name. Thus, it is <code>tetrises/NAME</code>. </p> </body> </html>