This site requires JavaScript, please enable it in your browser!
Greenfoot back

Report as inappropriate.

EmilyC26
EmilyC26 presents ...

2013/11/19

Pacman

I am having trouble getting my ghosts to work like the regular pacman game. I want them to run around the map in any random direction. I'm not so worried about the powerups working right now, I can go back to those later. Any suggestions? PLEASE HELP!!

6122 views / 26 in the last 7 days

1 vote | 0 in the last 7 days

Tags: game demo pacman with-source

open in greenfoot
Your browser does not support the canvas tag.
A new version of this scenario was uploaded on Tue Nov 19 12:35:07 UTC 2013
A new version of this scenario was uploaded on Tue Nov 19 12:37:45 UTC 2013
LightOfDivineLightOfDivine

2013/11/19

Not sure wether you know, but if you run into the wall at the bottom right corner (only tested it there several times) Pacman gets stuck.
EmilyC26EmilyC26

2013/11/19

Thanks. I'll fix that.
A new version of this scenario was uploaded on Tue Nov 19 13:05:44 UTC 2013
A new version of this scenario was uploaded on Mon Nov 25 13:09:07 UTC 2013 Ghosts are getting crazy! PLEASE HELP!
FlicknFlackFlicknFlack

2013/11/25

The glitch LightOfDivine2013/11/19 mentioned is still there. and maybe you should create a path on which the gosts and Pacman walk/fly, this sould fix your ghost and wall problem. and a little hint for your code if you write /* */ then everything between this two signs doesnt count its like // just easier.
shrucis1shrucis1

2013/12/3

Is the problem the ghosts not working? Just from looking at it, I'm guessing that you're having the ghosts do setRotation(Greenfoot.getRandomNumber(360)); This would cause them to turn in any random direction. In pacman, there are only four directions you move in, up, down, right, and left. For this I would reccomend something like this: setRotation(90 * (Greenfoot.getRandomNumber(4))); Also, they seem to be changing direction too often.

Want to leave a comment? You must first log in.

Who likes this?

herusaputra