diff options
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs index e82d939..694773d 100644 --- a/src/main.rs +++ b/src/main.rs | |||
| @@ -110,7 +110,11 @@ fn main() { | |||
| 110 | } else if cur_e && !prev_e { | 110 | } else if cur_e && !prev_e { |
| 111 | game.turn_right(); | 111 | game.turn_right(); |
| 112 | } else if cur_space && !prev_space { | 112 | } else if cur_space && !prev_space { |
| 113 | game.attack(); | 113 | if game.on_exit() { |
| 114 | game.descend(); | ||
| 115 | } else { | ||
| 116 | game.attack(); | ||
| 117 | } | ||
| 114 | } else if cur_z && !prev_z { | 118 | } else if cur_z && !prev_z { |
| 115 | game.use_item(); | 119 | game.use_item(); |
| 116 | } else if cur_x && !prev_x { | 120 | } else if cur_x && !prev_x { |
| @@ -156,9 +160,10 @@ fn main() { | |||
| 156 | } | 160 | } |
| 157 | } | 161 | } |
| 158 | 162 | ||
| 159 | // ---- win check (placeholder — becomes staircase in Phase 1) ---- | 163 | // ---- descend prompt ---- |
| 160 | if game.check_win() { | 164 | // Show the prompt persistently while the player stands on the exit. |
| 161 | std::process::exit(0); | 165 | if game.on_exit() && game.state == GameState::WaitingForInput { |
| 166 | game.set_message("Press Space to descend..."); | ||
| 162 | } | 167 | } |
| 163 | 168 | ||
| 164 | // ---- render ---- | 169 | // ---- render ---- |
