summaryrefslogtreecommitdiff
path: root/dungeon/src/lib.rs
diff options
context:
space:
mode:
authoralf9310 <alf9310@rit.edu>2025-11-06 12:20:57 -0500
committeralf9310 <alf9310@rit.edu>2025-11-06 12:20:57 -0500
commit763b047c92a5d5340bad38506862ad6c87ecdbe9 (patch)
tree68b391d3745458005eade3c07ac9e41655376d5c /dungeon/src/lib.rs
parentMoved most of the movement stuff to entity. (diff)
downloadDungeonCrawl-763b047c92a5d5340bad38506862ad6c87ecdbe9.tar.gz
DungeonCrawl-763b047c92a5d5340bad38506862ad6c87ecdbe9.tar.bz2
DungeonCrawl-763b047c92a5d5340bad38506862ad6c87ecdbe9.zip
Light bsp refactoring
Diffstat (limited to 'dungeon/src/lib.rs')
-rw-r--r--dungeon/src/lib.rs14
1 files changed, 8 insertions, 6 deletions
diff --git a/dungeon/src/lib.rs b/dungeon/src/lib.rs
index 8119119..ee61632 100644
--- a/dungeon/src/lib.rs
+++ b/dungeon/src/lib.rs
@@ -1,11 +1,11 @@
//! The `dungon` crate contains the core functionality for
//! interacting with a `Dungeon` and its components.
-mod bsp;
-mod enemy;
-mod entity;
-mod map;
-mod pos;
+pub mod bsp;
+pub mod enemy;
+pub mod entity;
+pub mod map;
+pub mod pos;
pub use bsp::*;
pub use entity::*;
@@ -70,9 +70,11 @@ impl From<Floor> for Dungeon {
// TODO: initalize rest of game state
// TODO: How will we randomize enemy type/number per floor?
+ // For now, just create one enemy a few tiles to the right of the player
let enemies = vec![Enemy::new(
EnemyType::Zombie,
- Pos::new(player.entity.pos.x() + 4, player.entity.pos.y()).unwrap(),
+ Pos::new(player.entity.pos.x() + 4, player.entity.pos.y())
+ .unwrap_or(const_pos!(1, 1)),
)];
Self {