home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1995 August / NEBULA.bin / SourceCode / GameKit / Examples / NX_Invaders / NXISaucer.h < prev    next >
Encoding:
Text File  |  1994-06-07  |  879 b   |  35 lines

  1.  
  2. // This object moves and renders the flying saucer.
  3. // It is always on the stage, but is not always active.  If it's
  4. // inactive, it does a test every cycle to decide when to come out.
  5.  
  6. #import <gamekit/gamekit.h>
  7.  
  8. // size of an alien
  9. #define SAUCER_WIDTH    32
  10. #define SAUCER_HEIGHT    16
  11. #define SAUCER_FRAMES    3
  12.  
  13. // possible states (determine what we can do, etc.)
  14. #define SAUCER_ACTIVE        (GK_DEAD_ACTOR + 1)
  15. #define SAUCER_INACTIVE        GK_DEAD_ACTOR
  16.  
  17. // speed of bullet drop...
  18. #define SAUCER_MOVE_SPEED    2
  19.  
  20. // how long to wait for next saucer
  21. #define SAUCER_DELAY random() % 500 + 500
  22.  
  23. @interface NXISaucer:GKActor
  24. {
  25.     float screenWidth, screenHeight;
  26.     int nextTime;    // when to put it on the screen next
  27. }
  28.  
  29. - init;
  30. - setStage:aStage;
  31. - collidedWith:anActor;    // called when it is detected that we hit something
  32. - move:sender;            // decide where to move the ghost for the next frame
  33.  
  34. @end
  35.