Giantus Framework is a professional, code-first 2D game framework for TypeScript and HTML5 Canvas. It is designed for developers who want a clean runtime, explicit game code, deterministic building blocks, and a package that can be understood without a visual editor.
- Fixed-step game loop with variable rendering, FPS diagnostics, and manual stepping support.
- Entity/component architecture with scenes, systems, lifecycle hooks, hierarchical transforms, and z ordering.
- Canvas renderer with camera support, high-DPI scaling, pixel-perfect rendering, sprites, text, rectangles, circles, and low-level drawing access.
- Keyboard, pointer, and action-map input designed for readable gameplay code.
- Asset manager for images, JSON, and text, plus an audio manager built on Web Audio.
- AABB physics with dynamic, static, and kinematic bodies, gravity, triggers, layers, masks, and collision resolution.
- Animation clips, sprite-sheet playback, tweens, particles, deterministic random numbers, tile maps, and utility primitives.
- Dependency-free tooling: build with TypeScript, serve examples with the included dev server, and scaffold games with the CLI.
npm run build
npm run devOpen http://localhost:5173 to run the included platformer demo.
import { Engine, Scene, Entity, RectangleRenderer, Vector2 } from "giantus-framework";
const canvas = document.querySelector<HTMLCanvasElement>("#game");
if (!canvas) throw new Error("Canvas not found.");
const engine = new Engine({ canvas, width: 1280, height: 720, pixelPerfect: true });
const scene = new Scene("Main");
const player = new Entity("Player", { position: new Vector2(200, 160) });
player.add(new RectangleRenderer({ width: 48, height: 48, fill: "#f7d154" }));
scene.addEntity(player);
engine.setScene(scene);
engine.start();src/
animation/ Sprite-sheet animation clips and playback.
assets/ Extensible asset loading and cache management.
audio/ Web Audio loading and playback.
core/ Engine, scenes, entities, components, systems, events, timing.
debug/ Runtime diagnostics overlay.
input/ Keyboard, pointer, and action input.
math/ Vectors, rectangles, colors, matrices, easing, random.
particles/ Lightweight particle emitter.
physics/ AABB body, collider, trigger, and resolution systems.
rendering/ Canvas renderer, camera, sprite, text, and primitive renderers.
tilemap/ Code-driven tile map rendering and collision metadata.
tween/ Numeric tweening primitives.
npm run buildcompiles TypeScript intodist/.npm run typecheckvalidates the source without emitting files.npm testbuilds the framework and runs Node tests.npm run devbuilds and serves the platformer example.npm run cleanremoves generated build output.
Giantus is intentionally code-first. Scenes are ordinary classes or scripts, game objects are entities with explicit components, and systems are small runtime services. The framework favors readable primitives over hidden editor state, so games remain easy to refactor, test, and version-control.