Get camera coords before drawing, to prevent jerky player.

This commit is contained in:
Steve 2015-11-01 13:34:20 +00:00
parent b2c6708ef4
commit bedf2fe74d
1 changed files with 3 additions and 3 deletions

View File

@ -105,9 +105,6 @@ static void doBattle(void)
{ {
if (player != NULL) if (player != NULL)
{ {
battle.camera.x = player->x - (SCREEN_WIDTH / 2);
battle.camera.y = player->y - (SCREEN_HEIGHT / 2);
ssx = player->dx; ssx = player->dx;
ssy = player->dy; ssy = player->dy;
} }
@ -160,6 +157,9 @@ static void draw(void)
{ {
prepareScene(); prepareScene();
battle.camera.x = player->x - (SCREEN_WIDTH / 2);
battle.camera.y = player->y - (SCREEN_HEIGHT / 2);
drawBackground(battle.background); drawBackground(battle.background);
drawStars(); drawStars();