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><width>x<height>-<channels>/<colors></code>,
75) e.g. <code>18x8-1/256</code> for 18 pixels width, 8 pixels height
76) in 256 grayscales.
77) </p>
78) <h3>Maximum Scrore</h3>
79) <p>
80) The file <code>maxScore</code> configures at which score the game ends.
81) The file contains this maximum score as a number.
82) Valid values are from <code>1</code> to <code>99</code>.
83) In case the file is not present, a default of <code>9</code> is used.
84) </p>
85) <h3>Output Stream</h3>
86) <p>
87) The file <code>outstream</code> contains the name of the stream to
88) send the frames to.
89) No frames are sent when the game is inactive (i.e. no player has
90) joined yet).
91) </p>
|
sound support for pong game
Stefan Schuermans authored 5 years ago
|
92) <h3>Sound Names</h3>
93) <p>
94) It is possible to request playing a sound on certain events occuring
95) during the game.
96) The names of the sounds to play are configurable via the following
97) files:
98) <table>
99) <tr><td><b>file name</b></td>
100) <td width="2em"></td>
101) <td><b>play sound on event</b></td></tr>
102) <tr><td><code>leftPlayerSound</code></td>
103) <td></td>
104) <td>player entered the game as left player</td></tr>
105) <tr><td><code>rightPlayerSound</code></td>
106) <td></td>
107) <td>player entered the game as right player</td></tr>
108) <tr><td><code>scoreSound</code></td>
109) <td></td>
110) <td>player scored a goal</td></tr>
111) <tr><td><code>otherScoreSound</code></td>
112) <td></td>
113) <td>other player scored a goal</td></tr>
114) <tr><td><code>winSound</code></td>
115) <td></td>
116) <td>player wins game</td></tr>
117) <tr><td><code>looseSound</code></td>
118) <td></td>
119) <td>player looses game</td></tr>
120) </table>
121) </p>
|