Computer Science Canada

pac-man help

Author:  Chaos_Theory [ Wed Apr 20, 2005 4:38 pm ]
Post subject:  pac-man help

there are only 2 things I need help with...

1) how to make a 'smart' ghost taht can track down pac-man, without going through teh walls

2) is tehre a quicker way to set boundries of where pac-man can with than to write if x > 10 and x < 20 and y < 2 and y > 8 then (code that stopes him from moving up or down...or left or right)

cause that will take alot of time, and need alot of coding..so is there a shorter way to do it?

Author:  Cervantes [ Wed Apr 20, 2005 4:42 pm ]
Post subject: 

1) Check the other thread

2) I've never made Pacman, but perhaps you could use the fact that the walls are always the same thickness to your advantage. Though pacman will not be moving on a grid system (he does, but each grid is 1pixel by 1pixel), the walls will be. Are you loading your map in from a file? Do you have a 2d array for your map? If so, perhaps you could just multiply the position of each wall segment by the thickness of each wall segment. If not, I suggest you look into them.

Cervantes

Author:  Chaos_Theory [ Wed Apr 20, 2005 4:43 pm ]
Post subject: 

Cervantes wrote:
1) Check the other thread

2) I've never made Pacman, but perhaps you could use the fact that the walls are always the same thickness to your advantage. Though pacman will not be moving on a grid system (he does, but each grid is 1pixel by 1pixel), the walls will be. Are you loading your map in from a file? Do you have a 2d array for your map? If so, perhaps you could just multiply the position of each wall segment by the thickness of each wall segment. If not, I suggest you look into them.

Cervantes


yes im loading the map in from anotehr file... so chances are i'm gonna have to spedn liek an hour just setting restrictions

Author:  Cervantes [ Wed Apr 20, 2005 4:48 pm ]
Post subject: 

Chaos_Theory wrote:

so chances are i'm gonna have to spedn liek an hour just setting restrictions

Why? Can't you use the method I described above?

Author:  Chaos_Theory [ Wed Apr 20, 2005 4:57 pm ]
Post subject: 

Cervantes wrote:
Chaos_Theory wrote:

so chances are i'm gonna have to spedn liek an hour just setting restrictions

Why? Can't you use the method I described above?


well... I just thought of a better way to do it.. Very Happy

Author:  Cervantes [ Wed Apr 20, 2005 5:20 pm ]
Post subject: 

Sweet. Mind sharing?
But, the way you're talking about it ("an hour just setting up restrictions"), it sounds as though it's going to be lots of if statements.


: