pbinsted
asked on
Sprite collision detection
I'm currently writing a game in which you control a little
character with a gun. But I was wondering how I could detect wether or not the character is standing next to a wall. Right now, the character runs through the wall. I've used the div function to check the sector next to the character to see if its blank, however, the character can move into the next sector before he is "in" the next sector and thus is drawn half way in the wall. How can I detect if the character can walk to the right or left?
character with a gun. But I was wondering how I could detect wether or not the character is standing next to a wall. Right now, the character runs through the wall. I've used the div function to check the sector next to the character to see if its blank, however, the character can move into the next sector before he is "in" the next sector and thus is drawn half way in the wall. How can I detect if the character can walk to the right or left?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.