Collisions troubles, sprite vs tile map

hiya

I have some troubles with collisions in my simple 2d platformer (in HGE) thats driving me crazy

i have a simple 2d array tile map drawn on the screen, there are only 2 blocks 0 and 1, where 1 is the block i want my sprite to collide with.
every block, my sprite included is 32x32 pixels and my sprite is moving fluently pixel by pixel (i get that by modifing the first 2 hge tutorials)

now the problem is i can't get it to work properly.. i managed to get some result where i could jump around and not pass through the blocks by checking if the block below (and other sides) my sprite has 0 or 1 but it was always imperfect and my character was getting stuck or just passed thru blocks etc.. I even disabled jumping and gravity just to make things simple but still couldnt make it work fluently..
I even tried to move my char by just adding 1 to x and y axes to make it super simple but it was still shaking when i touched the wall or get stuck, or just passed thru wall completly..

im a totaly confused now.. i have tried to visualise my bounding box of the sprite and even the blocks of the map close to me but i still can't find a way how to actually use it to do a simple working collision that would not get stuck or sticky or any other way broken...

http://img41.imageshack.us/i/sampleqye.png/

if somebody could point me to the right direction, in what order should I do the whole thing.. (get keypress, change x,y values, check for collision, change x,y values?, etc..) or write a sample code with explanation.. I just want the sprite to smoothly colide with the blocks in all directions.

The best i could do is to get the "smooth" effect when colliding in only 1 axis.. thats mean i can either get to work x or y axis.. when I try to get to work collisions for both, my sprite will get stuck everytime it hit the wall or ground and i have to first move away from wall/ground before continuing in original direcion...
Last edited on
Topic archived. No new replies allowed.