collision detection please help!!!
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.
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
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement