Tiny RPG Maker is a modular 8x8 tile adventure engine with a clear split between the runtime and the editor UI.
tiny-rpg-maker/
|-- index.html # Application shell and tab layout
|-- styles.css # Global styling for the game and editor
|-- js/
| |-- main.js # App bootstrap and tab coordination
| |-- core/
| | |-- GameEngine.js
| | |-- GameState.js
| | |-- InputManager.js
| | |-- NPCManager.js
| | |-- Renderer.js
| | `-- TileManager.js
| `-- editor/
| `-- EditorManager.js
|-- engine.js # Standalone build used by the editor HTML export
`-- README.md
- 8x8 tile grid with customizable pixel art tiles
- NPC support with interactive dialog boxes
- Wall and tile collision, room exits, and collectible items
- Room switching and palette management
- Pixel-perfect tile editor
- Map painting with ground and overlay layers
- NPC manager with placement and dialog editing
- Undo and redo history, JSON import or export, and HTML export helper
python -m http.server 8000Visit http://localhost:8000 in your browser.
- Select the Editor tab.
- Draw tiles in the tile editor.
- Paint the overworld map with your tiles.
- Add NPCs, items, and exits.
- Switch to the Game tab to play-test using the arrow keys.
Stores the entire game definition:
- Game metadata (title, palette, rooms)
- Player position and dialog state
- Tileset map, sprites, exits, and items
Manages tiles and tile maps:
- Creates blank tiles
- Adds, removes, and updates tiles
- Updates ground and overlay layers
- Seeds default ground tiles when the world is empty
Handles NPC creation and dialog updates:
- Generates IDs
- Adds and updates NPCs
- Filters NPCs per room
- Stores dialog text
Processes keyboard and editor pointer input:
- Player movement and interaction keys
- Dialog dismissal shortcuts
- Canvas painting helpers for the editor
Draws every frame:
- Ground, overlay tiles, and walls
- Items, NPCs, and the player sprite
- Dialog box rendering
- Tile previews for the editor UI
Coordinates the runtime:
- Boots all core modules
- Owns movement, collision, and interaction checks
- Synchronizes the document title with the game
Controls the editor UI:
- DOM binding and resize handling
- History stack management
- Import, export, and HTML generation
- Canvas interactions for map and tile editing
The engine exposes a runtime API on window.TinyRPGMaker:
// Game data
TinyRPGMaker.exportGameData(); // Export current game as JSON
TinyRPGMaker.importGameData(data); // Load a game definition
TinyRPGMaker.getState(); // Read-only access to internal state
TinyRPGMaker.draw(); // Force a render pass
TinyRPGMaker.resetGame(); // Reset player position and dialog
// Tiles
TinyRPGMaker.addTile(tile);
TinyRPGMaker.updateTile(id, data);
TinyRPGMaker.createBlankTile(name);
TinyRPGMaker.setMapTile(x, y, id);
TinyRPGMaker.getTiles();
TinyRPGMaker.getTileMap();
// NPCs
TinyRPGMaker.addSprite(npc);
TinyRPGMaker.getSprites();Update the palette in GameState.js:
palette: ['#0e0f13', '#2e3140', '#f4f4f8']The grid defaults to 8x8. Adjust the constants in the core modules if you need larger rooms.
- Single responsibility: each module focuses on one concern.
- Encapsulation: shared state lives in
GameState, while managers expose intent-based methods. - Modularity: the editor talks to the engine exclusively through public APIs.
- Naming: functions and variables favor descriptive identifiers.
- Documentation: comments describe non-obvious behavior where helpful.
- Compatibility: the runtime API remains stable for editor integrations.
- Ensure every JavaScript file listed in
index.htmlis being served. - Check the browser console for runtime errors.
- Confirm the development server is running.
- Verify that at least one tile exists in the tileset.
- Use "Add Tile" to create a starter tile.
- Make sure the tile is selected before painting the map.
- Confirm the NPC is placed in the correct room.
- Add dialog text in the NPC panel.
- Stand on the NPC and press
ZorEnterto trigger dialog.
This project is released for educational purposes. Use it freely in your own experiments and prototypes.