about summary refs log tree commit diff stats
path: root/src/com/fourisland
diff options
context:
space:
mode:
authorStarla Insigna <hatkirby@fourisland.com>2012-06-03 20:18:15 -0400
committerStarla Insigna <hatkirby@fourisland.com>2012-06-03 20:18:15 -0400
commit467806e1d8f92548096ba960d02c00b3fe3e167b (patch)
tree2ce6b9e099e4dfaf8fe3f12087b4f40f1801af72 /src/com/fourisland
parent039bb70673e3c5876aa24fb82592625be060d1bb (diff)
downloadfrigidearth-467806e1d8f92548096ba960d02c00b3fe3e167b.tar.gz
frigidearth-467806e1d8f92548096ba960d02c00b3fe3e167b.tar.bz2
frigidearth-467806e1d8f92548096ba960d02c00b3fe3e167b.zip
Added health counter
Diffstat (limited to 'src/com/fourisland')
-rw-r--r--src/com/fourisland/frigidearth/MapViewGameState.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/com/fourisland/frigidearth/MapViewGameState.java b/src/com/fourisland/frigidearth/MapViewGameState.java index dd20eac..0371c6a 100644 --- a/src/com/fourisland/frigidearth/MapViewGameState.java +++ b/src/com/fourisland/frigidearth/MapViewGameState.java
@@ -43,6 +43,7 @@ public class MapViewGameState implements GameState
43 private int playery = 4; 43 private int playery = 4;
44 private int viewportx = 0; 44 private int viewportx = 0;
45 private int viewporty = 0; 45 private int viewporty = 0;
46 private int health = 15;
46 47
47 public MapViewGameState() 48 public MapViewGameState()
48 { 49 {
@@ -550,6 +551,15 @@ public class MapViewGameState implements GameState
550 } 551 }
551 } 552 }
552 } 553 }
554
555 // Render status bar
556 g.drawImage(SystemFont.getCharacter((char) 3, Color.RED), TILE_WIDTH, 0, TILE_WIDTH, TILE_HEIGHT, null);
557 String healthText = Integer.toString(health);
558
559 for (int i=0; i<healthText.length(); i++)
560 {
561 g.drawImage(SystemFont.getCharacter(healthText.charAt(i), Color.WHITE), (i+2)*TILE_WIDTH, 0, TILE_WIDTH, TILE_HEIGHT, null);
562 }
553 } 563 }
554 564
555 public void processInput(KeyEvent e) 565 public void processInput(KeyEvent e)