From 960da014b008f90d9f03b361e546faf42c8297a9 Mon Sep 17 00:00:00 2001 From: Cong Date: Sun, 21 May 2017 18:09:00 +1000 Subject: [PATCH] Move camera towards mouse position --- src/battle/battle.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/battle/battle.c b/src/battle/battle.c index 2ad0ee1..23091ba 100644 --- a/src/battle/battle.c +++ b/src/battle/battle.c @@ -218,8 +218,8 @@ static void draw(void) { if (player->alive == ALIVE_ALIVE) { - battle.camera.x = player->x - (SCREEN_WIDTH / 2); - battle.camera.y = player->y - (SCREEN_HEIGHT / 2); + battle.camera.x = player->x - (SCREEN_WIDTH / 2) + ((app.mouse.x - (SCREEN_WIDTH / 2)) / 4); + battle.camera.y = player->y - (SCREEN_HEIGHT / 2) + ((app.mouse.y - (SCREEN_HEIGHT / 2)) / 4); } drawBackground(battle.background);