File: flying.cat

package info (click to toggle)
flying 6.20-6
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny
  • size: 752 kB
  • ctags: 1,873
  • sloc: cpp: 10,966; makefile: 189
file content (462 lines) | stat: -rw-r--r-- 15,084 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
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
460
461
462



flying(6)                                               flying(6)


NNAAMMEE
       flying - pool/snooker/carrom/hockey/curling simulator

SSYYNNOOPPSSIISS
       ffllyyiinngg [-options ...]

DDEESSCCRRIIPPTTIIOONN
       _f_l_y_i_n_g  was  actually meant to be a test program to imple-
       ment some classes to control flying objects on the screen.
       After  the  classes were implemented there was the need of
       some real tests and a game of billard was just  the  first
       idea.  By  now,  many  subgame-classes are already more or
       less completely defined. They can either  be  selected  by
       the  options  or  by  making a link to the original with a
       special name.  Unfortunately  having  so  many  subclasses
       means  that  the  classes  themselves can't be too compli-
       cated. (There's just too less  time  in  the  world  :(  )
       Therefore  the  games don't have any rules yet. This means
       you have to play fair and watch your opponent.

       Anyway, the main thing was animation and  controlling  and
       that  works  fine,  especially with the --ddeelluuxxee version of
       pool-billard. Since the  main  intention  was  to  get  an
       excellent  billard  game, I will mainly describe the pool-
       version in the following pages.  The  other  subgames  are
       similar  to  control  (and there are no special rules any-
       way).


SSTTAATTUUSS
       The flying package contains many subgames, that  are  more
       or  less  in an experimental stage. Here is a tiny summary
       of version 6


   PPooooll,, SSnnooookkeerr,, CCaannnnoonn
       As already mentioned above, pool is the most comprehensive
       subgame,  especially due to the deluxe version. It is very
       playable even though spin is not implemented.  Rules  will
       have to be added in later revision.

   CCaarrrroomm
       Very  similar  to  pool, just with another background (and
       more friction)

   HHoocckkeeyy
       experimental air-hockey implementation (see option _-_i_n_2 to
       set  the  display  for  the  input-pointer  for the second
       player), which is worth looking at because of  the  uncon-
       ventional  control  mechanism.  The players have to select
       one of the big discs before they can play.

   CCuurrlliinngg
       experimental curling implementation, which  is  even  more



X Version 11               18 July 1995                         1





flying(6)                                               flying(6)


       worth  to  look  at  because of the control: Hold the _l_e_f_t
       button to take one curl.  Move it in the  right  direction
       and let it go...


CCOONNTTRROOLLSS
       The pointer (or pointers) run fully simultaenously and are
       like the hand of the players. At every time it's  possible
       to  pick one of the objects to select it as the cue-object
       (It should better be the cueball, if  you  don't  want  to
       lose  some  friends).  After you have aimed in the desired
       direction there are 2 ways to play the ball:

       easy:     Press and hold down the _l_e_f_t button to  increase
                 the  strength  of your shot.  Release the button
                 to shoot. There is a maximum power! If you  hold
                 down  the  button too long, you will just make a
                 very poor shot as a penalty.


       tricky:   You might notice on that the queue stays on  the
                 table  for  a  moment. This is a problem, if you
                 are very close to the cushion. Then, the cueball
                 might  hits  the  queue  again. Therefor you can
                 alternatively gather power by pressing the _r_i_g_h_t
                 pointer button and shot by simultaenously press-
                 ing the _l_e_f_t button. When you release  the  _l_e_f_t
                 button after the shot, the queue is removed from
                 the table and you can therefore remove  it  ear-
                 lier.

       After  shooting,  you can only wait and see what will hap-
       pen. By the way, there actually are some tiny rules imple-
       mented.  The billard classes know, that cueballs shouldn't
       stay in the pocket after a shot. When they are back on the
       table, you can roll them to the position you like by using
       the _r_i_g_h_t pointer button.

       By the way, if you picked  the  wrong  ball  as  the  cue-
       object,  you  can get rid of it by just clicking the _r_i_g_h_t
       button once.

       To overcome the hurdle of the mouse  resolution,  you  can
       use  the  _m_i_d_d_l_e pointer button for fine adjustments. With
       that help, you can actually position the  mouse  in  frac-
       tions  of  pixels. To make shoting a thrill, you've got to
       release the button again for  shoting.  (The  fraction  is
       stored in that case)

   SSuummmmaarryy
       left    select cueball
               introduce easy shot
               pick ball from pocket




X Version 11               18 July 1995                         2





flying(6)                                               flying(6)


       middle  fine adjustment via interpixel motion


       right   deselect cueball
               introduce tricky shot
               move ball


   AAddddiittiioonnaall KKeeyy--CCoonnttrroollss
       SPACE   reset game


       Q,Esc   quit game


       R       restart game


       ^L      redraw screen


OOPPTTIIOONNSS
   XX1111
       --ssiizzee _n window size

       --rroooott   full screen (the default)

       --nnoo__oovveerrrriiddee
               don't use OverrideRedirect for the background win-
               dow, when the -root option is used.

       --nnoo__ggrraabbss
               don't grab the server, when problems with the col-
               ormap occur.

       --ddiissppllaayy _n_a_m_e
               the  output-display  (default is contents of $DIS-
               PLAY)

       --iinn11 _n_a_m_e
               name of the main display for  input  (default  is:
               same as the output display)

       --iinn22 _n_a_m_e
               name of a second input display. If given, a second
               pointer object will be installed  in  the  program
               and  can be controlled by the pointer of the given
               display. (The pointer will get invisible  on  that
               display as it is grabbed anything)

               As  for every display connection, you have to make
               sure that all displays are  accessible  from  your
               host. (by using _x_h_o_s_t ...)




X Version 11               18 July 1995                         3





flying(6)                                               flying(6)


       --ssoouunndd  a  subprocess  is started, which gives some clicks
               when balls hit together,  but  the  smooth  motion
               gets  distorted  in that way, at least on my work-
               station.

   AADDDDIITTIIOONNAALL
       --ddeelluuxxee a special version of the pool with animated  balls
               by  using  hundreds  of precalculated pixmaps. The
               construction of the pixmaps at game start is  very
               time consuming. Therefore the computed pixmaps are
               cached in files  _f_l_y_*_-_*_._d_t_a  in  a  special  data-
               directory (usually just /tmp) for reusability.

       --ttvv     since  the  deluxe-option  is default, this can be
               used to switch back to the set of TV-balls.

       --fftt _n   sets the size of the table in  pool-billard  to  _n
               foot.  The  value  should  be in a range of 6 to 9
               feet. If not given, the size is selected randomly,
               except  in the deluxe-version, where it default to
               8 feet.  This was done because  every  size  would
               need other pixmaps for the balls.


   DDEEBBUUGG
       --mmooddee _n selects  the  update mode for the animation in the
               deluxe version of pool.  There  are  3  (internal)
               different  implementations  of the ball animation,
               which depend on the implementation  of  some  spe-
               cific  routines  of  the x-server. Since mode 2 is
               usually the  fastest  one,  it  is  turned  on  by
               default.

       --cchhkkmmooddee
               runs  a  small benchmark with the available update
               modes. If a mode other  than  the  second  is  the
               fastest on the current machine, you should use the
               mode-option to select it.

       --ttiimmee _s stop process after _s seconds

       --ddeemmoo   demonstration (without pockets). By the way, there
               are  some  tiny meters on the bottom of the screen
               (when using the full screen  and  the  binary  was
               compiled  with statistic features), which have the
               following meanings:

               rate:   shows the number of cycles per  second.  A
                       cycle  means  the loop for doing collision
                       detection  and  recomputing  the   corrent
                       position of all objects.

               moves:  show  the  number of ball moves, that were
                       neccessary in one seconds. If all  objects



X Version 11               18 July 1995                         4





flying(6)                                               flying(6)


                       are  moving, this would be <object number>
                       x <rate>

               offset: if shown, it tells you, how much the  real
                       time  has gone ahead of the current inter-
                       nal  calculation  time.  It  should  never
                       light  up during the game, except probably
                       at the first shot into the triangle.

       --mmaaxxssppeeeedd
               the collision calculation is done  only  in  those
               moments,  when  a  collision  takes  place. In the
               intermediate time, only the  motion  graphics  are
               updated  as  fast as possible. The switch disables
               that intermediate calculation to get measures  for
               the  speed  of  the  collision calculation.  (Good
               combinations to check the speed  of  your  machine
               would be: -demo -maxspeed -time 10)

       --pprreesseettss
               shows  the current internal values of static vari-
               ables on stdout.  The values  can  be  dynamically
               altered  by  setting  them in the file _p_r_e_s_e_t_s_._t_x_t
               with the same syntax as in this output.

       There are many additional debugging options, when the exe-
       cutable was compiled for debugging. They are shown when no
       argument or -h is given at the commandline.  You  can  try
       flying  -pool  -deluxe  Intro (if you're lucky) to see the
       some information about the pixmap-usage.


FFIILLEESS
       presets.txt   file to overwrite internal static values

       fly*-*.dta    files containing the pixmaps  for  the  ball
                     animation  in deluxe-pool.  They are created
                     automatically when they are missing.

SSEEEE AALLSSOO
       X(1), xhost(1)

BBUUGGSS
       As I told, this is a very uncompleted version without  any
       rules, but you can perfectly play billard, so why worrying
       ...

       The friction is not exactly  integrated  in  the  computa-
       tions,  since  that  would have cost too much performance.
       Instead the objects move  without  friction  for  a  given
       amount  of time. Then their speed is re-adjusted. When the
       granularity gets smaller, the friction  gets  more  exact.
       But  that  works against a caching-mechanism and therefore
       would extremely increase computation time, if many objects



X Version 11               18 July 1995                         5





flying(6)                                               flying(6)


       are on the table.

       Spin is not implemented

       There  seem  to  be problems, when moving objects directly
       with the pointer (like in hockey or curling  or  with  the
       right button in billard) when the host is not fast enough.
       At least I can not use it on my 386.

       There are some minor problems when drawing static parts of
       the  screen.   Sometimes  they  are misplaced for 1 pixel,
       e.g. there is a one pixel gap below the line  representing
       the pocket

       There is a problem in the start-shot of carrom. Due to the
       weight of the striker, the other stones might  get  pushed
       so  close together, that the collision detection will fail
       and objects will overlap (or the algorithm gets stuck in a
       loop, only to be escaped by entering 'q'). Sorry for that.

       Usually, the program needs it's private colormap. To get a
       nicer  appearance,  a  black  OverrideRedirect  window  is
       placed above everything else  when  the  -root  option  is
       given.  This  confuses some window managers and a struggle
       for the colormap begins. If anythings else  fails,  flying
       will  grab the server and installs the map on it's own ...


CCOOPPYYRRIIGGHHTT
       Copyright 1995, Helmut Hoenig, Mettmann/Bad Camberg

       email (for any comments):
               Helmut.Hoenig@hub.de

       smail (for gifts):
               Helmut Hoenig
               Hopfenstrasse 8a
               65520 Bad Camberg
               GERMANY

        ********************************************************

           By the way, I am collecting banknotes! If you want
            to join into my collection, get any bill of your
           country, sign it on the backside and send it to me
                   so I will pin it on my world map.
            (Don't forget the exact location for the pin :-)
          But you can also just send me a picture postcard ...

        ********************************************************

       Permission to use, copy, modify, and distribute this soft-
       ware  for  any  purpose and without fee is hereby granted,
       provided that the above copyright  notice  appear  in  all



X Version 11               18 July 1995                         6





flying(6)                                               flying(6)


       copies.
























































X Version 11               18 July 1995                         7