image_index = (direction + 22.5) / 45; if (direction + 22.5 >= 360 ) { image_index = 0; } if (hp <= 0) { instance_destroy(); }