home *** CD-ROM | disk | FTP | other *** search
-
- // This object moves and renders the marching aliens. It is an "invisible"
- // GKActor -- it is never rendered, yet is part of the action machinery
- // since it imposes control on top of the NXIAliens, which consent to the
- // master control of this object.
-
- #import <gamekit/gamekit.h>
-
- // alien movement in steps.
- #define TOP_ALIEN_ROW (4 + ALIEN_HEIGHT)
- #define ALIEN_VERTICAL_STEP_SIZE (4 + ALIEN_HEIGHT)
- #define ALIEN_HORIZONTAL_STEP_SIZE 2
- // these next two should be equal in magnitude always!
- #define ALIEN_RIGHT ALIEN_HORIZONTAL_STEP_SIZE
- #define ALIEN_LEFT (-1 * ALIEN_HORIZONTAL_STEP_SIZE)
-
- #define ALIEN_STEPCYCLES 5
-
- #define ALIEN_NUMROWS 5
- #define ALIEN_NUMVADERS 11
-
- #define LEFT_EDGE 0
- #define RIGHT_EDGE 1
-
- @interface NXIAlienOverseer:GKActor
- {
- NXPoint movementDirection, lastMovementDirection, movement;
- int moveCycles;
- id leftMost, rightMost, invaderList;
- }
-
- + new;
- - init;
- - setUpAliensForLevel:(int)aLevel; // called at the start of a level
- - findRightMost;
- - findLeftMost;
- - alienLeavingTheStage:anAlien;
- - move:sender; // decide how to move the aliens for the next frame
- - movementVector:(NXPoint *)aVector; // return by reference which way an
- // alien invader should move this frame.
-
- @end
-