home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
games
/
volume17
/
xasteroids3
/
part01
/
README
< prev
next >
Wrap
Text File
|
1993-03-21
|
3KB
|
75 lines
Here is the source to Xasteroids, version 5, 9 Feb 93.
This program runs under UNIX in the X-Windows or OpenWindows
environment. It could probably be modified for other operating systems
without difficulty. I compile it under quasi-BSD with this command:
cc -I/util/X11/include -L/util/X11/lib xast.c -lm -lX11 -o xast.exe -O
That is, include files /util/X11/include, use the library in /util/X11/lib,
source file ast.c, use the math and X11 libraries, object file will be ast.out,
and Optimize. The Makefile provided should do this for you if you type
make xast.exe
To run the program, type
xasteroids &
This runs the shell script which runs the game and saves high scores.
You should modify the first line of the shell script to move to the proper
directory.
Playing with scale of movement, object size, and window size can give you
very different games.
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.
Send any comments, suggestions, bug reports, modifications, etc., to
goetz@cs.buffalo.EDU
If you modify the game, feel free to post your version, PROVIDED that
you retain my copyright notice, the credits, and note which version yours
was derived from and its release date, what changes you made, and your
release date. I do not intend to release any more versions myself.
I wash my hands of it.
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.
By
Phil Goetz <goetz@cs.buffalo.edu>
Contributors:
Peter Phillips <pphillip@cs.ubc.ca>
Pat Ryan <pat@jaameri.gsfc.nasa.gov>
Craig Smith <csmith@cscs.UUCP>
Doug Merritt <doug@netcom.com>
James Berg <berg@plains> (makefile)
David Partain <dlp@ida.liu.se> (original man page)
Chris Moore <moore@src.bae.co.uk> (hi score script)