BlinkenArea - GitList
Repositories
Blog
Wiki
Blinker
Code
Commits
Branches
Tags
Search
Tree:
ab0d0a0
Branches
Tags
master
Blinker
doc
pong.html
add game interlock
Stefan Schuermans
commited
ab0d0a0
at 2019-08-13 20:05:32
pong.html
Blame
History
Raw
<html> <head> <title>Blinker - Pong</title> </head> <body> <h1>Blinker - Pong</h1> <p> The pong module provides a pong game on demand. There are two potential operator connections - one for the left player and one for the right player. The game starts as soon as the first player joins. In case only one player is in the game, the other side is played by the computer. </p> <h2>Configuration</h2> <p> The configuration of the pong module with name <code>NAME</code> is located in the <code>pongs/NAME</code> subdirectory. </p> <h3>Colors</h3> <p> The colors of the different element of a pong field are configurable. All of them 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 pong field</td></tr> <tr><td><code>ballColor</code></td> <td></td> <td>pong ball</td></tr> <tr><td><code>computerColor</code></td> <td></td> <td>pad played by the computer</td></tr> <tr><td><code>goalColor</code></td> <td></td> <td>game score when a goal has been scored</td></tr> <tr><td><code>lineColor</code></td> <td></td> <td>line in the middle of the field</td></tr> <tr><td><code>padColor</code></td> <td></td> <td>pad played by a real player</td></tr> <tr><td><code>scoreColor</code></td> <td></td> <td>game score when the ball is moving</td></tr> </table> </p> <h3>Delay</h3> <p> The file <code>delay</code> describes the duration of a frame / a step of the game. It contains a number that specifies the time in milliseconds. Valid values are from <code>100</code> to <code>500</code>. In case the file is not present, a default of <code>200</code> is used. Please note that the game speeds up a little bit when the ball bounces a pad and when a goal is scored. </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>Maximum Scrore</h3> <p> The file <code>maxScore</code> configures at which score the game ends. The file contains this maximum score as a number. Valid values are from <code>1</code> to <code>99</code>. In case the file is not present, a default of <code>9</code> is used. </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. no player has joined 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>leftPlayerSound</code></td> <td></td> <td>player entered the game as left player</td></tr> <tr><td><code>rightPlayerSound</code></td> <td></td> <td>player entered the game as right player</td></tr> <tr><td><code>scoreSound</code></td> <td></td> <td>player scored a goal</td></tr> <tr><td><code>otherScoreSound</code></td> <td></td> <td>other player scored a goal</td></tr> <tr><td><code>winSound</code></td> <td></td> <td>player wins game</td></tr> <tr><td><code>looseSound</code></td> <td></td> <td>player looses game</td></tr> </table> </p> <h2>Operator Connection Interfaces</h2> <p> The name of the operator connection interfaces provided by this module is the module name plus the side of the player. Thus, the operator connection interface for the left player is <code>pongs/NAME/left</code> and the one for the right player is <code>pongs/NAME/right</code> </p> </body> </html>