Browse Source

Clunkily use a collision world instead of manual broad phase

Getty Ritter 4 years ago
parent
commit
c828f906c5
1 changed files with 5 additions and 7 deletions
  1. 5 7
      src/res.rs

+ 5 - 7
src/res.rs

@@ -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();
 }