Get camera coords before drawing, to prevent jerky player.
This commit is contained in:
parent
b2c6708ef4
commit
bedf2fe74d
|
@ -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();
|
||||||
|
|
Loading…
Reference in New Issue