Move camera towards mouse position

This commit is contained in:
Cong 2017-05-21 18:09:00 +10:00
parent 18242ad593
commit 960da014b0
1 changed files with 2 additions and 2 deletions

View File

@ -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);