diff --git a/src/components.rs b/src/components.rs index dffe888..9c833b9 100644 --- a/src/components.rs +++ b/src/components.rs @@ -5,7 +5,7 @@ use specs::prelude::*; use specs::saveload::{ConvertSaveload, Marker}; use specs_derive::*; -#[derive(Component, ConvertSaveload, Clone)] +#[derive(Component, ConvertSaveload, Copy, Clone)] pub struct Position { pub x: i32, pub y: i32, @@ -13,19 +13,13 @@ pub struct Position { impl From<(i32, i32)> for Position { fn from(f: (i32, i32)) -> Self { - Position { - x: f.0, - y: f.1, - } + Position { x: f.0, y: f.1 } } } impl From for Position { fn from(p: Point) -> Self { - Position { - x: p.x, - y: p.y, - } + Position { x: p.x, y: p.y } } } diff --git a/src/main.rs b/src/main.rs index a83d20a..ad12221 100644 --- a/src/main.rs +++ b/src/main.rs @@ -547,7 +547,10 @@ fn main() -> rltk::BError { gs.ecs.insert(Map::new(1)); gs.ecs.insert(Point::zero()); gs.ecs.insert(rltk::RandomNumberGenerator::new()); - gs.ecs.insert(spawner::player(&mut gs.ecs, 0, 0)); + + let player_entity = spawner::player(&mut gs.ecs, 0, 0); + gs.ecs.insert(player_entity); + gs.ecs.insert(RunState::MapGeneration {}); gs.ecs.insert(GameLog::new("Welcome to Rusty Roguelike")); gs.ecs.insert(particle_system::ParticleBuilder::new());