Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- STEP EVENT
- event_inherited();
- if (!is_frozen() && !dead) {
- apply_gravity();
- switch (phase) {
- case 0: { //idle & raising telescope
- timer++;
- if ((timer > 90) && (timer % 7 == 0))
- telescopeIndex++;
- if (telescopeIndex >= 2) {
- timer = -12;
- phase = 1;
- }
- }
- break;
- case 1: { //blink twice
- timer++;
- if (timer >= 3) {
- telescopeIndex += telescopeBlinkDir;
- if (telescopeIndex == 4 || telescopeIndex == 2) {
- telescopeBlinkDir = -telescopeBlinkDir;
- telescopeBlinkCount++;
- }
- timer = 0;
- if (telescopeBlinkCount >= 4) {
- telescopeBlinkCount = 0;
- if (!telescopeHasTurned)
- phase = 2;
- else {
- telescopeHasTurned = false;
- phase = 3;
- }
- }
- }
- }
- break;
- case 2: { //turn telescope
- timer++;
- if (timer >= 7) {
- timer = 0;
- if (!telescopeHasTurned) {
- if (telescopeIndex == 2)
- telescopeIndex = 5;
- else if (telescopeIndex == 5) {
- telescopeXScale = -telescopeXScale;
- telescopeHasTurned = true;
- }
- }
- else {
- telescopeIndex = 2;
- timer = -12;
- phase = 1;
- }
- }
- }
- break;
- case 3: { //lower telescope
- timer++;
- if (timer % 7 == 0)
- telescopeIndex--;
- if (telescopeIndex <= 0) {
- timer = 0;
- phase = 0;
- }
- }
- break;
- }
- var box = ternary(image_xscale > 0, bbox_right - 4, bbox_left + 4);
- if (!solid_instance_position(box, bbox_bottom + 3, objSolid) &&
- !solid_instance_position(box, bbox_bottom + 3, objTopSolid)) {
- image_xscale = -image_xscale;
- xspeed = 0.5 * image_xscale;
- }
- general_collision_noreset();
- var anim = handle_animations_ext(id, propellerAnimTimer, propellerAnimTimerLimit, sprFrostDiverPropeller, propellerIndex);
- propellerAnimTimer = anim[0];
- propellerIndex = anim[1];
- }
- USER EVENT 14
- image_xscale = -image_xscale;
- xspeed = 0.5 * image_xscale;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement