1 Here is the source to Xasteroids, version 5, 9 Feb 93. 2 3 This program runs under UNIX in the X-Windows or OpenWindows 4environment. It could probably be modified for other operating systems 5without difficulty. I compile it under quasi-BSD with this command: 6 7 cc -I/util/X11/include -L/util/X11/lib xast.c -lm -lX11 -o xast.exe -O 8 9That is, include files /util/X11/include, use the library in /util/X11/lib, 10source file ast.c, use the math and X11 libraries, object file will be ast.out, 11and Optimize. The Makefile provided should do this for you if you type 12 13 make xast.exe 14 15 To run the program, type 16 17 xasteroids & 18 19This runs the shell script which runs the game and saves high scores. 20You should modify the first line of the shell script to move to the proper 21directory. 22 23 Playing with scale of movement, object size, and window size can give you 24very different games. 25 26 If you like the game, please send $5 to 27 28 Phil Goetz 29 4023 Huckleberry Row 30 Ellicott City, MD 21043 31 32 Even if you don't register, please send a note to my e-mail address 33so I know how many people use Xasteroids. 34Send any comments, suggestions, bug reports, modifications, etc., to 35 36 goetz@cs.buffalo.EDU 37 38 If you modify the game, feel free to post your version, PROVIDED that 39you retain my copyright notice, the credits, and note which version yours 40was derived from and its release date, what changes you made, and your 41release date. I do not intend to release any more versions myself. 42I wash my hands of it. 43 44 David Elliot (dce@sonyusa.sony.com) says that he had to put an 45XSync(disp) after the XDrawLines call or he would get protocol errors. 46 47 On anything slower than a SPARCstation 1, or on any color screen, 48it will really drag. There should be a way to set color screens to use 49a bitmap of depth 1, but I don't know how. Please tell me if you do. 50 The code is not optimized because the XWindows 51calls take the vast majority of the time. I tried, for instance, 52reading sines and cosines from a table instead of calculating them - 53it made no noticeable difference in speed. Similarly, the collision 54detection could be optimized only to check objects nearby - but why 55bother. Same goes for using registers, pointers to frequently-referenced 56array elements, etc. It MIGHT make a significant difference in runtime 57if you replace the vector drawing with bitmaps. It runs a LOT slower on 58color displays. 59 The vast majority of time seems to be used in erasing the pixmap 60each round, & there isn't much to do about that. My tests have indicated 61that blanking individual asteroids rather than the whole screen would 62take comparable time, unless you had a complicated routine to optimize 63blanking. 64 65By 66 Phil Goetz <goetz@cs.buffalo.edu> 67Contributors: 68 Peter Phillips <pphillip@cs.ubc.ca> 69 Pat Ryan <pat@jaameri.gsfc.nasa.gov> 70 Craig Smith <csmith@cscs.UUCP> 71 Doug Merritt <doug@netcom.com> 72 James Berg <berg@plains> (makefile) 73 David Partain <dlp@ida.liu.se> (original man page) 74 Chris Moore <moore@src.bae.co.uk> (hi score script) 75