diff options
-rw-r--r-- | src/com/fourisland/frigidearth/MapViewGameState.java | 18 | ||||
-rw-r--r-- | src/com/fourisland/frigidearth/Tile.java | 43 |
2 files changed, 60 insertions, 1 deletions
diff --git a/src/com/fourisland/frigidearth/MapViewGameState.java b/src/com/fourisland/frigidearth/MapViewGameState.java index 65bfbe7..e0cc8cb 100644 --- a/src/com/fourisland/frigidearth/MapViewGameState.java +++ b/src/com/fourisland/frigidearth/MapViewGameState.java | |||
@@ -191,7 +191,7 @@ public class MapViewGameState implements GameState | |||
191 | if (ways == 0) | 191 | if (ways == 0) |
192 | { | 192 | { |
193 | grid[newx][newy] = Tile.DownStairs; | 193 | grid[newx][newy] = Tile.DownStairs; |
194 | playerx=newx+1; | 194 | playerx=newx; |
195 | playery=newy; | 195 | playery=newy; |
196 | state = 10; | 196 | state = 10; |
197 | break; | 197 | break; |
@@ -673,6 +673,22 @@ public class MapViewGameState implements GameState | |||
673 | 673 | ||
674 | adjustViewport(); | 674 | adjustViewport(); |
675 | calculateFieldOfView(); | 675 | calculateFieldOfView(); |
676 | |||
677 | if (health <= 0) | ||
678 | { | ||
679 | printMessage("You have died! Press [ENTER] to quit."); | ||
680 | |||
681 | Main.addInputable(new Inputable() { | ||
682 | @Override | ||
683 | public void processInput(KeyEvent e) | ||
684 | { | ||
685 | if (e.getKeyCode() == KeyEvent.VK_ENTER) | ||
686 | { | ||
687 | System.exit(0); | ||
688 | } | ||
689 | } | ||
690 | }); | ||
691 | } | ||
676 | } | 692 | } |
677 | 693 | ||
678 | private void adjustViewport() | 694 | private void adjustViewport() |
diff --git a/src/com/fourisland/frigidearth/Tile.java b/src/com/fourisland/frigidearth/Tile.java index be17d6c..5d758e2 100644 --- a/src/com/fourisland/frigidearth/Tile.java +++ b/src/com/fourisland/frigidearth/Tile.java | |||
@@ -109,6 +109,49 @@ public enum Tile | |||
109 | { | 109 | { |
110 | return new Color(162, 181, 205); | 110 | return new Color(162, 181, 205); |
111 | } | 111 | } |
112 | }, | ||
113 | Window { | ||
114 | public boolean isBlocked() | ||
115 | { | ||
116 | return true; | ||
117 | } | ||
118 | |||
119 | public char getDisplayCharacter() | ||
120 | { | ||
121 | return 'W'; | ||
122 | } | ||
123 | |||
124 | public Color getBackgroundColor() | ||
125 | { | ||
126 | return new Color(0, 63, 135); | ||
127 | } | ||
128 | }, | ||
129 | ShatteredWindow { | ||
130 | public boolean isBlocked() | ||
131 | { | ||
132 | return false; | ||
133 | } | ||
134 | |||
135 | public char getDisplayCharacter() | ||
136 | { | ||
137 | return 'W'; | ||
138 | } | ||
139 | |||
140 | public Color getBackgroundColor() | ||
141 | { | ||
142 | return new Color(162, 181, 205); | ||
143 | } | ||
144 | }, | ||
145 | Snow { | ||
146 | public boolean isBlocked() | ||
147 | { | ||
148 | return false; | ||
149 | } | ||
150 | |||
151 | public Color getBackgroundColor() | ||
152 | { | ||
153 | return new Color(255, 250, 250); | ||
154 | } | ||
112 | }; | 155 | }; |
113 | 156 | ||
114 | public abstract boolean isBlocked(); | 157 | public abstract boolean isBlocked(); |