BlinkenArea - GitList
Repositories
Blog
Wiki
Blinker
Code
Commits
Branches
Tags
Search
Tree:
fb06c1c
Branches
Tags
master
Blinker
doc
pong.html
sound support for pong game
Stefan Schuermans
commited
fb06c1c
at 2019-07-07 12:55:58
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>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>