Forge is a browser-based, code-only game engine. It has everything you'd expect from an engine, including rendering, audio, input, animations, an Entity-Component-System (ECS) core, physics, and more.
npm install @forge-game-engine/forgeAdd a <div id="game-container"></div> to your page, then create a game
and render a sprite to it:
import { createGame } from '@forge-game-engine/forge/utilities';
import {
addSpriteComponent,
createImageSprite,
} from '@forge-game-engine/forge/rendering';
import { addPositionComponent } from '@forge-game-engine/forge/common';
const { game, world, renderContext } = createGame('game-container');
const image = await renderContext.imageCache.getOrLoad('sprite.png');
const sprite = createImageSprite(image, renderContext, 0);
const entity = world.createEntity();
addPositionComponent(world, entity);
addSpriteComponent(world, entity, sprite);
game.run();See the Getting Started guide for a walkthrough of the above, and the ECS demo for a complete runnable example.
Want to contribute? See CONTRIBUTING.md for setup, verification steps, and commit/changelog conventions.
The engine is where all the code is stored that is usable for most types of games. For example: the renderer, audio systems, animations, mouse pointer, etc.
The engine is not a place to store code that is hyper-specific to a game. For example: a system for collecting coins.
You can make a separate folder or package outside of the engine.
