1 2 3 4flying(6) flying(6) 5 6 7NNAAMMEE 8 flying - pool/snooker/carrom/hockey/curling simulator 9 10SSYYNNOOPPSSIISS 11 ffllyyiinngg [-options ...] 12 13DDEESSCCRRIIPPTTIIOONN 14 _f_l_y_i_n_g was actually meant to be a test program to imple- 15 ment some classes to control flying objects on the screen. 16 After the classes were implemented there was the need of 17 some real tests and a game of billard was just the first 18 idea. By now, many subgame-classes are already more or 19 less completely defined. They can either be selected by 20 the options or by making a link to the original with a 21 special name. Unfortunately having so many subclasses 22 means that the classes themselves can't be too compli- 23 cated. (There's just too less time in the world :( ) 24 Therefore the games don't have any rules yet. This means 25 you have to play fair and watch your opponent. 26 27 Anyway, the main thing was animation and controlling and 28 that works fine, especially with the --ddeelluuxxee version of 29 pool-billard. Since the main intention was to get an 30 excellent billard game, I will mainly describe the pool- 31 version in the following pages. The other subgames are 32 similar to control (and there are no special rules any- 33 way). 34 35 36SSTTAATTUUSS 37 The flying package contains many subgames, that are more 38 or less in an experimental stage. Here is a tiny summary 39 of version 6 40 41 42 PPooooll,, SSnnooookkeerr,, CCaannnnoonn 43 As already mentioned above, pool is the most comprehensive 44 subgame, especially due to the deluxe version. It is very 45 playable even though spin is not implemented. Rules will 46 have to be added in later revision. 47 48 CCaarrrroomm 49 Very similar to pool, just with another background (and 50 more friction) 51 52 HHoocckkeeyy 53 experimental air-hockey implementation (see option _-_i_n_2 to 54 set the display for the input-pointer for the second 55 player), which is worth looking at because of the uncon- 56 ventional control mechanism. The players have to select 57 one of the big discs before they can play. 58 59 CCuurrlliinngg 60 experimental curling implementation, which is even more 61 62 63 64X Version 11 18 July 1995 1 65 66 67 68 69 70flying(6) flying(6) 71 72 73 worth to look at because of the control: Hold the _l_e_f_t 74 button to take one curl. Move it in the right direction 75 and let it go... 76 77 78CCOONNTTRROOLLSS 79 The pointer (or pointers) run fully simultaenously and are 80 like the hand of the players. At every time it's possible 81 to pick one of the objects to select it as the cue-object 82 (It should better be the cueball, if you don't want to 83 lose some friends). After you have aimed in the desired 84 direction there are 2 ways to play the ball: 85 86 easy: Press and hold down the _l_e_f_t button to increase 87 the strength of your shot. Release the button 88 to shoot. There is a maximum power! If you hold 89 down the button too long, you will just make a 90 very poor shot as a penalty. 91 92 93 tricky: You might notice on that the queue stays on the 94 table for a moment. This is a problem, if you 95 are very close to the cushion. Then, the cueball 96 might hits the queue again. Therefor you can 97 alternatively gather power by pressing the _r_i_g_h_t 98 pointer button and shot by simultaenously press- 99 ing the _l_e_f_t button. When you release the _l_e_f_t 100 button after the shot, the queue is removed from 101 the table and you can therefore remove it ear- 102 lier. 103 104 After shooting, you can only wait and see what will hap- 105 pen. By the way, there actually are some tiny rules imple- 106 mented. The billard classes know, that cueballs shouldn't 107 stay in the pocket after a shot. When they are back on the 108 table, you can roll them to the position you like by using 109 the _r_i_g_h_t pointer button. 110 111 By the way, if you picked the wrong ball as the cue- 112 object, you can get rid of it by just clicking the _r_i_g_h_t 113 button once. 114 115 To overcome the hurdle of the mouse resolution, you can 116 use the _m_i_d_d_l_e pointer button for fine adjustments. With 117 that help, you can actually position the mouse in frac- 118 tions of pixels. To make shoting a thrill, you've got to 119 release the button again for shoting. (The fraction is 120 stored in that case) 121 122 SSuummmmaarryy 123 left select cueball 124 introduce easy shot 125 pick ball from pocket 126 127 128 129 130X Version 11 18 July 1995 2 131 132 133 134 135 136flying(6) flying(6) 137 138 139 middle fine adjustment via interpixel motion 140 141 142 right deselect cueball 143 introduce tricky shot 144 move ball 145 146 147 AAddddiittiioonnaall KKeeyy--CCoonnttrroollss 148 SPACE reset game 149 150 151 Q,Esc quit game 152 153 154 R restart game 155 156 157 ^L redraw screen 158 159 160OOPPTTIIOONNSS 161 XX1111 162 --ssiizzee _n window size 163 164 --rroooott full screen (the default) 165 166 --nnoo__oovveerrrriiddee 167 don't use OverrideRedirect for the background win- 168 dow, when the -root option is used. 169 170 --nnoo__ggrraabbss 171 don't grab the server, when problems with the col- 172 ormap occur. 173 174 --ddiissppllaayy _n_a_m_e 175 the output-display (default is contents of $DIS- 176 PLAY) 177 178 --iinn11 _n_a_m_e 179 name of the main display for input (default is: 180 same as the output display) 181 182 --iinn22 _n_a_m_e 183 name of a second input display. If given, a second 184 pointer object will be installed in the program 185 and can be controlled by the pointer of the given 186 display. (The pointer will get invisible on that 187 display as it is grabbed anything) 188 189 As for every display connection, you have to make 190 sure that all displays are accessible from your 191 host. (by using _x_h_o_s_t ...) 192 193 194 195 196X Version 11 18 July 1995 3 197 198 199 200 201 202flying(6) flying(6) 203 204 205 --ssoouunndd a subprocess is started, which gives some clicks 206 when balls hit together, but the smooth motion 207 gets distorted in that way, at least on my work- 208 station. 209 210 AADDDDIITTIIOONNAALL 211 --ddeelluuxxee a special version of the pool with animated balls 212 by using hundreds of precalculated pixmaps. The 213 construction of the pixmaps at game start is very 214 time consuming. Therefore the computed pixmaps are 215 cached in files _f_l_y_*_-_*_._d_t_a in a special data- 216 directory (usually just /tmp) for reusability. 217 218 --ttvv since the deluxe-option is default, this can be 219 used to switch back to the set of TV-balls. 220 221 --fftt _n sets the size of the table in pool-billard to _n 222 foot. The value should be in a range of 6 to 9 223 feet. If not given, the size is selected randomly, 224 except in the deluxe-version, where it default to 225 8 feet. This was done because every size would 226 need other pixmaps for the balls. 227 228 229 DDEEBBUUGG 230 --mmooddee _n selects the update mode for the animation in the 231 deluxe version of pool. There are 3 (internal) 232 different implementations of the ball animation, 233 which depend on the implementation of some spe- 234 cific routines of the x-server. Since mode 2 is 235 usually the fastest one, it is turned on by 236 default. 237 238 --cchhkkmmooddee 239 runs a small benchmark with the available update 240 modes. If a mode other than the second is the 241 fastest on the current machine, you should use the 242 mode-option to select it. 243 244 --ttiimmee _s stop process after _s seconds 245 246 --ddeemmoo demonstration (without pockets). By the way, there 247 are some tiny meters on the bottom of the screen 248 (when using the full screen and the binary was 249 compiled with statistic features), which have the 250 following meanings: 251 252 rate: shows the number of cycles per second. A 253 cycle means the loop for doing collision 254 detection and recomputing the corrent 255 position of all objects. 256 257 moves: show the number of ball moves, that were 258 neccessary in one seconds. If all objects 259 260 261 262X Version 11 18 July 1995 4 263 264 265 266 267 268flying(6) flying(6) 269 270 271 are moving, this would be <object number> 272 x <rate> 273 274 offset: if shown, it tells you, how much the real 275 time has gone ahead of the current inter- 276 nal calculation time. It should never 277 light up during the game, except probably 278 at the first shot into the triangle. 279 280 --mmaaxxssppeeeedd 281 the collision calculation is done only in those 282 moments, when a collision takes place. In the 283 intermediate time, only the motion graphics are 284 updated as fast as possible. The switch disables 285 that intermediate calculation to get measures for 286 the speed of the collision calculation. (Good 287 combinations to check the speed of your machine 288 would be: -demo -maxspeed -time 10) 289 290 --pprreesseettss 291 shows the current internal values of static vari- 292 ables on stdout. The values can be dynamically 293 altered by setting them in the file _p_r_e_s_e_t_s_._t_x_t 294 with the same syntax as in this output. 295 296 There are many additional debugging options, when the exe- 297 cutable was compiled for debugging. They are shown when no 298 argument or -h is given at the commandline. You can try 299 flying -pool -deluxe Intro (if you're lucky) to see the 300 some information about the pixmap-usage. 301 302 303FFIILLEESS 304 presets.txt file to overwrite internal static values 305 306 fly*-*.dta files containing the pixmaps for the ball 307 animation in deluxe-pool. They are created 308 automatically when they are missing. 309 310SSEEEE AALLSSOO 311 X(1), xhost(1) 312 313BBUUGGSS 314 As I told, this is a very uncompleted version without any 315 rules, but you can perfectly play billard, so why worrying 316 ... 317 318 The friction is not exactly integrated in the computa- 319 tions, since that would have cost too much performance. 320 Instead the objects move without friction for a given 321 amount of time. Then their speed is re-adjusted. When the 322 granularity gets smaller, the friction gets more exact. 323 But that works against a caching-mechanism and therefore 324 would extremely increase computation time, if many objects 325 326 327 328X Version 11 18 July 1995 5 329 330 331 332 333 334flying(6) flying(6) 335 336 337 are on the table. 338 339 Spin is not implemented 340 341 There seem to be problems, when moving objects directly 342 with the pointer (like in hockey or curling or with the 343 right button in billard) when the host is not fast enough. 344 At least I can not use it on my 386. 345 346 There are some minor problems when drawing static parts of 347 the screen. Sometimes they are misplaced for 1 pixel, 348 e.g. there is a one pixel gap below the line representing 349 the pocket 350 351 There is a problem in the start-shot of carrom. Due to the 352 weight of the striker, the other stones might get pushed 353 so close together, that the collision detection will fail 354 and objects will overlap (or the algorithm gets stuck in a 355 loop, only to be escaped by entering 'q'). Sorry for that. 356 357 Usually, the program needs it's private colormap. To get a 358 nicer appearance, a black OverrideRedirect window is 359 placed above everything else when the -root option is 360 given. This confuses some window managers and a struggle 361 for the colormap begins. If anythings else fails, flying 362 will grab the server and installs the map on it's own ... 363 364 365CCOOPPYYRRIIGGHHTT 366 Copyright 1995, Helmut Hoenig, Mettmann/Bad Camberg 367 368 email (for any comments): 369 Helmut.Hoenig@hub.de 370 371 smail (for gifts): 372 Helmut Hoenig 373 Hopfenstrasse 8a 374 65520 Bad Camberg 375 GERMANY 376 377 ******************************************************** 378 379 By the way, I am collecting banknotes! If you want 380 to join into my collection, get any bill of your 381 country, sign it on the backside and send it to me 382 so I will pin it on my world map. 383 (Don't forget the exact location for the pin :-) 384 But you can also just send me a picture postcard ... 385 386 ******************************************************** 387 388 Permission to use, copy, modify, and distribute this soft- 389 ware for any purpose and without fee is hereby granted, 390 provided that the above copyright notice appear in all 391 392 393 394X Version 11 18 July 1995 6 395 396 397 398 399 400flying(6) flying(6) 401 402 403 copies. 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460X Version 11 18 July 1995 7 461 462 463