Skip to content

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!

1 points5 comments
Open on Reddit
About this post
Posted
Archived
Score
1 · 67% up
Kind
Text
ID
1flc0pp

Author

1
posts
2
comments
0
media
View profile

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.

1 points

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

1 points

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.

2 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.