iolivia / rust-sokoban

Rust Sokoban book and code samples
https://sokoban.iolivia.me
MIT License
155 stars 29 forks source link

Chapter 2 Section 5 Missing code #68

Closed timw4mail closed 4 years ago

timw4mail commented 4 years ago

Attempting to just follow along, there are two missing code pieces in the book for the Gameplay section:

Incrementing the move count in the input system:

        // We've just moved, so let's increase the number of moves
        if to_move.len() > 0 {
            gameplay.moves_count += 1;
        }

And running the new system:

        // Run gameplay state system
        {
            let mut gss = GameplayStateSystem {};
            gss.run_now(&self.world);
        }

It took me a while to track down the changes in the full code.

iolivia commented 4 years ago

hey @timw4mail, thanks for flagging this! should be fixed shortly in the PR above.