if (!visible) { if (!global.pause_plat) sinertimer++; if (!wants_respawn) { with (obj_plat_player) { if ((fallen_in_pit && x < other.x) || (scr_trigcheck_ext("start_reset", self) && x < (other.x - 400))) other.wants_respawn = true; } } else { with (obj_plat_player) { if (grounded) other.restore_cloud(); } } exit; } if (init == 0) { init = true; if (has_flower) { flower = instance_create(x, y, obj_plat_blueflower); with (flower) scr_darksize(); flower.has_coin = false; } } if (!global.pause_plat) sinertimer++; with (obj_plat_player) { if (grounded && ground == other.platform) { if (!other.landed) { other.landed = true; other.was_touched = true; repeat (6) { var d = other.depth; var xx = x + random_range(-20, 20); with (instance_create(xx, other.y, obj_animation)) { sprite_index = spr_bhero_dust; image_speed = 0.1; image_blend = #40A0FF; image_xscale = random_range(1, 2); image_yscale = image_xscale; scr_lerpvar("image_yscale", image_yscale, 0, 30); scr_lerpvar("image_xscale", image_xscale, 0, 30); depth = d + 10; vspeed = random_range(-4, -12); friction = 0.5; hspeed = random_range(-4, 4); } } } } else if (other.landed) { other.landed = false; } } if (landed || custom_landed) { squishtimer = scr_approach(squishtimer, 1, 0.2); } else if (squishtimer > 0) { squishtimer = scr_approach(squishtimer, 4, 0.2); if (squishtimer == 4) squishtimer = 0; } if (!is_being_shot && place_meeting(x, y, obj_plat_bulletred_laser) && !scr_trigcheck_ext("guntrigger", 910)) { is_being_shot = 1; explodetimer = 1; stop_sound(); } if (!is_being_shot && has_flower) { if (!instance_exists(flower)) get_shot(); with (flower) { if (con != 0) { with (other) get_shot(); } } } if (has_flower && instance_exists(flower)) { flower.x = x; flower.y = bbox_top + 2; } if (movepattern == 0) { x += h_amp; y_anchor += v_amp; } if (movepattern == 1) { x += h_amp; y_anchor = ystart + (v_amp * sin(v_offset + (v_freq * sinertimer * 0.05))); } if (movepattern == 2) { y_anchor += v_amp; x = xstart + (h_amp * sin(h_offset + (h_freq * sinertimer * 0.05))); } if (movepattern == 3) { x = xstart + (h_amp * sin(h_offset + (h_freq * sinertimer * 0.05))); y_anchor = ystart + (v_amp * cos(v_offset + (v_freq * sinertimer * 0.05))); } y = y_anchor + (sin((sinertimer + siner_timer_offset) * 0.1) * 4); if (has_active_plat) { var xx = platform.x; var yy = platform.y; platform.image_angle = image_angle; platform.x = (x - lengthdir_x(0.5 * sprite_width, image_angle)) + lengthdir_y(0.5 * sprite_height, image_angle); platform.y = bbox_top + 2; platform.dif_x = platform.x - xx; platform.dif_y = platform.y - yy; } if (active_timer > 0) { active_timer--; } else if (active_timer == 0 && !has_active_plat) { platform = instance_create(x - (40 * image_xscale), y - (20 * image_xscale), obj_plat_floor); platform.image_xscale = image_xscale; if (sprite_index == spr_blue_platform_long) platform.image_xscale *= 3; if (sprite_index == spr_blue_platform_long_invcolor) platform.image_xscale *= 3; platform.visible = false; active_timer = -1; has_active_plat = true; } if (explodetimer > 0 && !global.pause_plat) { explodetimer--; if (chargesound != -4) { snd_volume(chargesound, lerp(0.1, 0.7, (25 - (explodetimer - 5)) / 25), 0); snd_pitch(chargesound, lerp(0.5, 1, (25 - (explodetimer - 5)) / 25)); } if (explodetimer == 0) { snd_play(snd_paperbreak); snd_play(snd_enemy_defeat_quick); var _y = (bbox_bottom + bbox_top) / 2; with (instance_create_depth(x, y, depth, obj_plat_vfx)) { sprite_index = spr_smokepuff; image_blend = #40A0FF; image_speed = 0.5; } with (instance_create_depth(x, y, depth + 1, obj_plat_vfx)) { sprite_index = spr_smokepuff; image_blend = c_blue; image_speed = 0.5; image_xscale *= 1.2; image_yscale *= 1.2; } var ang = 0; repeat (16) { ang += 22.5; var d = other.depth; with (instance_create(x, y, obj_animation)) { sprite_index = spr_bhero_dust; image_speed = random_range(0.05, 0.12); image_blend = choose(c_blue, #40A0FF); image_xscale = random_range(1, 2); image_yscale = image_xscale; scr_lerpvar("image_yscale", image_yscale, 0, 30); scr_lerpvar("image_xscale", image_xscale, 0, 30); depth = d + 10; friction = 0.5; direction = ang; speed = random_range(5, 12); } } is_being_shot = false; active_timer = 60; explodetimer = 0; has_active_plat = false; destroy_platform(); } }