diff options
author | drumsetmonkey <abelleisle@roadrunner.com> | 2015-10-28 11:55:21 -0400 |
---|---|---|
committer | drumsetmonkey <abelleisle@roadrunner.com> | 2015-10-28 11:55:21 -0400 |
commit | 193af27884fc910b4ffa7212ec772894c03e36ee (patch) | |
tree | ce3a10772b3af81815261a11959da6e715eaa96f /src/ui.cpp | |
parent | a3e3f43a51e4a8137dff779f38b358b5b8608e4e (diff) |
Locked camera to world bounds and added basic mountain backdrop
Diffstat (limited to 'src/ui.cpp')
-rw-r--r-- | src/ui.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -174,13 +174,13 @@ namespace ui { putString(x+HLINE,y-fontSize-HLINE,dialogBoxText); } setFontSize(16); - putText(((SCREEN_WIDTH/2)+player->loc.x)-125,SCREEN_HEIGHT-fontSize,"Health: %u/%u",player->health>0?(unsigned)player->health:0, + putText(((SCREEN_WIDTH/2)+offset.x)-125,SCREEN_HEIGHT-fontSize,"Health: %u/%u",player->health>0?(unsigned)player->health:0, (unsigned)player->maxHealth); if(player->alive){ glColor3ub(255,0,0); - glRectf((SCREEN_WIDTH/2+player->loc.x)-125, + glRectf((SCREEN_WIDTH/2+offset.x)-125, SCREEN_HEIGHT-32, - ((SCREEN_WIDTH/2+player->loc.x)-125)+((player->health/player->maxHealth)*100), + ((SCREEN_WIDTH/2+offset.x)-125)+((player->health/player->maxHealth)*100), SCREEN_HEIGHT-32+12); } } @@ -188,7 +188,7 @@ namespace ui { static bool left=false,right=false; static vec2 premouse={0,0}; SDL_Event e; - mouse.x=premouse.x+player->loc.x-(SCREEN_WIDTH/2); + mouse.x=premouse.x+offset.x-(SCREEN_WIDTH/2); mouse.y=SCREEN_HEIGHT-premouse.y; while(SDL_PollEvent(&e)){ switch(e.type){ |