MicroWorlds

Pacman

PacMan Instructions

Create a screen like the one below



You will need to hatch 5 turtles. Name one of them Roger and the other four Munch1, Munch2, Munch3 and Munch4 and give the Munchies the shape of a bee (or you could be creative and give them other shapes)
Give Roger the instruction: keycontrol and select Many Times

Give the Munchies the instruction:
       towards "roger repeat 50 [fd random ( score + 2 ) check]
       and select Many Times

Hatch another 5 turtles and give them the shapes of flowers and position them as in the screen above.

Give them the instruction: if touching? "t2 "Roger [setscore score + 1 ht]
Where t2 is the flowers name, so t2 will need to be changed to t3 if the flowers name is t3. And select Many Times

Give the background colour the instruction: bk 5 rt random 360

Create New_Game and End_Game buttons and a slider called Score

Enter the procedures shown below and then test your game. The object of the game is to gather as many flowers as possible before the bees get you.

to startup
  presentationmode
  Roger, setsh 0
end

to New_Game
  positions
  setscore 0
  everyone [st clickon]
end

to positions
  Roger, setpos [19 10]
  setsh 0
  seth 0
  Munch1, setpos [-258 89]
  Munch2, setpos [-265 -124]
  Munch3, setpos [79 -123]
  Munch4, setpos [136 90]
end

to keycontrol
  Roger, getchoice
  if :answer = "i [fd (score + 5)]
  if :answer = "l [rt 15]
  if :answer = "j [lt 15]
end

to getchoice
  make "answer readchar
end

to check
  if touching? who "Roger [Roger, setsh "deadRoger wait 10 announce [game over] stopall]
  if score = 5 [announce [You have completed level 1] setscore 6 everyone [st] positions]
  if score = 10 [announce [winner]]
end

to End_Game
  everyone [clickoff]
end




Created by Geoff Adcock
Last Update: 23-Oct-2006