collision detection please help!!!

Started by
1 comment, last by hello_there 22 years, 4 months ago
ok i figured a way to do sprite to background collision but i want work properly. ok here''s how i did it i made a function to tell me where in the screen the player is. and each tile is either a 0 passable or 1 wall. but when i do it half the wall you can walk through and i don''t know way a can''t figure it out. any surgestion? is there anywhere i can put my code to show you? i realy need some help.
____________________________________________________________How could hell be worse?
Advertisement
oh yeah btw it''s in open gl if you need to know that.
____________________________________________________________How could hell be worse?
Test each vertex of the player sprite (ie 4 if its a quad) against the tiles, or test just one but remember to take into account the width of the player.

ie if the player is 20 units wide, and you only test the top left vertice and are testing against a wall on the right of the player, test the vertice against an area 20 units left of the wall. If it fails there, then the right of the player is entering the wall.

-----------------------
0wn 0wn 0wn your goat
gently down the pw33n
-----------------------"When I have a problem on an Nvidia, I assume that it is my fault. With anyone else's drivers, I assume it is their fault" - John Carmack

This topic is closed to new replies.

Advertisement