summaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-07-11 16:34:10 +0200
committersalmonik <salmonik@tuta.io>2026-07-11 16:34:10 +0200
commitdb03808fc52d47f136bb0726fd6ba4ab6a690c12 (patch)
tree804a5418eab14d64665f67df08d66a0ed435d47f /src/main.rs
parentmerge enemy AI (diff)
parentadd floor transition: Space on exit descends to next depth (diff)
downloaddungeon-db03808fc52d47f136bb0726fd6ba4ab6a690c12.tar.gz
dungeon-db03808fc52d47f136bb0726fd6ba4ab6a690c12.zip
merge floor transition
Diffstat (limited to '')
-rw-r--r--src/main.rs13
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 ----