Publishers of technology books, eBooks, and videos for creative people

Home > Articles > Design > Adobe Creative Suite

  • Print
  • + Share This
Like this article? We recommend

Life Is Short

Some more script can be added to remove a life from the player who misses the ball with the paddle. That script is shown here:

   if (this.MovieClip._y>(GamePlayArea[3]+20)) {
     theBallsList[] = 0;
     if (CurrentBallNum<=0) {
        if (ballsLeft<0) {
          ballsLeft = 0;
          gameOn = 0;
          gotoAndStop (5);
        } else {

In this script, Flash looks for the current position of the ball in relationship to GamePlayArea. If the ball falls below a specific point, such as the bottom of the screen, the player automatically loses a life.

  • + Share This
  • 🔖 Save To Your Account