Copy link to clipboard
Copied
I've followed the Adobe Animate HTML5 Canvas Flappy Bird tutorial by Christopher Caleb, and I'm wondering if anyone has a solution for what I'm trying to do.
I want an animation to play when the player reaches a certain score. The animation is in one layer and is a movie clip symbol with an instance name of "animation" which is on frame 3 in the timeline. I got the game to send an alert when the player reaches the score which is set as 2 for now. But, I cannot get the animation to play at that time also.
Here is the code for the function where the player scores a point.
Main.prototype.scoredPoint = function()
{
if (this.score === 2){
alert("You win!");
this.stop();
this.gotoAndPlay(3);
}
else{ this.score++;
this.ui.updateScore(this.score);
}
}
If anyone is familiar with this tutorial and has any ideas of what needs to be added/changed throughout the code, help would be much appreciated.
Thank you!
Copy link to clipboard
Copied
check your scope: what's alert(this) show?
[moved from Adobe Creative Cloud to Adobe Animate CC - General]
Find more inspiration, events, and resources on the new Adobe Community
Explore Now