
-----------------------------------
Armir
Tue Apr 19, 2005 7:20 pm

Collision code
-----------------------------------
Hey, i have an assignment where I have to create a PACMAN game and I've done everything except making the pacman stop at certain points. I was just wondering if anyone could help me out. Thnx  :D

-----------------------------------
Vertico
Tue Apr 19, 2005 7:36 pm


-----------------------------------
i can help. considering im also making a pacman game.

to stop him at certain places you can use an x- y- cordinates to see were its suppost to stop.  for example...


if x = (somewhere between 0 to maxx) then
x -=1
end if


or you can use something called whatdotcolor to determine if the cordinates hit a color or not hit a color when moving. so if the walls are bue and u want it 2 stop when u reach it then u do something like....


if whatdotcolor (x , y) = blue then
(whatever you want it to do.)
end if



i used whatdotcolor in my game. some ppl say its not good, but its alot easyer then finding the exact cordinates of every wall.

you can look up both ways of "stopping at certain points" in the tutorials if this didnt make much sence

-----------------------------------
jamonathin
Tue Apr 19, 2005 10:12 pm


-----------------------------------
just to add to what the samurai cat guy said.  if you're going to use coordinates, make sure you take in mind that he's going to be moving there, so when ur checking use:
Left or right (x - dif) or (x + dif)
Up and Down (y + dif) or (y - dif)
and just add in >0 or 