Fix some minor component issues
This commit is contained in:
parent
37b042e434
commit
86d46b8d5b
@ -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<Point> for Position {
|
||||
fn from(p: Point) -> Self {
|
||||
Position {
|
||||
x: p.x,
|
||||
y: p.y,
|
||||
}
|
||||
Position { x: p.x, y: p.y }
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
|
Loading…
Reference in New Issue
Block a user