This is Roach.h in view mode; [Download] [Up]
/* RoachesView is Copyright 1994 by Brian Hill <bhill@physics.ucla.edu>. */
#import <appkit/appkit.h>
#define EXPOSED (int)YES
#define HIDDEN (int)NO
/* The following two defines are used as much as array indices as in
* in conditionals. */
#define DRAW (int)0
#define ERASE (int)1
@interface Roach:Object
{
/* Last drawn position is needed so that the
* previous image can be erased. Ditto for angle.
* When instantiated, a Roach will have angle[DRAW] = 0.
* This will be used as a flag that the Roach needs to be
* repositioned. */
NXPoint position[2];
int angle[2]; /* Only RESOLUTION possible angles. */
NXColor color;
id roachesView;
/* Stuck determines whether
* the Roach can go in the current direction, and if not, whether
* it is turning clockwise or counterclockwise to get unstuck.
* A Roach avoids going from being hidden to being exposed as
* strongly as if it were physically impossible to go in that direction. */
int stuck;
}
- setColor:(NXColor)roachesColor;
- initRoachesView:roachesView;
- (BOOL)reposition;
- (const NXPoint *)position;
- oneStep;
- prepareToDraw;
- erase;
- compositeDraw;
@end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.