Sprite to tile hit detection is not accurate?
by Chris Dillman · in Torque Game Builder · 08/03/2005 (11:12 pm) · 2 replies
Sprite to tile hit detection is not accurate?
Or so its seems.
I have looked all over the forums for answers and I have found things that sound a bit like what I am seeing but with no explicit directions on how to fix.
What I am see is..
I have a map of 32x32 square tiles.
I have a square 32x32 sprite.
At times collisions seem to be off by a number of pixels example small gaps between the player and a tile.
Sometimes like in windowed mode this seems like a drawing bug do to some scaling. It looks much more accurate to perfect in full screen mode.
Anyhow....
Even in full screen mode it seems like collisions are still off by like 1 pixel/unit.
So lets say I have two tiles and I want to move between them.
Even if I am perfectly aligned against one I still can not get between them.
Here is an example...
****
P *
*******
P is the play pressed up against a wall and he wants to go in the alcove.
This is the last thing in my game shell to work out and we should be ready to start turning out games :)
PS.. I have physics turned off on the sprites and tiles and not materials set.
Or so its seems.
I have looked all over the forums for answers and I have found things that sound a bit like what I am seeing but with no explicit directions on how to fix.
What I am see is..
I have a map of 32x32 square tiles.
I have a square 32x32 sprite.
At times collisions seem to be off by a number of pixels example small gaps between the player and a tile.
Sometimes like in windowed mode this seems like a drawing bug do to some scaling. It looks much more accurate to perfect in full screen mode.
Anyhow....
Even in full screen mode it seems like collisions are still off by like 1 pixel/unit.
So lets say I have two tiles and I want to move between them.
Even if I am perfectly aligned against one I still can not get between them.
Here is an example...
****
P *
*******
P is the play pressed up against a wall and he wants to go in the alcove.
This is the last thing in my game shell to work out and we should be ready to start turning out games :)
PS.. I have physics turned off on the sprites and tiles and not materials set.
#2
So far the only fix I found was to actually shink the players RECT a little bit so
he can fit between tiles.
08/10/2005 (9:08 pm)
Yup tuned it all on.So far the only fix I found was to actually shink the players RECT a little bit so
he can fit between tiles.
Torque Owner Teck Lee Tan