Hi i have an issues with my AS2 code when the health reaches zero it should go to the next scene called "gameOver" but it seems to do nothing but it is working because it is tracing the output "hello".
I don't know why the actual function is not working but here is the code that i have used
In the Home scene:
userScore = 0;
userHealth = 100;
stop();
In the movie clip object
onClipEvent(enterFrame){
if (this.hitTest(_root.enemy) && _root.userHealth <= 0)
{
nextScene();
}
}
In the enemy movie clip object
onClipEvent (enterFrame) {
if (this.hitTest(_root.ball))
{
_root.userHealth -= 10;
}
}
There is a stop in the gameOver scene as well so that it doesn't just jump onto the next scene.
I am still a beginner so do take it easy on me haha thanks