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

Username:   Password: 
 RegisterRegister   
 Need Help Please,
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Pacman




PostPosted: Sun Oct 29, 2006 2:13 pm   Post subject: Need Help Please,

Hello,
Need to make a game for programming class and the teacher just doesnt teach, Smile Anyways im starting on my pacmaNbeta game and having some troubles, I got pacman runnin aroound and stuff and i got the board hes runnin round but im having some troubles with the whole colission thing and him not being able to walk thru walls etc. Any help on that would be great and i would love you long time Smile

Thanks
pacmaN,
Sponsor
Sponsor
Sponsor
sponsor
razrdude




PostPosted: Sun Oct 29, 2006 2:19 pm   Post subject: (No subject)

umm not that i can be of much help, but its easier if you show the code you have so far, so we can properly understand your problem, then maybe some of the "pros" can help.
md




PostPosted: Sun Oct 29, 2006 4:20 pm   Post subject: (No subject)

I know there are tutorials on collision in the [turing tutorials] section.
richcash




PostPosted: Wed Nov 01, 2006 6:15 pm   Post subject: (No subject)

This is a good approach for Pacman.
Pacman can be very simple. If you split the screen up into theoretical squares and then assign an array representing each square as a monster, wall, dot, pacman himself, etc, it becomes very easy to detect collision (you just check if the square pacman is in has a monster). And it's not only for very basic games, it's also a good approach for Snake and Tetris (although they involve other things aswell).
DemonZ




PostPosted: Wed Nov 01, 2006 9:01 pm   Post subject: (No subject)

For the pacman game, are u using imported pictures or objects created in turing, if there made in turing, i suggest u look up whatdotcolor for your collision, this will only work if u have the objects (walls, pacman, monster) as one solid color, atleast on the outside, this will simplify ur program and make the collision code easier to write and still accurate enough
DemonZ




PostPosted: Wed Nov 01, 2006 9:05 pm   Post subject: (No subject)

Now question about the tiles way of detecting collision, how would u have an array represent a square on the screen, would u have to make the array for x and y, and somehow combine them when checking for collision, if u could show me how this work, i could understand it better. because i wouldnt mind experimenting with this "tile style" way of checking for collision.
richcash




PostPosted: Thu Nov 02, 2006 12:45 pm   Post subject: (No subject)

I wouldn't call it a way of checking for collision, it's just how most pacman games are made. If you ever play pacman he moves one body length (or one tile at a time). You can never have him half-eating a dot, or half way between two dots. It makes it so simple. It is not THE best way to do things, but it's definetely the easiest way.

You have a two-dimensional array representing the tile's column and row. Each element in the array can be 0 for nothing, 1 for a wall, 2 for a dot, 3 for a monster. Then move your pacman in terms of the columns and rows, and check the array to see what's in the tile pacman is on (if it's a wall, don't let him move there, if it's a dot score increases, if it's a monster lose a life, etc.).
DemonZ




PostPosted: Fri Nov 03, 2006 1:53 am   Post subject: (No subject)

Oh ok but could u use it for other such related games, im thinking u could but the tile way would be best for the pacman game.
Sponsor
Sponsor
Sponsor
sponsor
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  [ 8 Posts ]
Jump to:   


Style:  
Search: