ab0d0a082cc59ae70ee13a257a1a9ae0ea0bff2c
Stefan Schuermans document pong module

Stefan Schuermans authored 5 years ago

1) <html>
2)   <head>
3)     <title>Blinker - Pong</title>
4)   </head>
5)   <body>
6)     <h1>Blinker - Pong</h1>
7)     <p>
8)       The pong module provides a pong game on demand.
9)       There are two potential operator connections - one for the left player
10)       and one for the right player.
11)       The game starts as soon as the first player joins.
12)       In case only one player is in the game, the other side is played
13)       by the computer.
14)     </p>
15)     <h2>Configuration</h2>
16)     <p>
17)       The configuration of the pong module with name <code>NAME</code>
18)       is located in the <code>pongs/NAME</code> subdirectory.
19)     </p>
20)     <h3>Colors</h3>
21)     <p>
22)       The colors of the different element of a pong field are configurable.
23)       All of them are given in web notation, i.e., as 6 hexadecimal digits -
24)       2 digits for read, green and blue.
25)       The color is automatically converted to the selected format
26)       (i.e. number of channels and number of colors).
27)       Each color is defined in the appropriate file. If the file is missing
28)       or contains an invalid color code, the respective element is not drawn
29)       on the frames.
30)       The following color files exist:
31)       <table>
32)         <tr><td><b>file name</b></td>
33)             <td width="2em"></td>
34)             <td><b>element</b></td></tr>
35)         <tr><td><code>backgroundColor</code></td>
36)             <td></td>
37)             <td>background of the pong field</td></tr>
38)         <tr><td><code>ballColor</code></td>
39)             <td></td>
40)             <td>pong ball</td></tr>
41)         <tr><td><code>computerColor</code></td>
42)             <td></td>
43)             <td>pad played by the computer</td></tr>
44)         <tr><td><code>goalColor</code></td>
45)             <td></td>
46)             <td>game score when a goal has been scored</td></tr>
47)         <tr><td><code>lineColor</code></td>
48)             <td></td>
49)             <td>line in the middle of the field</td></tr>
50)         <tr><td><code>padColor</code></td>
51)             <td></td>
52)             <td>pad played by a real player</td></tr>
53)         <tr><td><code>scoreColor</code></td>
54)             <td></td>
55)             <td>game score when the ball is moving</td></tr>
56)       </table>
57)     </p>
58)     <h3>Delay</h3>
59)     <p>
60)       The file <code>delay</code> describes the duration of a frame / a step
61)       of the game.
62)       It contains a number that specifies the time in milliseconds.
63)       Valid values are from <code>100</code> to <code>500</code>.
64)       In case the file is not present, a default of <code>200</code> is used.
65)       Please note that the game speeds up a little bit when the ball bounces
66)       a pad and when a goal is scored.
67)     </p>
68)     <h3>Format</h3>
69)     <p>
70)       The file <code>format</code> describes the format of the canvas,
71)       i.e. its dimensions, the number of channels and the color depth on
72)       each channel.
73)       The file must contain a string
74)       <code>&lt;width&gt;x&lt;height&gt;-&lt;channels&gt;/&lt;colors&gt;</code>,
75)       e.g. <code>18x8-1/256</code> for 18 pixels width, 8 pixels height
76)       in 256 grayscales.
77)     </p>
Stefan Schuermans add game interlock

Stefan Schuermans authored 5 years ago

78)     <h3>Locking</h3>
79)     <p>
80)       It is possible to interlock different games among each other,
81)       i.e., to make sure that only one of the those games can be started at the
82)       same time.
83)       If the file <code>lockName</code> exists, it defines the name of a
84)       mutual exclusion lock that is acquired when the game is started.
85)       If the lock with this name is already taken by another game, the game
86)       will not start.
87)     </p>
Stefan Schuermans document pong module

Stefan Schuermans authored 5 years ago

88)     <h3>Maximum Scrore</h3>
89)     <p>
90)       The file <code>maxScore</code> configures at which score the game ends.
91)       The file contains this maximum score as a number.
92)       Valid values are from <code>1</code> to <code>99</code>.
93)       In case the file is not present, a default of <code>9</code> is used.
94)     </p>
95)     <h3>Output Stream</h3>
96)     <p>
97)       The file <code>outstream</code> contains the name of the stream to
98)       send the frames to.
99)       No frames are sent when the game is inactive (i.e. no player has
100)       joined yet).
101)     </p>
Stefan Schuermans sound support for pong game

Stefan Schuermans authored 5 years ago

102)     <h3>Sound Names</h3>
103)     <p>
104)       It is possible to request playing a sound on certain events occuring
105)       during the game.
106)       The names of the sounds to play are configurable via the following
107)       files:
108)       <table>
109)         <tr><td><b>file name</b></td>
110)             <td width="2em"></td>
111)             <td><b>play sound on event</b></td></tr>
112)         <tr><td><code>leftPlayerSound</code></td>
113)             <td></td>
114)             <td>player entered the game as left player</td></tr>
115)         <tr><td><code>rightPlayerSound</code></td>
116)             <td></td>
117)             <td>player entered the game as right player</td></tr>
118)         <tr><td><code>scoreSound</code></td>
119)             <td></td>
120)             <td>player scored a goal</td></tr>
121)         <tr><td><code>otherScoreSound</code></td>
122)             <td></td>
123)             <td>other player scored a goal</td></tr>
124)         <tr><td><code>winSound</code></td>
125)             <td></td>
126)             <td>player wins game</td></tr>
127)         <tr><td><code>looseSound</code></td>
128)             <td></td>
129)             <td>player looses game</td></tr>
130)       </table>
131)     </p>