OJPlay#
play.onejs.com is a catalog of carts, small games and experiments written with OneJS. Every one of them runs in the browser, shows you its source, and can be forked in a browser editor or downloaded into a Unity project.
Carts are written in the same React and TypeScript as any OneJS app, but against a package called oj rather than against a Unity project of your own. There is no install, no editor, and no build step: you fork a game, edit it, and it runs.
Its documentation lives on the Play site#
play.onejs.com/docs covers writing a cart and publishing it, the stage, elements and styling, files, effects, 3D, and opening a cart in Unity.
It is kept there rather than here because it is written for a different reader. Nothing on this site about installing the package, assigning a PanelSettings, calling into C#, or building for a platform applies to somebody writing a game in a browser, and the Play runtime is versioned on its own cadence.
Where the two meet#
Everything about React, elements, styling and Tailwind is the same on both sides, and so are the parts of the runtime a cart can reach:
The other direction is a clone. Every cart is a git repository: clone it into a Unity project that has OneJS installed, run npx ojplay init --unity, and drag the prefab it writes into a scene. The download button on the game shows the commands. From that point it is an ordinary OneJS project and this site is the one you want.
From a terminal, ojplay is the command for carts: install it once with npm install -g ojplay, then ojplay add @handle/name starts a cart that uses another one, or adds it to the cart you are in. ojplay help lists the rest.