Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Play a movie clip when player reaches a certain score

New Here ,
May 16, 2018 May 16, 2018

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!

146
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 16, 2018 May 16, 2018
LATEST

check your scope: what's alert(this) show?

[moved from Adobe Creative Cloud to Adobe Animate CC - General]

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines