Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 pac-man help
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Chaos_Theory




PostPosted: 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?
Sponsor
Sponsor
Sponsor
sponsor
Cervantes




PostPosted: Wed Apr 20, 2005 4:42 pm   Post subject: (No 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
Chaos_Theory




PostPosted: Wed Apr 20, 2005 4:43 pm   Post subject: (No 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
Cervantes




PostPosted: Wed Apr 20, 2005 4:48 pm   Post subject: (No 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?
Chaos_Theory




PostPosted: Wed Apr 20, 2005 4:57 pm   Post subject: (No 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
Cervantes




PostPosted: Wed Apr 20, 2005 5:20 pm   Post subject: (No 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.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: