Computer Science Canada collision detection problem help! |
Author: | staticlike [ Fri Apr 29, 2005 12:07 pm ] | ||
Post subject: | collision detection problem help! | ||
I'm having a tad bit of trouble with my collision detection on the game that i am creating. the only thing is, i don't understand why it is giving me trouble. here's my collision detection code:
mx and my are the missile's coordinates, walls is a 2d array of int, a 1 signifies a wall, launchm is the check that a there is a launched missile, rockettype is the kind of rocket the player is using. The problem is when the player shoots the rocket right next to a wall. it will destroy the wall and keep going, as if the wall wasn't there, and get destroyed when it hits the next wall. Any idea on why it does this? |
Author: | Delos [ Fri Apr 29, 2005 8:14 pm ] | ||
Post subject: | |||
I don't see an incorporation of the launchm boolean anywhere. You might want to enclose your code with:
|
Author: | staticlike [ Mon May 02, 2005 11:46 am ] |
Post subject: | |
It already is enclosed inside of it, alongside the moving of it, so it can immediately destroy the wall if it moves into it. oh yea, i found out the problem, though i don't remember what it was because i'm usually quite forgetful, plus it's been a few days after i fixed it. ![]() |