RATED ARCADE
Member
I'm looking to have my enemy object moving randomly in 8 directions with it facing & moving in the same direction. I'm using the enemy object as a target so my goal is to hit it, thus why I need it to move randomly.
Step Event:
switch (direction div 90)
{
case 0: sprite_index=sprite_Thunder_Viking_Running_Right; break; //Change these sprite names to the ones in your game!!!
case 45: sprite_index=sprite_Thunder_Viking_Running_Up_Right; break;
case 90: sprite_index=sprite_Thunder_Viking_Running_Up; break;
case 135: sprite_index=sprite_Thunder_Viking_Running_Up_Left; break;
case 180: sprite_index=sprite_Thunder_Viking_Running_Left; break;
case 225: sprite_index=sprite_Thunder_Viking_Running_Down_Left; break;
case 270: sprite_index=sprite_Thunder_Viking_Running_Down; break;
case 315: sprite_index=sprite_Thunder_Viking_Running_Down_Right; break;
}
Alarm: [0]
direction=irandom_range(0,365)
speed=2
alarm[0]=60
I'm guessing that the Case is the degrees it should be moving in but, it isn't facing in the direction it should be moving in. Can someone assist?
Step Event:
switch (direction div 90)
{
case 0: sprite_index=sprite_Thunder_Viking_Running_Right; break; //Change these sprite names to the ones in your game!!!
case 45: sprite_index=sprite_Thunder_Viking_Running_Up_Right; break;
case 90: sprite_index=sprite_Thunder_Viking_Running_Up; break;
case 135: sprite_index=sprite_Thunder_Viking_Running_Up_Left; break;
case 180: sprite_index=sprite_Thunder_Viking_Running_Left; break;
case 225: sprite_index=sprite_Thunder_Viking_Running_Down_Left; break;
case 270: sprite_index=sprite_Thunder_Viking_Running_Down; break;
case 315: sprite_index=sprite_Thunder_Viking_Running_Down_Right; break;
}
Alarm: [0]
direction=irandom_range(0,365)
speed=2
alarm[0]=60
I'm guessing that the Case is the degrees it should be moving in but, it isn't facing in the direction it should be moving in. Can someone assist?