HitTest: Code for the movie
Modify the movie by adding code for hitting and missing the paddle.
var numHits:int=0;
function hitPaddle(): void {
numHits++;
lblHits.text=numHits.toString();
}
function missPaddle(): void {
numHits--;
if(numHits<0) numHits=0;
else lblHits.text=numHits.toString();
}
Download the movie.
INDEX,
Detect if an object hit another,
Detect if an object hit a target inside another,
Catch a Falling Star Game,
Add a paddle,
Add code to movie for hit and miss,
Modify FallingStar to hit and miss,
Add code to move the paddleNext lesson:
Strings in ActionScript