knexer / auto-puzzler

A simple game about writing code to assist in solving puzzles, built to learn React.
0 stars 0 forks source link

Auto-restart completed boards #15

Closed knexer closed 1 year ago

knexer commented 1 year ago

This enables idle gameplay.

knexer commented 1 year ago

Took a stab at this, but stalled out when restarting a board was awkward. A lot of that was from the continued mixing of state and view in Board, BoardPanel and Game. It might make sense to pull out some kind of overall GameState thing to pull UnlockState and BoardModel together.

For example - Board is responsible for starting the automation worker(s), and each Board creates and owns its BoardModel via useRef. That is kind of nonsense architecture - better React style would be to have a hierarchical game state that is functionally expressed in the view.