Tiled graphics problem

So, i'm a newbie in game development and i'm making a terraria clone, everything looks great except the tiles.

Its showing strange horizontal lines between the tiles, but only when i center the camera on player, and vertical lines when i'm moving the player, but only whe the camera is locked on player and moving together with it and it occurs like every 5 seconds.

This is the camera function:

void camera(void)
al_translate_transform(&trans, cameraPos[0], cameraPos[1]);

Do you guys have any idea what can it be? Thanks in advance and sorry for my bad english. :-[




What if you do this:

al_translate_transform(&trans, floor(cameraPos[0]), floor(cameraPos[1]));


It worked :o thank you so much Elias ;D

Today, i just realized that when the player is moving, its sprite keeps shaking 1 pixel + and 1 pixel -. Without the floor() function it doesn't happen.

Help :-/


How do you draw the player? Either add a floor() to where you draw the player as well, or draw the player without the transform.


Thank you for reply, i thought about it and had the idea of making a new camera without floor(), just for the player, and it worked. 8-)

Thank you so much ;D

Thread #613813. Printed from Allegro.cc