Advertisement
TheSkipper1995

Untitled

Dec 4th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. STEP EVENT
  2.  
  3. event_inherited();
  4. if (!is_frozen() && !dead) {
  5.     apply_gravity();
  6.     switch (phase) {
  7.         case 0: { //idle & raising telescope
  8.             timer++;
  9.             if ((timer > 90) && (timer % 7 == 0))
  10.                 telescopeIndex++;
  11.             if (telescopeIndex >= 2) {
  12.                 timer = -12;
  13.                 phase = 1;
  14.             }
  15.         }
  16.         break;
  17.        
  18.         case 1: { //blink twice
  19.             timer++;
  20.             if (timer >= 3) {
  21.                 telescopeIndex += telescopeBlinkDir;
  22.                 if (telescopeIndex == 4 || telescopeIndex == 2) {
  23.                     telescopeBlinkDir = -telescopeBlinkDir;
  24.                     telescopeBlinkCount++;
  25.                 }
  26.                 timer = 0;
  27.                 if (telescopeBlinkCount >= 4) {
  28.                     telescopeBlinkCount = 0;
  29.                     if (!telescopeHasTurned)
  30.                         phase = 2;
  31.                     else {
  32.                         telescopeHasTurned = false;
  33.                         phase = 3;
  34.                     }
  35.                 }
  36.             }
  37.         }
  38.         break;
  39.        
  40.         case 2: { //turn telescope
  41.             timer++;
  42.             if (timer >= 7) {
  43.                 timer = 0;
  44.                 if (!telescopeHasTurned) {
  45.                     if (telescopeIndex == 2)
  46.                         telescopeIndex = 5;
  47.                     else if (telescopeIndex == 5) {
  48.                         telescopeXScale = -telescopeXScale;
  49.                         telescopeHasTurned = true;
  50.                     }
  51.                 }
  52.                 else {
  53.                     telescopeIndex = 2;
  54.                     timer = -12;
  55.                     phase = 1;
  56.                 }
  57.             }
  58.         }
  59.         break;
  60.        
  61.         case 3: { //lower telescope
  62.             timer++;
  63.             if (timer % 7 == 0)
  64.                 telescopeIndex--;
  65.             if (telescopeIndex <= 0) {
  66.                 timer = 0;
  67.                 phase = 0;
  68.             }
  69.         }
  70.         break;
  71.     }
  72.     var box = ternary(image_xscale > 0, bbox_right - 4, bbox_left + 4);
  73.     if (!solid_instance_position(box, bbox_bottom + 3, objSolid) &&
  74.         !solid_instance_position(box, bbox_bottom + 3, objTopSolid)) {
  75.         image_xscale = -image_xscale;
  76.         xspeed = 0.5 * image_xscale;
  77.     }
  78.     general_collision_noreset();
  79.     var anim = handle_animations_ext(id, propellerAnimTimer, propellerAnimTimerLimit, sprFrostDiverPropeller, propellerIndex);
  80.     propellerAnimTimer = anim[0];
  81.     propellerIndex = anim[1];
  82. }
  83.  
  84. USER EVENT 14
  85. image_xscale = -image_xscale;
  86. xspeed = 0.5 * image_xscale;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement