|
@@ -80,12 +80,7 @@ pub fn world_from_file<P: AsRef<Path>>(w: &mut specs::World, path: P) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // create the player
|
|
|
- let ball = {
|
|
|
- let mut h = w.write_resource::<World>();
|
|
|
- Blocking::new_ball(&mut h)
|
|
|
- };
|
|
|
- w.create_entity()
|
|
|
+ w.create_entity_unchecked()
|
|
|
.with(Position {
|
|
|
x: 3.0 * consts::TILE_SIZE,
|
|
|
y: 3.0 * consts::TILE_SIZE,
|
|
@@ -97,6 +92,9 @@ pub fn world_from_file<P: AsRef<Path>>(w: &mut specs::World, path: P) {
|
|
|
.with(Collision {
|
|
|
has_collision: false,
|
|
|
})
|
|
|
- .with(ball)
|
|
|
+ .with({
|
|
|
+ let mut h = w.write_resource::<World>();
|
|
|
+ Blocking::new_ball(&mut h)
|
|
|
+ })
|
|
|
.build();
|
|
|
}
|