• moveUp
• moveLeft
• moveRight
• moveDown
PacMan teaching procedure 1. Play a normal round 1. Hard code the ghosts to move in certain directions 1. Have students code an if-statement to control ghost 1. If statement based on where pac-man is 1. While loop with if-statement inside 1. Make sure ghost does not get stuck 1. Maybe let them see the actual code for the normal game, quick blurb about AI idk 1. Play with friends Step 2 sample code: move(right, 3) move(down, 2) etc. Step 3 sample code: if(ghost can move right) move right else if(ghost can move left) move left etc Step 4: If (pac man to the right and can move right) move right Else if (pac man to the left and can move left) Move left Etc Step 5: While (not at end of game) If (pac man to the right and can move right) move right Else if (pac man to the left and can move left) Move left etc with up and down
Alert You need a bigger screen to play this game... for now... (hit play)