From bedf2fe74d83cc25e1ca6ff669a79185f4d96fb7 Mon Sep 17 00:00:00 2001 From: Steve Date: Sun, 1 Nov 2015 13:34:20 +0000 Subject: [PATCH] Get camera coords before drawing, to prevent jerky player. --- src/battle/battle.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/battle/battle.c b/src/battle/battle.c index c7e8af6..03c2c03 100644 --- a/src/battle/battle.c +++ b/src/battle/battle.c @@ -105,9 +105,6 @@ static void doBattle(void) { if (player != NULL) { - battle.camera.x = player->x - (SCREEN_WIDTH / 2); - battle.camera.y = player->y - (SCREEN_HEIGHT / 2); - ssx = player->dx; ssy = player->dy; } @@ -160,6 +157,9 @@ static void draw(void) { prepareScene(); + battle.camera.x = player->x - (SCREEN_WIDTH / 2); + battle.camera.y = player->y - (SCREEN_HEIGHT / 2); + drawBackground(battle.background); drawStars();