try this
Code:
case spr_enemy_right :
case spr_enemy_attack_right:
sprite_index = spr_enemy_attack_right
if (image_index >=0 || image<= 1)
{
instance_create(x,y, obj_hitbox)
}
attack = 0
break;
basically you ask if the sprite index is spr_enemy_right or spr_enemy_attack_right and if either is true you set the sprite index to spr_enemy_attack_right and create the hitbox object. there is ofcorse a more efficient way to do this but i dont want to mess with your coding process.
also about the switch statement
when you add break after a couple of cases, its like you ask if either of those cases is true
so
switch (move)
{
case 1:
case 2:
case 3:
//do somthing
break;
}
is the same as
if (move==1 or move==2 or move==3) {do somthing};