Uhfgood
02-21-2003, 08:52 PM
Well, i'm truely stuck here guys. I've tried this stuff 10 different ways and I can't figure out how to make it all work perfectly all the time.
I'm using deltatime and i'm using floating point, and the sprite is a different size than the tiles. I know how to make a collision detection function, it merely tests to see if the bottom is touching an existing tile (in an array), otherwise it's not. However I can't, for the life of me, figure out how to make the sprite sit on top of the tile it's touching.
This is partly due to the fact that gravity is always pulling it down. Now I don't want you guys to get all physically correct on me, all I mean by gravity is a downward motion of the sprite where it gets faster and faster each time. (Basically I add a gravity variable onto the y velocity, which is probably not truely velocity either but it serves it's purpose).
Half the time I have trouble with it jumping a tile, and then also not properly sitting on top of the tile it touched.
Can *anyone* help me?
Thanks alot!
I'm using deltatime and i'm using floating point, and the sprite is a different size than the tiles. I know how to make a collision detection function, it merely tests to see if the bottom is touching an existing tile (in an array), otherwise it's not. However I can't, for the life of me, figure out how to make the sprite sit on top of the tile it's touching.
This is partly due to the fact that gravity is always pulling it down. Now I don't want you guys to get all physically correct on me, all I mean by gravity is a downward motion of the sprite where it gets faster and faster each time. (Basically I add a gravity variable onto the y velocity, which is probably not truely velocity either but it serves it's purpose).
Half the time I have trouble with it jumping a tile, and then also not properly sitting on top of the tile it touched.
Can *anyone* help me?
Thanks alot!