summaryrefslogtreecommitdiff
path: root/game
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2025-11-20 20:27:50 -0500
committerFreya Murphy <freya@freyacat.org>2025-11-20 20:27:50 -0500
commitff627e369f83fdaab8e90016529521b0e07d5e34 (patch)
tree68a416a471af35334ed4a4b743eb8823ac67a00d /game
parentgame: fix inv slot select (diff)
downloadDungeonCrawl-ff627e369f83fdaab8e90016529521b0e07d5e34.tar.gz
DungeonCrawl-ff627e369f83fdaab8e90016529521b0e07d5e34.tar.bz2
DungeonCrawl-ff627e369f83fdaab8e90016529521b0e07d5e34.zip
dungeon: add chest usage/textures
Diffstat (limited to 'game')
-rw-r--r--game/src/lib.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/game/src/lib.rs b/game/src/lib.rs
index 23cdcfa..3d9c8a7 100644
--- a/game/src/lib.rs
+++ b/game/src/lib.rs
@@ -1,6 +1,6 @@
use dungeon::{
- Dungeon, UpdateResult, player::PLAYER_INVENTORY_SIZE_USIZE, player_input::PlayerInput,
- pos::Direction,
+ Dungeon, UpdateResult, entity::Item, map::Tile, player::PLAYER_INVENTORY_SIZE_USIZE,
+ player_input::PlayerInput, pos::Direction,
};
use graphics::{Key, Window};
@@ -86,7 +86,8 @@ impl Game {
self.window.toggle_debug();
}
if self.window.is_key_pressed(Key::F4) {
- self.dungeon.player.entity.health = 0;
+ *self.dungeon.floor.get_mut(self.dungeon.player.entity.pos) =
+ Tile::Chest(Some(Item::Bomb));
}
// Update game state