Skip to content

Enpyre/enpyre

Repository files navigation

enpyre-logo

Enpyre

A Python game engine in React.
Write python games that run in React applications 👌


build status npm version license


Enpyre is an open-source library to render 2D games made with Python in React with graphics by PIXI.js and the power of Pyodide, WASM, and modern web technologies.

Install

npm install enpyre

yarn add enpyre

Optional Dependencies

If you want to use EnpyreEditor you will need to install the following dependencies:

npm install react-ace ace-builds

yarn add react-ace ace-builds

Usage

import React from 'react';
import {
  EnpyreDisplay,
  EnpyreEditor,
  EnpyreProvider,
  usePyodide,
} from 'enpyre';

const Example: React.FC = () => {
  const { runCode } = usePyodide();

  return (
    <div>
      <EnpyreDisplay />
      <EnpyreEditor />
      <button onClick={runCode}>Run Code</button>
    </div>
  );
};

const App: React.FC = () => {
  return (
    <EnpyreProvider>
      <Example />
    </EnpyreProvider>
  );
};

export default App;

Example Games