origin-ts is a specialized, high-performance game engine built with TypeScript, designed exclusively for pixel art RPGs. It provides a professional-grade foundation for world-building, entity management, and cinematic storytelling.
- Modular Entities: Use the Entity-Component-System pattern to build complex actors (Players, NPCs, Items) using reusable data components.
- Decoupled Logic: Separate your game logic (Systems) from your data (Components) for maximum scalability.
- Integer Scaling: Automatic calculation of scaling factors to ensure your pixels stay crisp on any screen size.
- Z-Depth Sorting: Automatic Y-coordinate sorting ensures players correctly walk behind/in-front of trees, buildings, and NPCs.
- Tiled Support: Direct integration with Tiled Map Editor (.tmj JSON).
- Sliding Collisions: AABB bounding box physics that allow for smooth sliding along walls and diagonal movement.
- Dialogue Engine: Cinematic typewriter effects, speaker portraits, and branching text management.
- Event System: A Promise-based system for scripting cutscenes and map triggers.
- Save System: Built-in persistence using
localStorage.
- CRT Scanlines: Subtile horizontal scanlines for that classic monitor feel.
- Day/Night Cycles: Dynamic color grading for sunset and night-time aesthetics.
- Vignette: Subtle edge-darkening to focus player attention.
npm install origin-tsUse this if you want to point directly to the origin-ts folder:
# Replace with your actual path to the origin-ts folder
npm install "/path/to/origin-ts"Use this to make the engine accessible globally on your machine:
# In the origin-ts folder
npm link
# In your game project folder
npm link origin-tsimport { Engine, Display, World, AbstractEntityFactory, DefaultGameFactory } from 'origin-ts';
const display = new Display('app');
const world = new World();
const factory: AbstractEntityFactory = new DefaultGameFactory(world);
// Create a player actor using the Factory
factory.createPlayer({ spriteName: 'hero-sprite', x: 160, y: 90, speed: 100 });
// Start the engine
const engine = new Engine(
(dt) => world.update(dt),
(interpolation) => {
display.clear('#000000');
world.render(interpolation);
}
);
engine.start();src/
├── core/ # Main Loop, Input, Assets, Events, Persistence
├── rendering/ # Canvas (Display) & Sprite management
├── world/ # Tilemaps & Collision logic
├── entities/ # ECS Framework, Components, and Logic Systems
├── ui/ # Dialogue Manager & UI Elements
└── game/ # Gameplay implementation entry point
This project is licensed under the MIT License with a Beerware Clause.
Permission is hereby granted... use it for whatever you want. If we meet some day, and you think this stuff is worth it, you can buy me a beer in return. Cheers! 🍻
Created by Mariano Hurtado de Mendoza Carranza (@d0t4.music on IG/YT)