city41 / reagent-breakout

The game Breakout implemented with Reagent
http://city41.github.io/reagent-breakout/
Eclipse Public License 1.0
53 stars 10 forks source link

Vanilla react suitable as game "engine"? #10

Open buxel opened 9 years ago

buxel commented 9 years ago

Hi, I'am currently looking around for a nice game engine for some side project. I've been playing with react for some time and really like the whole concept. Being able to use it in a side project would be incredibly helpful to learn it better. But I'am wondering if react is the right tool for creating games (in fact, I sincerely hope so) and what i'll loose compared to an established game engine like phaserjs, melonjs, etc. Maybe using react (and flux) for the whole architecture and passing the animations/rendering to something like snapsvg might do the trick.

This is not really an issue, I just want to hear what other, more experienced people, think about this. Most of the game examples are pretty basic but I have something RTS-like in mind, which is quite a different scope i guess. Any advice/recommendations you can give?

city41 commented 9 years ago

I personally would not use React for an actual game if that game requires collision detection, physics, frame animation, etc. I still think a dedicated game engine is better for those types of games. Have you seen breakouts? reagent-breakout is a spin off of that project.

Game engines also nicely hide the html5 audio warts from you, usually provide a preloader, and usually render to canvas which is likely more performant on mobile devices.

For a board game or something like that, I might consider React as you wouldn't have to deal with all the extra stuff game engines give you that you'd never use.

buxel commented 9 years ago

I've already seen the breakout site, that's where i came from. It is indeed very helpful.

Is it possible to use parts of the flux architecture (one-directional data flow, actions, stores) with any of the existing frameworks and just use react for menus/HUD? The game rendering could live inside a component that wraps the game engine of choice. On the other hand... maybe I'am trying too hard and just should go with a engine as it was designed to be used.