This game won the Dusk multiplayer challenge in the Fall edition of React Jam. And this retro-style game was made using good old React that you all know about. It's very easy to get into making a plain React game because you don't even have to learn the framework or anything. And as you can see, they can look beautiful.
Building games in React is a really easy way to try out game devs. You don't need to learn Unity, Unreal, don't need to learn a new language, don't even need to learn a new JS framework. You literally just use the components like you're used to. It's important to highlight that we take all these DX things for granted, hot reloading, unit tests, all the power of React dev tools. But that's actually not a common thing in the game dev world. If you want to make a game using Unity, it's actually really painful to, for instance, get hot reloading and fast builds working nicely. And it just comes for free in this web dev context.
There's lots of great libraries for all sorts of things for React, and you can use all of them for a game dev. Rerendering is always important, as you know, for any app, but it's particularly important to avoid in games, as the game state may change frequently, up to 60 times per second for fast-paced games. So you've got to be super careful that you're only rerendering the exact components that you need using some of the React optimizations like memorization, if you're building a fast-paced game. If you're building a slower-paced game, you can be more chill.
Another tricky thing that can be a little hard to do in games made using React is imperative changes. Doing a sequence of changes like this can be a little tricky in React. But actually, one of the React Gem winners shared this nice library called Timeline Composer to do sequences of imperative changes like that in React-based games. So it's really cool to see the ecosystem help out, alleviate any pain points around games with React by building all these different libraries. The best way to get started is by messing with other people's code. There's lots of great open-source games already out there made using React. In fact, I helped start this initiative to set aside $100,000 in grants to make more open-sourced web games. And if you search for Dusk open-source grants, you'll find a long list of open-source games that you can be inspired from. And many of these games are made using React. You can even apply to get a grant yourself to make an open-source game. Finally, I just want to call out the obvious.
Comments