
-----------------------------------
gigaman
Fri Jan 14, 2005 10:01 am

ghost collision detection
-----------------------------------
i need to know if anyone can give me an idea of how to fix this. the enemies should change to a random direction when they hit a wall. eventually this will be put into a pacman program.

-----------------------------------
w00t
Fri Jan 14, 2005 10:19 am


-----------------------------------
Hmm.. I ran this and nothing happened, ghosts where not drawn or anything, just the walls. Sorry i cant help

-----------------------------------
gigaman
Fri Jan 14, 2005 10:13 pm

update
-----------------------------------
i don't know wat is wrong but you have to extract the file to be able to use it.

-----------------------------------
Cervantes
Sat Jan 15, 2005 10:38 am


-----------------------------------
You know, you can combine conditions using or and and.  Right now, you've got a ton of if statements that have the same code inside them, just different conditions.
Take this example:

if x = 1 then
  put x
elsif x = 2 then
  put x
end if

that can be shortened to:

if x = 1 or x = 2 then
  put x
end if


As for your problem, try switching the placement of your procedures.  That is, call the collision procedure before the draw procedure.  I believe the problem is that the picture covers up the blue line, so when the collision proc is called, it doesn't detect the blue line.

-----------------------------------
gigaman
Mon Jan 17, 2005 9:24 am

update
-----------------------------------
ok. i know what the problem is with it but i have no more ideas how to solve it. the problem is that when it reaches a side and move in that side's dorection again it is able to leave. example: if he starts at the top and goes down he cannot go daown again. however he can go right then go down again and leave. my idea was to have a sort of level system of whatdotcolours but that hasn't worked either. if soeone has an idea to solve this please help.
