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[this.name] = 0; removeMovieClip(this.MovieClip); CurrentBallNum--; if (CurrentBallNum<=0) { ballsLeft--; if (ballsLeft<0) { ballsLeft = 0; gameOn = 0; gotoAndStop (5); } else { addNewBall(); } } }
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.