if (appearing && !working) {
	image_xscale += appearingSpeed;
	if (image_xscale >= 1) {
		image_xscale = 1;
		working = true;
		appearing = false;
	}
}

if (working) {
	--disappearingDelay;
	if (disappearingDelay == 0) {
		working = false;
		disappearing = true;
	}
	
	var _x1 = x - size;
	var _x2 = x + size;
	var _y1 = obj_player.y - 10000;
	var _y2 = obj_player.y + 10000;
	if (collision_rectangle(_x1, _y1, _x2, _y2, obj_player, false, true)) {
		hurtPlayer();
		bounceFromLaser(obj_player, id);
		if (global.sound && obj_player.visible) {
			audio_play_sound(snd_crash, 0, false);
		}
	}
	with (obj_enemy) {
		if (collision_rectangle(_x1, _y1, _x2, _y2, id, false, false)) {
			if (armor <= 0 && hitTimer == 0) {
				instance_destroy();
			} else {
				if (hitTimer == 0) {
					--armor;
					hitTimer = hitDelay;
				}
				bounceFromLaser(id, other);
			}
		}
	}
}

if (disappearing) {
	image_xscale -= disappearingSpeed;
	if (image_xscale <= 0) {
		instance_destroy();
	}
}