3d66bad63b052792c0c6f80f69126b3b98173613
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>
Stefan Schuermans add description of pong keys

Stefan Schuermans authored 5 years ago

15)     <h2>Keys</h2>
16)     <p>
17)       The game is controlled via operator connections, i.e., via telephone
18)       keys. The key have the following functions:
19)       <table>
20)         <tr><td><b>key</b></td>
21)             <td width="2em"></td>
22)             <td><b>description</b></td></tr>
23)         <tr><td><code>#</code></td>
24)             <td></td>
25)             <td>leave game</td></tr>
26)         <tr><td><code>*</code></td>
27)             <td></td>
28)             <td>play left or right player sound to inform user about the
29)                 active game and the side on which he is playing</td></tr>
30)         <tr><td><code>2</code></td>
31)             <td></td>
32)             <td>move paddle up</td></tr>
33)         <tr><td><code>8</code></td>
34)             <td></td>
35)             <td>move paddle down</td></tr>
36)       </table>
37)     </p>
Stefan Schuermans document pong module

Stefan Schuermans authored 5 years ago

38)     <h2>Configuration</h2>
39)     <p>
40)       The configuration of the pong module with name <code>NAME</code>
41)       is located in the <code>pongs/NAME</code> subdirectory.
42)     </p>
43)     <h3>Colors</h3>
44)     <p>
Stefan Schuermans fix typos in pong doc

Stefan Schuermans authored 5 years ago

45)       The colors of the different elements of a pong field are configurable.
Stefan Schuermans document pong module

Stefan Schuermans authored 5 years ago

46)       All of them are given in web notation, i.e., as 6 hexadecimal digits -
47)       2 digits for read, green and blue.
48)       The color is automatically converted to the selected format
49)       (i.e. number of channels and number of colors).
50)       Each color is defined in the appropriate file. If the file is missing
51)       or contains an invalid color code, the respective element is not drawn
52)       on the frames.
53)       The following color files exist:
54)       <table>
55)         <tr><td><b>file name</b></td>
56)             <td width="2em"></td>
57)             <td><b>element</b></td></tr>
58)         <tr><td><code>backgroundColor</code></td>
59)             <td></td>
60)             <td>background of the pong field</td></tr>
61)         <tr><td><code>ballColor</code></td>
62)             <td></td>
63)             <td>pong ball</td></tr>
64)         <tr><td><code>computerColor</code></td>
65)             <td></td>
66)             <td>pad played by the computer</td></tr>
67)         <tr><td><code>goalColor</code></td>
68)             <td></td>
69)             <td>game score when a goal has been scored</td></tr>
70)         <tr><td><code>lineColor</code></td>
71)             <td></td>
72)             <td>line in the middle of the field</td></tr>
73)         <tr><td><code>padColor</code></td>
74)             <td></td>
75)             <td>pad played by a real player</td></tr>
76)         <tr><td><code>scoreColor</code></td>
77)             <td></td>
78)             <td>game score when the ball is moving</td></tr>
79)       </table>
80)     </p>
81)     <h3>Delay</h3>
82)     <p>
83)       The file <code>delay</code> describes the duration of a frame / a step
84)       of the game.
85)       It contains a number that specifies the time in milliseconds.
86)       Valid values are from <code>100</code> to <code>500</code>.
87)       In case the file is not present, a default of <code>200</code> is used.
88)       Please note that the game speeds up a little bit when the ball bounces
89)       a pad and when a goal is scored.
90)     </p>
91)     <h3>Format</h3>
92)     <p>
93)       The file <code>format</code> describes the format of the canvas,
94)       i.e. its dimensions, the number of channels and the color depth on
95)       each channel.
96)       The file must contain a string
97)       <code>&lt;width&gt;x&lt;height&gt;-&lt;channels&gt;/&lt;colors&gt;</code>,
98)       e.g. <code>18x8-1/256</code> for 18 pixels width, 8 pixels height
99)       in 256 grayscales.
100)     </p>
Stefan Schuermans add game interlock

Stefan Schuermans authored 5 years ago

101)     <h3>Locking</h3>
102)     <p>
103)       It is possible to interlock different games among each other,
104)       i.e., to make sure that only one of the those games can be started at the
105)       same time.
106)       If the file <code>lockName</code> exists, it defines the name of a
107)       mutual exclusion lock that is acquired when the game is started.
108)       If the lock with this name is already taken by another game, the game
109)       will not start.
110)     </p>
Stefan Schuermans fix typo

Stefan Schuermans authored 5 years ago

111)     <h3>Maximum Score</h3>
Stefan Schuermans document pong module

Stefan Schuermans authored 5 years ago

112)     <p>
113)       The file <code>maxScore</code> configures at which score the game ends.
114)       The file contains this maximum score as a number.
115)       Valid values are from <code>1</code> to <code>99</code>.
116)       In case the file is not present, a default of <code>9</code> is used.
117)     </p>
118)     <h3>Output Stream</h3>
119)     <p>
120)       The file <code>outstream</code> contains the name of the stream to
121)       send the frames to.
122)       No frames are sent when the game is inactive (i.e. no player has
123)       joined yet).
124)     </p>
Stefan Schuermans sound support for pong game

Stefan Schuermans authored 5 years ago

125)     <h3>Sound Names</h3>
126)     <p>
127)       It is possible to request playing a sound on certain events occuring
128)       during the game.
129)       The names of the sounds to play are configurable via the following
130)       files:
131)       <table>
132)         <tr><td><b>file name</b></td>
133)             <td width="2em"></td>
134)             <td><b>play sound on event</b></td></tr>
135)         <tr><td><code>leftPlayerSound</code></td>
136)             <td></td>
137)             <td>player entered the game as left player</td></tr>
138)         <tr><td><code>rightPlayerSound</code></td>
139)             <td></td>
140)             <td>player entered the game as right player</td></tr>
141)         <tr><td><code>scoreSound</code></td>
142)             <td></td>
143)             <td>player scored a goal</td></tr>
144)         <tr><td><code>otherScoreSound</code></td>
145)             <td></td>
146)             <td>other player scored a goal</td></tr>
147)         <tr><td><code>winSound</code></td>
148)             <td></td>
149)             <td>player wins game</td></tr>
150)         <tr><td><code>looseSound</code></td>
151)             <td></td>
152)             <td>player looses game</td></tr>
153)       </table>
154)     </p>
Stefan Schuermans document pong module

Stefan Schuermans authored 5 years ago

155)     <h2>Operator Connection Interfaces</h2>
156)     <p>
157)     The name of the operator connection interfaces provided by this module
158)     is the module name plus the side of the player.  Thus, the operator
159)     connection interface for the left player is <code>pongs/NAME/left</code>
Stefan Schuermans fix typos in pong doc

Stefan Schuermans authored 5 years ago

160)     and the one for the right player is <code>pongs/NAME/right</code>.