Inspired by this Tweet: https://twitter.com/vnglst/status/1751278052154179770.
I had no experience building games, so I read up on details that I was unsure about
- https://medium.com/projector-hq/writing-a-run-loop-in-javascript-react-9605f74174b
- https://indepthjavascript.dev/how-to-create-a-simple-game-loop-in-react-javascripttypescript-in-under-10-lines-of-code
While building this, I wanted to focus on some areas to either learn about or brush up on my skills:
- Game loop (in general, but more specifically, how to implement one in React)
- React Context.
- How to structure a project that is not a simple CRUD app.
- Canvas :) -- I originally built this using divs which with hindsight is a bit silly, but it now uses Canvas.
First, run the development server:
npm run dev
Open http://localhost:3000 with your browser to see the result.