L
LilRony
Guest
/quality title
Jokes aside, I have a problem with an enemy AI that I'm working on. What I'm trying to get is a slug character that moves uniquely.
The way he moves is based on his animation. When the slug is stretched out, he moves a little bit. When he's contracting, he stops moving. This is how I have it working:
moveSpd = 1 * facing;
image_speed = 0.1;
sprite_index = spr_SlugNormal;
// based on slug animation, which frames to move
if (image_index == 0 || image_index == 3) {
hspd = moveSpd;
}else{
hspd = 0;
}
...Now this works correctly, but only for a little bit. After he moves for a little while (about 5 seconds), he just... stops. I don't understand. If I'm just doing something wrong with my if-else nesting, please tell me.
Thanks!
Jokes aside, I have a problem with an enemy AI that I'm working on. What I'm trying to get is a slug character that moves uniquely.
The way he moves is based on his animation. When the slug is stretched out, he moves a little bit. When he's contracting, he stops moving. This is how I have it working:
moveSpd = 1 * facing;
image_speed = 0.1;
sprite_index = spr_SlugNormal;
// based on slug animation, which frames to move
if (image_index == 0 || image_index == 3) {
hspd = moveSpd;
}else{
hspd = 0;
}
...Now this works correctly, but only for a little bit. After he moves for a little while (about 5 seconds), he just... stops. I don't understand. If I'm just doing something wrong with my if-else nesting, please tell me.
Thanks!