Introduction to Flash and Actionscript
S4 - Using Buttons, Keyboard, and HitTest
Assignment 6 - Pacman Collisions
Delete the dots when pacman hits them.
End the game when pacman hits a ghost. (You will need to have the last ghost event listener call the first)
Quit will Only work when the game has been compiled not in Testing Mode
Above and Beyond
For both of these you will need to use a variable. See next section! Hints below but I will not solve this for you. (That is why it is above and beyond)
ICS3C students only need to do 1 of the items below. Bonus if you do both. Also I will help if you need an explanation.
1. Add a scoring system
Use a printScore function to initialize score and print it in a text box
// Initialize score variable
On your dots hittests add one to the score
// to add to score
To exit a a certain score put an if condition in the printScore function
// add an if to your printScore function
remove the event listener
2. Hittest your walls in you hittest function, so that pacman cannot travel through them.
hit = true
else if (pacman_mc.hitTestObjec(wall2_mc))
hit = true
// Keep going for all your walls
// last condition is an else
if no wall is hit
hit = false
At the start of your program initialize hit
if (hit == false)
// All your normal commands
if (hit == true)
// move in opposite direction (incease number slightly)
Embed all tutorials, assignments, and code.
Attach your .swf files
Link to your .fla files
Copy the Evaluation Sheet to your google drive and post the link at the top of your webpage.