Author |
Message |
gigaman
|
Posted: Fri Jan 14, 2005 10:01 am Post subject: 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.
Description: |
|
Download |
Filename: |
final assignment.zip |
Filesize: |
66.86 KB |
Downloaded: |
191 Time(s) |
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
w00t
|
Posted: Fri Jan 14, 2005 10:19 am Post subject: (No subject) |
|
|
Hmm.. I ran this and nothing happened, ghosts where not drawn or anything, just the walls. Sorry i cant help
|
|
|
|
|
|
gigaman
|
Posted: Fri Jan 14, 2005 10:13 pm Post subject: update |
|
|
i don't know wat is wrong but you have to extract the file to be able to use it.
Description: |
may have to change the deelay in draw_enemy |
|
Download |
Filename: |
final assignment.zip |
Filesize: |
66.87 KB |
Downloaded: |
160 Time(s) |
|
|
|
|
|
|
Cervantes
|
Posted: Sat Jan 15, 2005 10:38 am Post subject: (No subject) |
|
|
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:
code: |
if x = 1 then
put x
elsif x = 2 then
put x
end if
|
that can be shortened to:
code: |
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
|
Posted: Mon Jan 17, 2005 9:24 am Post subject: 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.
Description: |
this is the one with the code that has "levels" of whatdotcolours |
|
Download |
Filename: |
final assignment.zip |
Filesize: |
66.92 KB |
Downloaded: |
163 Time(s) |
|
|
|
|
|
|
|