fefagundes15
Member
Please help me,
I have a trouble with the moves of the enemies in my game!!
They are facing right, but when they walk to left, they don't turn to the left and make a "moonwalk".
Also, I can't make they change to stopped sprite when they are stopped and they keep with the walking animation even if they are stopped.
Variables:
hp=100
enemy_speed=2.5
Code:
if(distance_to_object(obj_character)<300 && hp>0){
mp_potential_step(obj_character.x, obj_character.y, enemy_speed, true);
}
if enemy_speed<=0{
enemy_speed=0;{
sprite_index=spr_enemy_stopped;image_speed=0.3}
}
I made a code to the enemy follow my character and this is working. Only the animation of enemy stopped and turned to the left is not working.
I have a trouble with the moves of the enemies in my game!!
They are facing right, but when they walk to left, they don't turn to the left and make a "moonwalk".
Also, I can't make they change to stopped sprite when they are stopped and they keep with the walking animation even if they are stopped.
Variables:
hp=100
enemy_speed=2.5
Code:
if(distance_to_object(obj_character)<300 && hp>0){
mp_potential_step(obj_character.x, obj_character.y, enemy_speed, true);
}
if enemy_speed<=0{
enemy_speed=0;{
sprite_index=spr_enemy_stopped;image_speed=0.3}
}
I made a code to the enemy follow my character and this is working. Only the animation of enemy stopped and turned to the left is not working.