home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 8
/
CDASC08.ISO
/
VRAC
/
XASTER.ZIP
/
ASTROIDS.DOC
< prev
next >
Wrap
Text File
|
1992-11-23
|
5KB
|
116 lines
If you like the game, please send $5 to
Phil Goetz
4023 Huckleberry Row
Ellicott City, MD 21043
Even if you don't register, please send a note to my e-mail address
so I know how many people use Xasteroids. Then I may be motivated to
update it again, or write new programs...
Send any comments, suggestions, bug reports, modifications, etc., to
goetz@cs.buffalo.EDU
Lots of people have complained that Xasteroids wouldn't run fast
enough on their display. I had different ideas on how to affect the speed,
and implemented all of them. So Version 3 came with more speed controls
than most people like to think about:
1 2: Scale of movement (default 1): Increasing this causes each object to
move further every turn.
Advantage: Can be changed in smaller amounts than moves/frame.
Disadvantage: Increasing it too much can cause bullets to fly through
asteroids without hitting them. Looks jerky.
v b: Moves per frame (default 1): Increasing this causes the main loop to
execute more times before updating the display.
Advantages: Avoids the problem of bullets flying through asteroids.
Disadvantages: Increases only by integer amounts.
, .: Delay: Used when your client runs too fast to play comfortably.
n m: Object size: If your client is too slow, decrease the size and resize
the window to a smaller size. Then type 'x' to use XFillRectangle erase.
Playing with scale of movement, object size, and window size can give you
very different games.
Known bugs:
David Elliot (dce@sonyusa.sony.com) says that he had to put an
XSync(disp) after the XDrawLines call or he would get protocol errors.
On anything slower than a SPARCstation 1, or on any color screen,
it will really drag. There should be a way to set color screens to use
a bitmap of depth 1, but I don't know how. Please tell me if you do.
The code is not optimized because the XWindows
calls take the vast majority of the time. I tried, for instance,
reading sines and cosines from a table instead of calculating them -
it made no noticeable difference in speed. Similarly, the collision
detection could be optimized only to check objects nearby - but why
bother. Same goes for using registers, pointers to frequently-referenced
array elements, etc. It MIGHT make a significant difference in runtime
if you replace the vector drawing with bitmaps. It runs a LOT slower on
color displays.
The vast majority of time seems to be used in erasing the pixmap
each round, & there isn't much to do about that. My tests have indicated
that blanking individual asteroids rather than the whole screen would
take comparable time, unless you had a complicated routine to optimize
blanking.
If you modify this program, please send me a copy. Modifications
I would like to see include: sound (esp. for Sparcstations), drawing
the asteroids to pixmaps so they can be put on the screen quicker
(though not much quicker - the X calls seem to take most of the time),
an options screen to set parameters such as speed, whether bullets
can be fired before your current ones are dead, whether to start in the
center of the screen between levels), a permanent high score file
to be displayed sometimes between games, and jagged fractal asteroids
(not just removal of the lines to the center; I like those).
---------------------
ast.docs:
Xasteroids
Copyright 1990 by Phil Goetz
goetz@cs.Buffalo.EDU
Keypress Command
-------- -------
e Rotate counterclockwise ("left")
r Rotate clockwise ("right")
w Rotate 45 degrees counterclockwise
t Rotate 45 degrees clockwise
d Increase counterclockwise rotational velocity
f Increase clockwise rotational velocity
o Thrust
p Fire
` Shields
space Hyperspace
s Start new ship in center of playing field
(Also used to start a new game)
esc Pause
Q Quit
Speed commands: Key associated with faster speed is to the right of its
corresponding key associated with slower speed.
. Decrease delay: Speed game up
, Increase delay: Slow the game down
m Decrease size ("Minimize")
n Increase size
b Increase # of moves/frame
v Decrease # of moves/frame
2 Increase scale of movement
1 Decrease scale of movement
Object Score
------- -----
Big asteroid 25
Medium asteroid 50
Little asteroid 100
Enemy spaceship 500
Enemy bullet 500
Commands can only be entered when the mouse pointer is in the
asteroids window.
Resize the window with your window manager
at any time for a different playing field.
---------------------