DEV Community

Tetragius
Tetragius

Posted on

JSX for graphics

I am developing this for myself but it may be interesting for others...

I like to develop games. For my home project, I use RPG Maker, based on the popular library PIXI.JS. But writing plugins for RPG is pure pain. I also like React (and I would like him more if no hooks were added to him)

So... After reading the excellent article "Build your own React" by Rodrigo Pombo. I decided to write my analogue react for pixi.js

What's the difference from React PIXI? It's not react just JSX + PIXI.

My idea is to write games like an app on react.

For example, I want to create a playing field, a player on it and some actions

<Field>
  <Player onChange={} />
  <Enemy onDstroy={} />
</Field>

And most importantly, I will subsequently be able to reuse or even create a library of gaming components like a design system for an application

I also wanted to apply declarative filters.

<Component>
  <Filter />
  <Filter />
/// more
</Component>

or textures.

<Component>
  {isAlive && <Texture />}
  {!isAlive && <Texture />}
/// more
</Component>

I wrote a small library, now it is enough to make simple games like visual short stories, or maybe more difficult

Repository and demo

If this topic is interesting then I could write about how it works and develop the project?

Top comments (0)