@@ -411,7 +411,7 @@ impl<'a> System<'a> for MapIndexingSystem {
411411 if let Some (_p ) = _p {
412412 map . blocked[idx ] = true ;
413413 }
414-
414+
415415 // Push the entity to the appropriate index slot. It's a Copy
416416 // type, so we don't need to clone it (we want to avoid moving it out of the ECS!)
417417 map . tile_content[idx ]. push (entity );
@@ -728,7 +728,7 @@ fn tick(&mut self, ctx : &mut Rltk) {
728728 let runstate = self . ecs. fetch :: <RunState >();
729729 newrunstate = * runstate ;
730730 }
731-
731+
732732 match newrunstate {
733733 RunState :: PreRun => {
734734 self . run_systems ();
@@ -792,6 +792,26 @@ impl<'a> System<'a> for MonsterAI {
792792 if * runstate != RunState :: MonsterTurn { return ; }
793793```
794794
795+ Don't forget to make sure that all of the systems are now in ` run_systems ` (in ` main.rs ` ):
796+
797+ ``` rust
798+ impl State {
799+ fn run_systems (& mut self ) {
800+ let mut vis = VisibilitySystem {};
801+ vis . run_now (& self . ecs);
802+ let mut mob = MonsterAI {};
803+ mob . run_now (& self . ecs);
804+ let mut mapindex = MapIndexingSystem {};
805+ mapindex . run_now (& self . ecs);
806+ let mut melee = MeleeCombatSystem {};
807+ melee . run_now (& self . ecs);
808+ let mut damage = DamageSystem {};
809+ damage . run_now (& self . ecs);
810+ self . ecs. maintain ();
811+ }
812+ }
813+ ```
814+
795815If you ` cargo run ` the project, it now behaves as you'd expect: the player moves, and things he/she kills die before they can respond.
796816
797817# Wrapping Up
0 commit comments