Deterministic Game Rules
I added the first game rules. They are:
- Foxes will eat 1 adjacent rabbit if possible
- Foxes will move if they have no rabbits adjacent
- Rabbits will move to a safe adjacent square if they are currently next to a fox.
Each animal is processed sequentially. There is no randomness yet.
The neighbors calculation ended up being a big time-sink. I'd pulled in the jxxcarlson/elm-cell-grid library to help modeling the grid. Unfortunately it contained some bugs in its coordinate logic, causing the neighbors calculations to give wrong results around the edges of the grid. I ended up vendoring a patched file into the project for now.
Leave a comment
Log in with itch.io to leave a comment.