A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.
TypeScript 2d-game-engine3d3d-game-engineandroidcppecsgame-editorgame-enginegamedeviostypescriptwebassemblywebglwebgpuwechat-minigame
examples(tilemap-demo): interactive two-scene tilemap showcase
yhh2be8aafd449e
diff --git a/examples/ASSETS.md b/examples/ASSETS.mdindex 6d448fbc9..58b3bc256 100644--- a/examples/ASSETS.md+++ b/examples/ASSETS.md@@ -15,7 +15,7 @@ starting point for a real game. This credit is a courtesy, not an obligation.| [Particle Pack](https://kenney.nl/assets/particle-pack) | CC0 | particle-demo, space-shooter (explosion) || [Physics Assets](https://kenney.nl/assets/physics-assets) | CC0 | physics-playground (ball) || [UI Pack](https://kenney.nl/assets/ui-pack) | CC0 | sprite-rendering (arrow) |-| [Pixel Platformer](https://kenney.nl/assets/pixel-platformer) | CC0 | tilemap-demo (tileset atlas) |+| [Pixel Platformer](https://kenney.nl/assets/pixel-platformer) | CC0 | tilemap-demo (`tileset.png` terrain atlas; `props.png` is a handful of its tiles repacked into a second tileset) |## Audiodiff --git a/examples/README.md b/examples/README.mdindex a2b84d352..e587b09ce 100644--- a/examples/README.md+++ b/examples/README.md@@ -25,7 +25,7 @@ for your own game.| **physics-spinner** | Physics | Revolute joints and continuous rotation. || **particle-demo** | Effects | A configurable particle emitter with additive blending. || **postprocess-effects** | Effects | Full-screen post-processing: bloom, vignette, color grading. |-| **tilemap-demo** | Tilemap | A tile level painted from a tileset atlas, drawn by the tilemap layer. |+| **tilemap-demo** | Tilemap | Two scenes: a Tiled `.tmj` import and an engine-native `.estileset` — multi-tileset, parallax, animated water, per-tile collision. || **ui-controls** | UI | Buttons, sliders, toggles and progress bars. || **ui-interaction** | UI | Dragging, focus and pointer interaction. || **ui-layout** | UI | Flexbox-style responsive UI layout. |diff --git a/examples/tilemap-demo/README.md b/examples/tilemap-demo/README.mdnew file mode 100644index 000000000..5c36c1bdd--- /dev/null+++ b/examples/tilemap-demo/README.md@@ -0,0 +1,43 @@+# Tilemap Demo++Estella's tilemap system, shown two ways — **a Tiled `.tmj` import** and **an+engine-native `.estileset`** — over the same Kenney Pixel Platformer art. Both are+drawn by the built-in tilemap plugin with **no gameplay code**; the level lives+entirely in the scene/assets.++| Scene | Authoring path | What it shows |+| --- | --- | --- |+| `assets/scenes/tiled-map.esscene` *(default)* | `Tilemap { source: "…/level.tmj" }` | Imports a real [Tiled](https://www.mapeditor.org/) map: **two embedded tilesets** (`terrain` + `props`, global GIDs), a **parallax** background of clouds, **animated** water, and **per-tile collision** — the map is auto-loaded when the scene opens. |+| `assets/scenes/native-map.esscene` | `TilemapLayer` → `.estileset` | References the engine's first-class tileset asset. Collision and the water animation are **derived live at runtime** from the tileset — nothing is baked into the scene but the tile chunks. |++## One runtime model++The point of the demo is that both paths **converge on the same runtime tileset+model**. Whether tiles come from a Tiled `.tmj` or an `.estileset`, the engine+resolves them to one table of `{ firstId, texture, columns }` slots plus the same+live collision and animation data. So:++- The `.tmj` gives you the whole Tiled ecosystem (author in Tiled, drop the file in).+- The `.estileset` makes the tileset the **single source of truth**: edit a tile's+ collision or animation once and every map that references it updates — no+ re-baking, no per-scene copies.++## Assets++| File | Role |+| --- | --- |+| `assets/textures/tileset.png` | Kenney Pixel Platformer terrain atlas (360×162, 18px tiles, 20×9). |+| `assets/textures/props.png` | A few of its tiles repacked as a second tileset (gem, heart, coin box, key, foliage). |+| `assets/maps/level.tmj` | The Tiled map (both tilesets embedded, CSV layer data). |+| `assets/tilesets/terrain.estileset` | The engine-native tileset: atlas grid + per-tile collision + water animation. |++Art is **Kenney [Pixel Platformer](https://kenney.nl/assets/pixel-platformer)+(CC0)** — reuse it freely, including commercially. See+[../ASSETS.md](../ASSETS.md).++## Running++Open the folder in the Estella editor and press **Play**, or point the example+launcher at it. `src/main.ts` is intentionally empty — add systems there to make+the map interactive (for example, spawn a character that walks the collidable+ground and swims through the animated water).diff --git a/examples/tilemap-demo/assets/maps/level.tmj b/examples/tilemap-demo/assets/maps/level.tmjnew file mode 100644index 000000000..73a1f7f7e--- /dev/null+++ b/examples/tilemap-demo/assets/maps/level.tmj@@ -0,0 +1,2454 @@+{+ "compressionlevel": -1,+ "type": "map",+ "version": "1.10",+ "tiledversion": "1.10.2",+ "orientation": "orthogonal",+ "renderorder": "right-down",+ "infinite": false,+ "width": 32,+ "height": 18,+ "tilewidth": 18,+ "tileheight": 18,+ "nextlayerid": 5,+ "nextobjectid": 1,+ "tilesets": [+ {+ "firstgid": 1,+ "name": "terrain",+ "image": "../textures/tileset.png",+ "imagewidth": 360,+ "imageheight": 162,+ "tilewidth": 18,+ "tileheight": 18,+ "columns": 20,+ "tilecount": 180,+ "margin": 0,+ "spacing": 0,+ "tiles": [+ {+ "id": 33,+ "animation": [+ {+ "tileid": 33,+ "duration": 500+ },+ {+ "tileid": 53,+ "duration": 500+ }+ ]+ },+ {+ "id": 0,+ "properties": [+ {+ "name": "collision",+ "type": "bool",+ "value": true+ }+ ]+ },+ {+ "id": 1,+ "properties": [+ {+ "name": "collision",+ "type": "bool",+ "value": true+ }+ ]+ },+ {+ "id": 2,+ "properties": [+ {+ "name": "collision",+ "type": "bool",+ "value": true+ }+ ]+ },+ {+ "id": 3,+ "properties": [+ {+ "name": "collision",+ "type": "bool",+ "value": true+ }+ ]+ }+ ]+ },+ {+ "firstgid": 181,+ "name": "props",+ "image": "../textures/props.png",+ "imagewidth": 72,+ "imageheight": 36,+ "tilewidth": 18,+ "tileheight": 18,+ "columns": 4,+ "tilecount": 8,+ "margin": 0,+ "spacing": 0+ }+ ],+ "layers": [+ {+ "type": "tilelayer",+ "name": "Background",+ "width": 32,+ "height": 18,+ "x": 0,+ "y": 0,+ "opacity": 1,+ "visible": true,+ "data": [+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+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+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0+ ]+ }+ ]+}\ No newline at end of filediff --git a/examples/tilemap-demo/assets/maps/level.tmj.meta b/examples/tilemap-demo/assets/maps/level.tmj.metanew file mode 100644index 000000000..5456dc8d2--- /dev/null+++ b/examples/tilemap-demo/assets/maps/level.tmj.meta@@ -0,0 +1,6 @@+{+ "uuid": "842b8838-44e7-41ae-a634-4e922c96543a",+ "version": "2.0",+ "type": "tilemap",+ "importer": {}+}diff --git a/examples/tilemap-demo/assets/scenes/main.esscene b/examples/tilemap-demo/assets/scenes/main.esscenedeleted file mode 100644index 46059e1f8..000000000--- a/examples/tilemap-demo/assets/scenes/main.esscene+++ /dev/null@@ -1,40 +0,0 @@-{- "version": "1.0",- "name": "Main",- "entities": [- {- "id": 0,- "name": "Camera",- "parent": null,- "children": [],- "components": [- { "type": "Transform", "data": { "position": { "x": 144, "y": -144, "z": 10 } } },- { "type": "Camera", "data": { "projectionType": 1, "orthoSize": 160, "isActive": true, "priority": 0 } }- ],- "visible": true- },- {- "id": 1,- "name": "Tilemap",- "parent": null,- "children": [],- "components": [- { "type": "Transform", "data": { "position": { "x": 0, "y": 0, "z": 0 } } },- {- "type": "TilemapLayer",- "data": {- "cellSize": { "x": 18, "y": 18 },- "tileset": "@uuid:11111111-2222-3333-4444-555555555555",- "tilesetColumns": 20,- "tilesetRows": 9,- "renderLayer": 0,- "opacity": 1,- "visible": true,- "chunks": "RVNUTQEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQACAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAIAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAwAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYA"- }- }- ],- "visible": true- }- ]-}diff --git a/examples/tilemap-demo/assets/scenes/native-map.esscene b/examples/tilemap-demo/assets/scenes/native-map.esscenenew file mode 100644index 000000000..3eedab4d6--- /dev/null+++ b/examples/tilemap-demo/assets/scenes/native-map.esscene@@ -0,0 +1,117 @@+{+ "version": "1.0",+ "name": "NativeMap",+ "entities": [+ {+ "id": 0,+ "name": "Camera",+ "parent": null,+ "children": [],+ "components": [+ {+ "type": "Transform",+ "data": {+ "position": {+ "x": 288,+ "y": -162,+ "z": 10+ }+ }+ },+ {+ "type": "Camera",+ "data": {+ "projectionType": 1,+ "orthoSize": 162,+ "isActive": true,+ "priority": 0+ }+ }+ ],+ "visible": true+ },+ {+ "id": 1,+ "name": "Sky",+ "parent": null,+ "children": [],+ "components": [+ {+ "type": "Transform",+ "data": {+ "position": {+ "x": 288,+ "y": -162,+ "z": 0+ }+ }+ },+ {+ "type": "Sprite",+ "data": {+ "size": {+ "x": 640,+ "y": 388+ },+ "color": {+ "r": 0.35,+ "g": 0.63,+ "b": 0.86,+ "a": 1+ },+ "layer": -10+ }+ }+ ],+ "visible": true+ },+ {+ "id": 2,+ "name": "Tilemap (.estileset)",+ "parent": null,+ "children": [],+ "components": [+ {+ "type": "Transform",+ "data": {+ "position": {+ "x": 0,+ "y": 0,+ "z": 0+ }+ }+ },+ {+ "type": "TilemapLayer",+ "data": {+ "cellSize": {+ "x": 18,+ "y": 18+ },+ "renderLayer": 0,+ "opacity": 1,+ "visible": true,+ "tilesetAsset": "@uuid:fe50656d-6d29-4e60-b078-0a62cfcce58c",+ "chunks": "RVNUTQQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACbAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAmwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQACAAMABAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"+ }+ }+ ],+ "visible": true+ },+ {+ "id": 3,+ "name": "Player",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 90, "y": -170, "z": 1 } } },+ { "type": "Sprite", "data": { "size": { "x": 18, "y": 18 }, "texture": "@uuid:33875408-2450-4071-bad2-d54ead703b8b", "layer": 5 } },+ { "type": "Player", "data": {} },+ { "type": "RigidBody", "data": { "bodyType": 1 } },+ { "type": "BoxCollider", "data": { "halfExtents": { "x": 0.07, "y": 0.08 }, "categoryBits": 1, "maskBits": 65535 } },+ { "type": "CharacterController", "data": { "maskBits": 65535 } }+ ],+ "visible": true+ }+ ]+}diff --git a/examples/tilemap-demo/assets/scenes/native-map.esscene.meta b/examples/tilemap-demo/assets/scenes/native-map.esscene.metanew file mode 100644index 000000000..6acb894f7--- /dev/null+++ b/examples/tilemap-demo/assets/scenes/native-map.esscene.meta@@ -0,0 +1,8 @@+{+ "uuid": "d8bcbdbf-6ee1-4b69-93b2-5d0137c0870a",+ "version": "2.0",+ "type": "scene",+ "importer": {+ "autoMigrate": true+ }+}diff --git a/examples/tilemap-demo/assets/scenes/tiled-map.esscene b/examples/tilemap-demo/assets/scenes/tiled-map.esscenenew file mode 100644index 000000000..b6b77110b--- /dev/null+++ b/examples/tilemap-demo/assets/scenes/tiled-map.esscene@@ -0,0 +1,109 @@+{+ "version": "1.0",+ "name": "TiledMap",+ "entities": [+ {+ "id": 0,+ "name": "Camera",+ "parent": null,+ "children": [],+ "components": [+ {+ "type": "Transform",+ "data": {+ "position": {+ "x": 288,+ "y": -162,+ "z": 10+ }+ }+ },+ {+ "type": "Camera",+ "data": {+ "projectionType": 1,+ "orthoSize": 162,+ "isActive": true,+ "priority": 0+ }+ }+ ],+ "visible": true+ },+ {+ "id": 1,+ "name": "Sky",+ "parent": null,+ "children": [],+ "components": [+ {+ "type": "Transform",+ "data": {+ "position": {+ "x": 288,+ "y": -162,+ "z": 0+ }+ }+ },+ {+ "type": "Sprite",+ "data": {+ "size": {+ "x": 640,+ "y": 388+ },+ "color": {+ "r": 0.35,+ "g": 0.63,+ "b": 0.86,+ "a": 1+ },+ "layer": -10+ }+ }+ ],+ "visible": true+ },+ {+ "id": 2,+ "name": "Tilemap (Tiled import)",+ "parent": null,+ "children": [],+ "components": [+ {+ "type": "Transform",+ "data": {+ "position": {+ "x": 0,+ "y": 0,+ "z": 0+ }+ }+ },+ {+ "type": "Tilemap",+ "data": {+ "source": "@uuid:842b8838-44e7-41ae-a634-4e922c96543a"+ }+ }+ ],+ "visible": true+ },+ {+ "id": 3,+ "name": "Player",+ "parent": null,+ "children": [],+ "components": [+ { "type": "Transform", "data": { "position": { "x": 90, "y": -170, "z": 1 } } },+ { "type": "Sprite", "data": { "size": { "x": 18, "y": 18 }, "texture": "@uuid:33875408-2450-4071-bad2-d54ead703b8b", "layer": 5 } },+ { "type": "Player", "data": {} },+ { "type": "RigidBody", "data": { "bodyType": 1 } },+ { "type": "BoxCollider", "data": { "halfExtents": { "x": 0.07, "y": 0.08 }, "categoryBits": 1, "maskBits": 65535 } },+ { "type": "CharacterController", "data": { "maskBits": 65535 } }+ ],+ "visible": true+ }+ ]+}diff --git a/examples/tilemap-demo/assets/scenes/tiled-map.esscene.meta b/examples/tilemap-demo/assets/scenes/tiled-map.esscene.metanew file mode 100644index 000000000..b4fac1b1a--- /dev/null+++ b/examples/tilemap-demo/assets/scenes/tiled-map.esscene.meta@@ -0,0 +1,8 @@+{+ "uuid": "84b28c76-0eb7-4950-b841-ffb89567055d",+ "version": "2.0",+ "type": "scene",+ "importer": {+ "autoMigrate": true+ }+}diff --git a/examples/tilemap-demo/assets/textures/player.png b/examples/tilemap-demo/assets/textures/player.pngnew file mode 100644index 000000000..58400e863Binary files /dev/null and b/examples/tilemap-demo/assets/textures/player.png differdiff --git a/examples/tilemap-demo/assets/textures/player.png.meta b/examples/tilemap-demo/assets/textures/player.png.metanew file mode 100644index 000000000..26773fa2a--- /dev/null+++ b/examples/tilemap-demo/assets/textures/player.png.meta@@ -0,0 +1,17 @@+{+ "uuid": "33875408-2450-4071-bad2-d54ead703b8b",+ "version": "2.0",+ "type": "texture",+ "importer": {+ "maxSize": 2048,+ "filterMode": "nearest",+ "wrapMode": "clamp",+ "premultiplyAlpha": false,+ "sliceBorder": {+ "left": 0,+ "right": 0,+ "top": 0,+ "bottom": 0+ }+ }+}diff --git a/examples/tilemap-demo/assets/textures/props.png b/examples/tilemap-demo/assets/textures/props.pngnew file mode 100644index 000000000..2698f257bBinary files /dev/null and b/examples/tilemap-demo/assets/textures/props.png differdiff --git a/examples/tilemap-demo/assets/textures/props.png.meta b/examples/tilemap-demo/assets/textures/props.png.metanew file mode 100644index 000000000..a92197d8a--- /dev/null+++ b/examples/tilemap-demo/assets/textures/props.png.meta@@ -0,0 +1,17 @@+{+ "uuid": "89ff8a56-d138-4cad-a595-823402a90310",+ "version": "2.0",+ "type": "texture",+ "importer": {+ "maxSize": 2048,+ "filterMode": "nearest",+ "wrapMode": "clamp",+ "premultiplyAlpha": false,+ "sliceBorder": {+ "left": 0,+ "right": 0,+ "top": 0,+ "bottom": 0+ }+ }+}diff --git a/examples/tilemap-demo/assets/tilesets/terrain.estileset b/examples/tilemap-demo/assets/tilesets/terrain.estilesetnew file mode 100644index 000000000..3d1c11459--- /dev/null+++ b/examples/tilemap-demo/assets/tilesets/terrain.estileset@@ -0,0 +1,44 @@+{+ "version": "1",+ "texture": "@uuid:11111111-2222-3333-4444-555555555555",+ "tileWidth": 18,+ "tileHeight": 18,+ "columns": 20,+ "margin": 0,+ "spacing": 0,+ "tileCount": 180,+ "tiles": {+ "1": {+ "collision": {+ "type": "box"+ }+ },+ "2": {+ "collision": {+ "type": "box"+ }+ },+ "3": {+ "collision": {+ "type": "box"+ }+ },+ "4": {+ "collision": {+ "type": "box"+ }+ },+ "34": {+ "animation": [+ {+ "tile": 34,+ "durationMs": 500+ },+ {+ "tile": 54,+ "durationMs": 500+ }+ ]+ }+ }+}diff --git a/examples/tilemap-demo/assets/tilesets/terrain.estileset.meta b/examples/tilemap-demo/assets/tilesets/terrain.estileset.metanew file mode 100644index 000000000..2dd9c9236--- /dev/null+++ b/examples/tilemap-demo/assets/tilesets/terrain.estileset.meta@@ -0,0 +1,6 @@+{+ "uuid": "fe50656d-6d29-4e60-b078-0a62cfcce58c",+ "version": "2.0",+ "type": "tileset",+ "importer": {}+}diff --git a/examples/tilemap-demo/project.esproject b/examples/tilemap-demo/project.esprojectindex 714ed7182..57e6b7926 100644--- a/examples/tilemap-demo/project.esproject+++ b/examples/tilemap-demo/project.esproject@@ -1,13 +1,13 @@{"formatVersion": "1","name": "Tilemap Demo",- "description": "A tile-based level painted from a Kenney tileset atlas and rendered by the tilemap layer.",+ "description": "A Tiled (.tmj) level and an engine-native (.estileset) level — the same tileset, two authoring paths, one runtime model. Shows multi-tileset rendering, parallax, animated tiles, and per-tile collision.","tag": "Tilemap",- "version": "0.1.0",- "defaultScene": "assets/scenes/main.esscene",+ "version": "0.2.0",+ "defaultScene": "assets/scenes/tiled-map.esscene","designResolution": {"width": 800,- "height": 600+ "height": 450},"spineVersion": "none"}diff --git a/examples/tilemap-demo/src/components.ts b/examples/tilemap-demo/src/components.tsnew file mode 100644index 000000000..00417f12b--- /dev/null+++ b/examples/tilemap-demo/src/components.ts@@ -0,0 +1,10 @@+import { defineComponent } from 'esengine';++// A tiny platformer character that walks + jumps on the tilemap's collidable+// tiles. Units are PIXELS: the scene runs pixel-space physics (a Canvas with+// pixelsPerUnit = 1), so the tilemap's per-tile colliders line up 1:1 with the+// character's collider.+export const Player = defineComponent('Player', {+ speed: 170, // px/s horizontal+ jumpForce: 420, // px/s launch velocity+});diff --git a/examples/tilemap-demo/src/main.ts b/examples/tilemap-demo/src/main.tsindex 75fc8090d..80fe850d4 100644--- a/examples/tilemap-demo/src/main.ts+++ b/examples/tilemap-demo/src/main.ts@@ -1,5 +1,20 @@-// Tilemap Demo — the level is authored in the scene (assets/scenes/main.esscene)-// as a TilemapLayer that references the Kenney tileset atlas, and it is rendered by-// the engine's built-in tilemap plugin. Displaying it needs no gameplay systems, so-// this entry point is intentionally empty; add systems here to make the map interactive.-export {};+// Tilemap Demo — the tilemap system shown two ways (a Tiled `.tmj` import and an+// engine-native `.estileset`), NOW made interactive: a small penguin character+// runs and jumps on the map's collidable tiles, driven by the physics engine.+//+// • tiled-map.esscene `Tilemap { source }` — two tilesets, parallax clouds,+// animated water, per-tile collision.+// • native-map.esscene `TilemapLayer` → `.estileset` — collision + animation+// derived live from the tileset asset.+//+// Both scenes run PIXEL-SPACE physics (a Canvas with pixelsPerUnit = 1) so the+// tilemap's per-tile colliders line up 1:1 with the character. Move with+// A/D or ←/→, jump with Space/W/↑.+import { addSystemToSchedule, Schedule } from 'esengine';++import './components';+import { playerSystem } from './systems/player';+import { respawnSystem } from './systems/respawn';++addSystemToSchedule(Schedule.FixedPreUpdate, playerSystem);+addSystemToSchedule(Schedule.Update, respawnSystem);diff --git a/examples/tilemap-demo/src/systems/player.ts b/examples/tilemap-demo/src/systems/player.tsnew file mode 100644index 000000000..b15e1a74c--- /dev/null+++ b/examples/tilemap-demo/src/systems/player.ts@@ -0,0 +1,29 @@+import {+ defineSystem, Query, Mut, Res, Time, Input,+ CharacterController,+} from 'esengine';+import { Player } from '../components';++// Pixel-space gravity (the scene's Canvas sets pixelsPerUnit = 1). Tuned for the+// 18px tiles: a jump clears ~3 tiles and the fall feels snappy.+const GRAVITY = -1200;++export const playerSystem = defineSystem(+ [Query(Mut(CharacterController), Player), Res(Time), Res(Input)],+ (players, time, input) => {+ for (const [, cc, player] of players) {+ let moveX = 0;+ if (input.isKeyDown('ArrowLeft') || input.isKeyDown('KeyA')) moveX -= 1;+ if (input.isKeyDown('ArrowRight') || input.isKeyDown('KeyD')) moveX += 1;+ cc.velocity.x = moveX * player.speed;++ cc.velocity.y += GRAVITY * time.fixedDelta;++ const jump = input.isKeyPressed('Space')+ || input.isKeyPressed('ArrowUp')+ || input.isKeyPressed('KeyW');+ if (cc.isOnFloor && jump) cc.velocity.y = player.jumpForce;+ }+ },+ { name: 'PlayerSystem' },+);diff --git a/examples/tilemap-demo/src/systems/respawn.ts b/examples/tilemap-demo/src/systems/respawn.tsnew file mode 100644index 000000000..892a2af57--- /dev/null+++ b/examples/tilemap-demo/src/systems/respawn.ts@@ -0,0 +1,32 @@+import {+ defineSystem, Query, Mut, Transform, CharacterController,+} from 'esengine';+import { Player } from '../components';++// World is y-down here (the map spans y ∈ [0, -324]); anything past this has+// fallen through the water pit and off the bottom of the screen.+const DEATH_Y = -360;++// Each player's entry point, captured on the first frame it's seen — so respawn+// works in any scene without hard-coded coordinates.+const homes = new Map<number, { x: number; y: number }>();++export const respawnSystem = defineSystem(+ [Query(Mut(Transform), Mut(CharacterController), Player)],+ (players) => {+ for (const [entity, tf, cc] of players) {+ let home = homes.get(entity);+ if (!home) {+ home = { x: tf.position.x, y: tf.position.y };+ homes.set(entity, home);+ }+ if (tf.position.y < DEATH_Y) {+ tf.position.x = home.x;+ tf.position.y = home.y;+ cc.velocity.x = 0;+ cc.velocity.y = 0;+ }+ }+ },+ { name: 'RespawnSystem' },+);diff --git a/examples/tilemap-demo/thumbnail.png b/examples/tilemap-demo/thumbnail.pngnew file mode 100644index 000000000..0dc08bcb9Binary files /dev/null and b/examples/tilemap-demo/thumbnail.png differdiff --git a/examples/tilemap-demo/thumbnail.png.meta b/examples/tilemap-demo/thumbnail.png.metanew file mode 100644index 000000000..3b5c3bcea--- /dev/null+++ b/examples/tilemap-demo/thumbnail.png.meta@@ -0,0 +1,17 @@+{+ "uuid": "31b59d49-24a2-498f-bc29-dbaa7011d85c",+ "version": "2.0",+ "type": "texture",+ "importer": {+ "maxSize": 2048,+ "filterMode": "linear",+ "wrapMode": "repeat",+ "premultiplyAlpha": false,+ "sliceBorder": {+ "left": 0,+ "right": 0,+ "top": 0,+ "bottom": 0+ }+ }+}