halttimer -= 1 if halttimer <= 0 {vspeed = 0} if halttimer <= -60 { if x < 120 {hspeed = -1} if x >= 120 {hspeed = 1} } if instance_exists(o_playership) {shotrotate = point_direction(x,y,o_playership.x,o_playership.y)} else {shotrotate = 270} shottimer -= 1 if shottimer = 0 { if distance_to_object(o_playership) > 40 { switch(global.stack) { case 0: emit(x,y,shotrotate + 30,2,o_ebullet0) emit(x,y,shotrotate + 10,2,o_ebullet0) emit(x,y,shotrotate,2,o_ebullet0) emit(x,y,shotrotate - 10,2,o_ebullet0) emit(x,y,shotrotate - 30,2,o_ebullet0) break case 1: emit(x,y,shotrotate + 30,2,o_ebullet0) emit1(x,y,shotrotate + 10,2,o_ebullet0) emit1(x,y,shotrotate,2,o_ebullet0) emit1(x,y,shotrotate - 10,2,o_ebullet0) emit(x,y,shotrotate - 30,2,o_ebullet0) break case 2: emit1(x,y,shotrotate + 30,2,o_ebullet0) emit1(x,y,shotrotate + 10,2,o_ebullet0) emit1(x,y,shotrotate,2,o_ebullet0) emit1(x,y,shotrotate - 10,2,o_ebullet0) emit1(x,y,shotrotate - 30,2,o_ebullet0) break case 3: emit2(x,y,shotrotate + 30,2,o_ebullet0) emit2(x,y,shotrotate + 10,2,o_ebullet0) emit2(x,y,shotrotate,2,o_ebullet0) emit2(x,y,shotrotate - 10,2,o_ebullet0) emit2(x,y,shotrotate - 30,2,o_ebullet0) break } } shottimer = bspeed } if distance_to_object(o_playership) <= 40 {global.seal += 1} if x < -32 {instance_destroy(); global.escape += 1} if x > room_width + 32 {instance_destroy(); global.escape += 1} // Death if hp <= 0 { if pshot/inithp >= 0.5 {efficiency = 1} if nshot/inithp >= 0.5 {efficiency = 0.5} if pshot = 0 {efficiency = 0.25} if bombed = 1 {efficiency = 0} if efficiency = 1 {txt = instance_create(x,y,d_notice); txt.indicator = 3} if efficiency = 0.5 {txt = instance_create(x,y,d_notice); txt.indicator = 2} if efficiency = 0.25 {txt = instance_create(x,y,d_notice); txt.indicator = 1} if efficiency = 0 {txt = instance_create(x,y,d_notice); txt.indicator = 0} global.efficiency += efficiency * 2 global.destroyed += 1 sound_stop(sfx_destroy1) sound_play(sfx_destroy1) instance_create(x - 16 + random(32),y - 16 + random(32),o_explosion) instance_create(x - 16 + random(32),y - 16 + random(32),o_explosion) instance_create(x - 16 + random(32),y - 16 + random(32),o_explosion) instance_create(x - 16 + random(32),y - 16 + random(32),o_explosion) if bombed = 1 { if nshot > 30 {global.initial += (4 - ((nshot - 30)/30)) / 10} else {global.initial += 0.4} } else { if nshot > 30 {global.initial += 4 - ((nshot - 30)/30)} else {global.initial += 4} } instance_destroy() }