aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2016-01-26 07:33:28 -0500
committerClyne Sullivan <tullivan99@gmail.com>2016-01-26 07:33:28 -0500
commit368b446c29d2001246cab2d40e406708f7c6bf7d (patch)
treeef90399051e79660c9b9eb8322c0e74348951b74 /src/ui.cpp
parentcc28c882ce57c23bf79a2afec24b72f9942d6077 (diff)
merge
Diffstat (limited to 'src/ui.cpp')
-rw-r--r--src/ui.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/ui.cpp b/src/ui.cpp
index f865360..1520e9f 100644
--- a/src/ui.cpp
+++ b/src/ui.cpp
@@ -585,13 +585,19 @@ namespace ui {
};
putText(hub.x,hub.y,"Health: %u/%u",player->health>0?(unsigned)player->health:0,
- (unsigned)player->maxHealth);
+ (unsigned)player->maxHealth
+ );
if(player->alive){
- glColor3ub(255,0,0);
+ glColor3ub(150,0,0);
hub.y-=fontSize*1.15;
glRectf(hub.x,
hub.y,
- hub.x+(player->health/player->maxHealth?player->maxHealth:1)*130,
+ hub.x+150,
+ hub.y+12);
+ glColor3ub(255,0,0);
+ glRectf(hub.x,
+ hub.y,
+ hub.x+(player->health/player->maxHealth * 150),
hub.y+12);
}
@@ -916,6 +922,7 @@ DONE:
player->loc.y+=HLINE*5;
player->ground=false;
}*/
+ player->health -= 5;
break;
case SDLK_k:
/*currentWorld=currentWorld->goWorldFront(player); // Go forward a layer if possible