Preskoči na vsebino

std-sequencer-game

Level: Molecule | Entity: SequencerGame | Persistence: runtime

3 states, 5 events, 5 transitions

Live Preview

schema.orb
{
"name": "SequencerGameOrbital",
"orbitals": [
{
"name": "SequencerGameOrbital",
"entity": {
"name": "SequencerGame",
"persistence": "runtime",
"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": "score",
"type": "number",
"default": 0
},
{
"name": "level",
"type": "number",
"default": 1
}
],
"instances": [
{
"id": "game-1",
"name": "Sequencer Session",
"description": "Active game session",
"status": "active",
"score": 0,
"level": 1
}
]
},
"traits": [
{
"name": "SequencerGameSequencerGame",
"linkedEntity": "SequencerGame",
"category": "interaction",
"stateMachine": {
"states": [
{
"name": "menu",
"isInitial": true
},
{
"name": "playing"
},
{
"name": "complete"
}
],
"events": [
{
"key": "INIT",
"name": "Initialize"
},
{
"key": "START",
"name": "Start"
},
{
"key": "COMPLETE",
"name": "Complete"
},
{
"key": "RESTART",
"name": "Restart"
},
{
"key": "NAVIGATE",
"name": "Navigate"
}
],
"transitions": [
{
"from": "menu",
"to": "menu",
"event": "INIT",
"effects": [
[
"fetch",
"SequencerGame"
],
[
"render-ui",
"main",
{
"type": "game-menu",
"title": "Sequencer",
"menuItems": [
{
"label": "Start",
"event": "START",
"variant": "primary"
}
]
}
]
]
},
{
"from": "menu",
"to": "playing",
"event": "START",
"effects": [
[
"render-ui",
"main",
{
"type": "stack",
"direction": "vertical",
"gap": "md",
"children": [
{
"type": "game-hud",
"stats": [
{
"label": "Score",
"value": "@entity.score"
},
{
"label": "Level",
"value": "@entity.level"
}
]
},
{
"type": "sequencer-board",
"entity": "SequencerGame",
"completeEvent": "COMPLETE"
}
]
}
]
]
},
{
"from": "menu",
"to": "menu",
"event": "NAVIGATE",
"effects": []
},
{
"from": "playing",
"to": "complete",
"event": "COMPLETE",
"effects": [
[
"render-ui",
"main",
{
"type": "game-over-screen",
"title": "Well Done!",
"menuItems": [
{
"label": "Play Again",
"event": "RESTART",
"variant": "primary"
}
]
}
]
]
},
{
"from": "complete",
"to": "menu",
"event": "RESTART",
"effects": [
[
"render-ui",
"main",
{
"type": "game-menu",
"title": "Sequencer",
"menuItems": [
{
"label": "Start",
"event": "START",
"variant": "primary"
}
]
}
]
]
}
]
}
}
],
"pages": [
{
"name": "SequencerGamePage",
"path": "/sequencergames",
"traits": [
{
"ref": "SequencerGameSequencerGame"
}
]
}
]
}
],
"description": "Educational game molecule: menu -> playing -> complete. Uses the `sequencer-board` pattern for the playing state."
}
Loading preview...

Orbital Visualization

Loading visualization...

Entity Fields

FieldTypeDefault
idstring-
namestring-
descriptionstring-
statusstring"active"
createdAtstring-
scorenumber0
levelnumber1

States

StateType
menuInitial
playing-
complete-

Events

EventPayload
INIT-
START-
COMPLETE-
RESTART-
NAVIGATE-

Transitions

FromEventToEffects
menuINITmenu2 effects
menuSTARTplaying1 effect
menuNAVIGATEmenu-
playingCOMPLETEcomplete1 effect
completeRESTARTmenu1 effect