Things I've done:

Put in srandom(something) 

Changed fcos and fsin to cos and sin {in buttonvector}

Fixed a sign error in game(). {You were comparing the click location to anglebuttonmaxx+23 instead of  anglebuttonmaxx-23.} {again}

Added to constrainvector() checks for theta<0, theta>2*pi, r<0. 
Added a constrainvector() call to buttonvector().
Added a #define PI... line to xgrav.h

Added a #define GAME_EVENT_MASKS line to game.c, since we use the list of events several times.

Changed the local veldn[], velup[], angledn[], anglup[] arrays to a single global pushbutton[] array, with some #defines to make the values intelligible.
Added a pushtime[] array, to help control the rate of up/down button activation.

Wrote updownbuttons().

Added planet surface bitmaps. The surface of each planet is chosen randomly in makeplanet(). {added planet GCs in xgrav.h, load them in initwindow(), use them in drawplanet()}

Thought about the keyboard-entry routines. Gave up.

-----------------------------------------
Thoughts:

You might need a watch() event loop in addition to the pregame() and game() loops. This would handle missile movement and expose events, but no buttons or keys.
