I
Ike
Guest
Hey, so I'm trying to trigger a room_goto() event when my player's sprite is at frame 31, which is the last frame of the sprite animation. But it isn't working at all, it's just looping the sprite. I'm using a script to change character sprites so this is my code:
if place_meeting(x,y,obj_jetpack) {
sprite_index = spr_player_blast;
image_speed = 11;
if image_index >= 30 {
show_debug_message("HELLO???")
image_speed = 0;
room_goto(room1);
}
}
The show debug message doesn't even show the message, but my animation definitely gets to frame 30. The weird thing is when I was just trying to figure out the problem, I changed the number 30 to 3 and it worked! But the I changed it to 13 and it didn't work, so I don't know what's going on. I also have this code in the collision event for my obj_player and obj_jetpack because the animation won't even run unless it's in both. How can I fix this?
if place_meeting(x,y,obj_jetpack) {
sprite_index = spr_player_blast;
image_speed = 11;
if image_index >= 30 {
show_debug_message("HELLO???")
image_speed = 0;
room_goto(room1);
}
}
The show debug message doesn't even show the message, but my animation definitely gets to frame 30. The weird thing is when I was just trying to figure out the problem, I changed the number 30 to 3 and it worked! But the I changed it to 13 and it didn't work, so I don't know what's going on. I also have this code in the collision event for my obj_player and obj_jetpack because the animation won't even run unless it's in both. How can I fix this?