-
Notifications
You must be signed in to change notification settings - Fork 8
Canvas or React Canvas or React Konva
We need to have a GameState
using which the entire game can be rendered at any time.
Options for rendering of the Game:
Canvas can directly be used but that will lead to imperative coding style. Using React components will force us to think declaratively and modularly.
react-canvas looks like its not getting maintained since the last 2 years.
- Low number of weekly downloads (less than 1000) ๐
- High number of open issues ๐
- Last publish 2 years ago. ๐
Also, the main strength of react-canvas is to draw DOM-like objects (images, texts) on canvas element in very performant way. The Pacman game will need to render graphics (like circles, squares) This is not a good option for the Pacman game.
react-konva is quite a populat choice:
- High number of weekly downloads(11,000) ๐
- High number of open issues ๐
- Last publish 2 days ago.๐
Also,
The purpose of react-konva is to reduce the complexity of the application and use well-known declarative way for drawing on canvas.
Thus, we'll be using the React-Konvo for the game.