std-platformer-canvas
Level: Atom | Entity: PlatformerCanvas | Persistence: singleton
2 states, 6 events, 6 transitions
Live Preview
schema.orb
{
"name": "PlatformerCanvasOrbital",
"orbitals": [
{
"name": "PlatformerCanvasOrbital",
"entity": {
"name": "PlatformerCanvas",
"persistence": "singleton",
"fields": [
{
"name": "id",
"type": "string"
},
{
"name": "name",
"type": "string"
},
{
"name": "description",
"type": "string"
},
{
"name": "status",
"type": "string",
"default": "active",
"values": [
"active",
"inactive",
"pending"
]
},
{
"name": "createdAt",
"type": "string"
},
{
"name": "platforms",
"type": "array"
},
{
"name": "player",
"type": "object"
}
],
"instances": [
{
"id": "level",
"platforms": [
{
"x": 0,
"y": 350,
"width": 2400,
"height": 50
},
{
"x": 200,
"y": 250,
"width": 150,
"height": 20
},
{
"x": 500,
"y": 200,
"width": 120,
"height": 20
},
{
"x": 800,
"y": 280,
"width": 180,
"height": 20
},
{
"x": 1100,
"y": 180,
"width": 100,
"height": 20
},
{
"x": 1400,
"y": 230,
"width": 160,
"height": 20
},
{
"x": 1700,
"y": 150,
"width": 140,
"height": 20
}
],
"player": {
"x": 50,
"y": 300,
"width": 30,
"height": 30,
"vx": 0,
"vy": 0
}
}
]
},
"traits": [
{
"name": "PlatformerCanvasPlatformerCanvas",
"linkedEntity": "PlatformerCanvas",
"category": "interaction",
"stateMachine": {
"states": [
{
"name": "idle",
"isInitial": true
},
{
"name": "running"
}
],
"events": [
{
"key": "INIT",
"name": "Initialize"
},
{
"key": "LEFT",
"name": "Move Left"
},
{
"key": "RIGHT",
"name": "Move Right"
},
{
"key": "JUMP",
"name": "Jump"
},
{
"key": "STOP",
"name": "Stop"
},
{
"key": "START",
"name": "Start"
}
],
"transitions": [
{
"from": "idle",
"to": "idle",
"event": "INIT",
"effects": [
[
"fetch",
"PlatformerCanvas"
],
[
"render-ui",
"main",
{
"type": "platformer-canvas",
"platforms": "@entity.platforms",
"player": "@entity.player",
"canvasWidth": 800,
"canvasHeight": 400,
"worldWidth": 2400,
"worldHeight": 400,
"followCamera": true,
"bgColor": "#1a1a2e",
"leftEvent": "LEFT",
"rightEvent": "RIGHT",
"jumpEvent": "JUMP",
"stopEvent": "STOP"
}
]
]
},
{
"from": "idle",
"to": "running",
"event": "START",
"effects": [
[
"render-ui",
"main",
{
"type": "platformer-canvas",
"platforms": "@entity.platforms",
"player": "@entity.player",
"canvasWidth": 800,
"canvasHeight": 400,
"worldWidth": 2400,
"worldHeight": 400,
"followCamera": true,
"bgColor": "#1a1a2e",
"leftEvent": "LEFT",
"rightEvent": "RIGHT",
"jumpEvent": "JUMP",
"stopEvent": "STOP"
}
]
]
},
{
"from": "running",
"to": "running",
"event": "LEFT",
"effects": []
},
{
"from": "running",
"to": "running",
"event": "RIGHT",
"effects": []
},
{
"from": "running",
"to": "running",
"event": "JUMP",
"effects": []
},
{
"from": "running",
"to": "idle",
"event": "STOP",
"effects": [
[
"render-ui",
"main",
{
"type": "platformer-canvas",
"platforms": "@entity.platforms",
"player": "@entity.player",
"canvasWidth": 800,
"canvasHeight": 400,
"worldWidth": 2400,
"worldHeight": 400,
"followCamera": true,
"bgColor": "#1a1a2e",
"leftEvent": "LEFT",
"rightEvent": "RIGHT",
"jumpEvent": "JUMP",
"stopEvent": "STOP"
}
]
]
}
]
}
}
],
"pages": [
{
"name": "PlatformerCanvasPlatformerPage",
"path": "/platformercanvass",
"traits": [
{
"ref": "PlatformerCanvasPlatformerCanvas"
}
]
}
]
}
],
"description": "Side-scrolling platformer atom using the `platformer-canvas` pattern. Renders player, platforms, and handles movement events."
}
Loading preview...
Orbital Visualization
Loading visualization...
Entity Fields
| Field | Type | Default |
|---|---|---|
| id | string | - |
| name | string | - |
| description | string | - |
| status | string | "active" |
| createdAt | string | - |
| platforms | array | - |
| player | object | - |
States
| State | Type |
|---|---|
| idle | Initial |
| running | - |
Events
| Event | Payload |
|---|---|
| INIT | - |
| LEFT | - |
| RIGHT | - |
| JUMP | - |
| STOP | - |
| START | - |
Transitions
| From | Event | To | Effects |
|---|---|---|---|
| idle | INIT | idle | 2 effects |
| idle | START | running | 1 effect |
| running | LEFT | running | - |
| running | RIGHT | running | - |
| running | JUMP | running | - |
| running | STOP | idle | 1 effect |