Computer Science Canada Help with Collision detection. |
Author: | recneps [ Thu Feb 26, 2004 9:19 pm ] | ||
Post subject: | Help with Collision detection. | ||
I am making a game, and im gonna have blocks, which if you try to go inside one, collision is true, and if its true then you cant move in. Got that? well heres my code, there something wrong. if you go "too far" in a wall, you get stuck. ive been over code like 50 times. Can anyone find the problem?
|
Author: | Paul [ Thu Feb 26, 2004 9:29 pm ] |
Post subject: | |
I dunno, cause I can't figure out your code without looking at it closely, and I don't wanna do that, cause Im too tired, but I made the same kind of program, the only difference is using whatdotcolor instead of the coordinates. |
Author: | Tony [ Thu Feb 26, 2004 11:45 pm ] | ||||
Post subject: | |||||
i dont see collision := false anywhere in your program... once it is made to be true, it will always stay that way instead you should make collisions into a function that returns true/false... such as
and in the program you just use the function in your if statement
|
Author: | recneps [ Fri Feb 27, 2004 4:40 pm ] |
Post subject: | |
Haha, im so stupid. Thanks tony ill get on fixing that. I knew it was a simple problem. |