Best javascript library/ framework for developing 2D game Website
Hi, I’m working on a 2D board game website that’s not real-time, where players move tokens around the board based on various rules. I’m proficient with React, and I’m wondering if it’s the right choice for building this type of game, or if I should consider a game-specific framework like Phaser.js or just use plain JavaScript with Canvas.
The game will have customizable features like token placement, movement, and the number of tokens. I’d like to know what others think would be the best approach to develop this type of game and handle these customizations.
Any advice on frameworks/libraries or even game logic implementation tips would be much appreciated!
About this post
- Posted
- Archived
- Score
- 1 · 67% up
- Kind
- Text
- ID
- 1flc0pp
5 comments
You might want to stick to React if you're used to that and all game graphics can be expressed as html/css. If you use a framework like phaser or raw canvas, you'll end-up re-implementing some of standard html goodies like cross-platform input (mouse/touch/keyboard), accessibility, etc.
Only If shader-based graphical effects are needed, you'll have to use canvas with webgl, and then a framework like pixijs, phaser is a good choice.
Ok so all the movements can be done in react ? I don't want heavy graphics just sound and nice ui , good movements, user switching
You can use css transitions for movements given each moving token is an html element.
I would advice you to first get all your game logic working perfectly using whatever you're familiar with, hence my initial advice to stick to React. After that, if heavy animations are needed that you cannot achieve using css, it should be really easy to switch to another framework. Pixijs, Phaser, or even gl-react.
Sound is a different topic altogether.
Phaser for sure, best framework ever!