DEV Community

Tetragius
Tetragius

Posted on

2 2

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?

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay