I’m creating a small game for some of my pupils and I’m almost done. However, there’s a tiny problem with the function I’m using as instead of losing a life, the player goes from lose life to game over. Any ideas why?
I've added the correct frame labels and
stop();
actions on each frame.
Her’e’s part of the function:
if (Math.abs(bunny._x - fox._x) <= 10 and Math.abs(bunny._y - fox._y) <= 10) {
if (lives < 1) {
gotoAndStop("game over");
} else {
lives--;
gotoAndStop("lost life");
}
}
}
If anyone knows what to do or anywhere to look please let me know, I really want to finish this!
Cheers,
Y