@pix3/cli 1.6.4 → 2.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -201
- package/README.md +722 -788
- package/dist/index.js +557 -421
- package/dist/runtime-types.json +1 -1
- package/dist/smoke/prebuilt/{build-7MIXIMSZ.mjs → build-7REMSA2S.mjs} +52 -52
- package/dist/smoke/prebuilt/chunk-4DGG2BKR.mjs +2 -0
- package/dist/smoke/prebuilt/chunk-YLBMUJ2H.mjs +238 -0
- package/dist/smoke/prebuilt/runtime.mjs +1 -1
- package/dist/smoke/prebuilt/smoke-worker.mjs +211 -2
- package/dist/smoke/prebuilt/tree-defaults.mjs +1 -1
- package/dist/validate/prebuilt/{build-AUGKXER3.js → build-ADF5EEE2.js} +52 -52
- package/dist/validate/prebuilt/bundle-main.js +223 -18
- package/dist/validate/prebuilt/chunk-VIHIF4G2.js +238 -0
- package/dist/validate/prebuilt/runtime.js +1 -1
- package/kit/files/.claude/skills/pix3-editor/SKILL.md +200 -0
- package/kit/files/.claude/skills/pix3-nodes/SKILL.md +13 -15
- package/kit/files/.claude/skills/pix3-nodes/reference.md +77 -71
- package/kit/files/.claude/skills/pix3-scene-format/SKILL.md +38 -41
- package/kit/files/.claude/skills/pix3-scene-format/pix3anim.md +185 -0
- package/kit/files/.claude/skills/pix3-scene-format/project-files.md +244 -0
- package/kit/files/.claude/skills/pix3-scene-format/reference.md +28 -16
- package/kit/files/.claude/skills/pix3-scripts/SKILL.md +34 -24
- package/kit/files/.claude/skills/pix3-scripts/reference.md +68 -141
- package/kit/files/.claude/skills/pix3-verify/SKILL.md +65 -326
- package/kit/files/.claude/skills/pix3-verify/reference.md +2 -14
- package/kit/files/AGENTS.md +76 -84
- package/kit/files/design/tests/bots/pix3-test-bot.d.ts +89 -0
- package/kit/kit.json +8 -5
- package/package.json +62 -54
- package/templates/2d/files/scenes/main.pix3scene +31 -0
- package/templates/2d/template.yaml +11 -0
- package/templates/3d/files/scenes/main.pix3scene +50 -0
- package/templates/3d/template.yaml +11 -0
- package/templates/base/files/README.md +39 -0
- package/templates/base/files/gitignore +11 -0
- package/templates/base/files/index.html +23 -0
- package/templates/base/files/package.json +28 -0
- package/templates/base/files/src/main.ts +3 -0
- package/templates/base/files/tsconfig.json +17 -0
- package/templates/base/files/vite.config.ts +10 -0
- package/dist/smoke/prebuilt/chunk-CBFYKDS7.mjs +0 -2
- package/dist/smoke/prebuilt/chunk-VJHJ5BCO.mjs +0 -239
- package/dist/validate/prebuilt/chunk-CFQFEI52.js +0 -239
- package/templates/empty-2d/files/README.md +0 -20
- package/templates/empty-2d/files/scenes/main.pix3scene +0 -68
- package/templates/empty-2d/files/sprites/pix3-logo.png +0 -0
- package/templates/empty-2d/template.yaml +0 -7
- package/templates/empty-3d/files/README.md +0 -20
- package/templates/empty-3d/files/scenes/main.pix3scene +0 -108
- package/templates/empty-3d/files/sprites/pix3-logo.png +0 -0
- package/templates/empty-3d/template.yaml +0 -7
- package/templates/idea-blank/files/README.md +0 -22
- package/templates/idea-blank/files/scenes/main.pix3scene +0 -37
- package/templates/idea-blank/template.yaml +0 -10
- package/templates/minigame-2d/files/README.md +0 -44
- package/templates/minigame-2d/files/design/tests/reachability.json +0 -1
- package/templates/minigame-2d/files/design/tests/routines/mute-music.json +0 -44
- package/templates/minigame-2d/files/scenes/main.pix3scene +0 -84
- package/templates/minigame-2d/files/scenes/menu.pix3scene +0 -118
- package/templates/minigame-2d/files/scenes/ui/settings-window.pix3scene +0 -138
- package/templates/minigame-2d/files/scripts/GameFlow.ts +0 -133
- package/templates/minigame-2d/files/scripts/MenuFlow.ts +0 -217
- package/templates/minigame-2d/files/scripts/SettingsWindow.ts +0 -198
- package/templates/minigame-2d/template.yaml +0 -10
- package/templates/playable-2d/files/README.md +0 -30
- package/templates/playable-2d/files/design/recipe.md +0 -83
- package/templates/playable-2d/files/design/tests/reachability.json +0 -4
- package/templates/playable-2d/files/design/tests/routines/intro-to-cta.json +0 -32
- package/templates/playable-2d/files/scenes/main.pix3scene +0 -111
- package/templates/playable-2d/files/scenes/ui/end-screen.pix3scene +0 -91
- package/templates/playable-2d/files/scenes/ui/intro.pix3scene +0 -65
- package/templates/playable-2d/files/scripts/CtaButton.ts +0 -55
- package/templates/playable-2d/files/scripts/GameFlow.ts +0 -256
- package/templates/playable-2d/files/sprites/pix3-logo.png +0 -0
- package/templates/playable-2d/template.yaml +0 -9
- package/templates/playable-3d/files/README.md +0 -32
- package/templates/playable-3d/files/design/recipe.md +0 -127
- package/templates/playable-3d/files/design/tests/reachability.json +0 -4
- package/templates/playable-3d/files/design/tests/routines/intro-to-cta.json +0 -32
- package/templates/playable-3d/files/scenes/main.pix3scene +0 -230
- package/templates/playable-3d/files/scenes/ui/end-screen.pix3scene +0 -91
- package/templates/playable-3d/files/scenes/ui/intro.pix3scene +0 -65
- package/templates/playable-3d/files/scripts/CtaButton.ts +0 -55
- package/templates/playable-3d/files/scripts/GameFlow.ts +0 -309
- package/templates/playable-3d/files/scripts/GameRules.ts +0 -290
- package/templates/playable-3d/files/scripts/ScoreHud.ts +0 -113
- package/templates/playable-3d/template.yaml +0 -9
- package/templates/recipe-arena-2d/files/README.md +0 -48
- package/templates/recipe-arena-2d/files/design/recipe.md +0 -127
- package/templates/recipe-arena-2d/files/design/tests/reachability.json +0 -4
- package/templates/recipe-arena-2d/files/design/tests/routines/terminal-retry.json +0 -23
- package/templates/recipe-arena-2d/files/scenes/main.pix3scene +0 -292
- package/templates/recipe-arena-2d/files/scenes/menu.pix3scene +0 -100
- package/templates/recipe-arena-2d/files/scenes/prefabs/hazard.pix3scene +0 -42
- package/templates/recipe-arena-2d/files/scenes/prefabs/pickup.pix3scene +0 -45
- package/templates/recipe-arena-2d/files/scenes/ui/result.pix3scene +0 -85
- package/templates/recipe-arena-2d/files/scripts/GameRules.ts +0 -368
- package/templates/recipe-arena-2d/files/scripts/MenuFlow.ts +0 -106
- package/templates/recipe-arena-2d/files/scripts/PlayerController.ts +0 -151
- package/templates/recipe-arena-2d/files/scripts/ScoreHud.ts +0 -94
- package/templates/recipe-arena-2d/files/scripts/Spawner.ts +0 -214
- package/templates/recipe-arena-2d/files/scripts/TouchRules.ts +0 -174
- package/templates/recipe-arena-2d/files/sprites/ph-avatar.png +0 -0
- package/templates/recipe-arena-2d/files/sprites/ph-hazard.png +0 -0
- package/templates/recipe-arena-2d/files/sprites/ph-pickup.png +0 -0
- package/templates/recipe-arena-2d/template.yaml +0 -10
- package/templates/recipe-blank-2d/files/README.md +0 -61
- package/templates/recipe-blank-2d/files/design/recipe.md +0 -148
- package/templates/recipe-blank-2d/files/design/tests/reachability.json +0 -4
- package/templates/recipe-blank-2d/files/design/tests/routines/restart.json +0 -27
- package/templates/recipe-blank-2d/files/design/tests/routines/terminal-retry.json +0 -23
- package/templates/recipe-blank-2d/files/scenes/main.pix3scene +0 -224
- package/templates/recipe-blank-2d/files/scenes/ui/result.pix3scene +0 -85
- package/templates/recipe-blank-2d/files/scripts/GameRules.ts +0 -350
- package/templates/recipe-blank-2d/files/scripts/ScoreHud.ts +0 -110
- package/templates/recipe-blank-2d/files/sprites/ph-bg.png +0 -0
- package/templates/recipe-blank-2d/files/sprites/ph-capsule.png +0 -0
- package/templates/recipe-blank-2d/files/sprites/ph-circle.png +0 -0
- package/templates/recipe-blank-2d/files/sprites/ph-orb.png +0 -0
- package/templates/recipe-blank-2d/files/sprites/ph-ring.png +0 -0
- package/templates/recipe-blank-2d/files/sprites/ph-star.png +0 -0
- package/templates/recipe-blank-2d/template.yaml +0 -10
- package/templates/recipe-bouncer-2d/files/README.md +0 -81
- package/templates/recipe-bouncer-2d/files/design/recipe.md +0 -146
- package/templates/recipe-bouncer-2d/files/design/tests/reachability.json +0 -4
- package/templates/recipe-bouncer-2d/files/design/tests/routines/terminal-retry.json +0 -23
- package/templates/recipe-bouncer-2d/files/scenes/main.pix3scene +0 -615
- package/templates/recipe-bouncer-2d/files/scenes/menu.pix3scene +0 -191
- package/templates/recipe-bouncer-2d/files/scenes/ui/result.pix3scene +0 -87
- package/templates/recipe-bouncer-2d/files/scripts/BallBody.ts +0 -298
- package/templates/recipe-bouncer-2d/files/scripts/GameRules.ts +0 -377
- package/templates/recipe-bouncer-2d/files/scripts/MenuFlow.ts +0 -109
- package/templates/recipe-bouncer-2d/files/scripts/PaddleController.ts +0 -112
- package/templates/recipe-bouncer-2d/files/scripts/ScoreHud.ts +0 -94
- package/templates/recipe-bouncer-2d/files/scripts/TouchRules.ts +0 -263
- package/templates/recipe-bouncer-2d/files/scripts/ball-collision.ts +0 -307
- package/templates/recipe-bouncer-2d/files/sprites/ph-ball.png +0 -0
- package/templates/recipe-bouncer-2d/files/sprites/ph-bg.png +0 -0
- package/templates/recipe-bouncer-2d/files/sprites/ph-bumper.png +0 -0
- package/templates/recipe-bouncer-2d/files/sprites/ph-paddle.png +0 -0
- package/templates/recipe-bouncer-2d/template.yaml +0 -10
- package/templates/recipe-grid-3d/files/README.md +0 -22
- package/templates/recipe-grid-3d/files/design/recipe.md +0 -110
- package/templates/recipe-grid-3d/files/scenes/main.pix3scene +0 -169
- package/templates/recipe-grid-3d/files/scenes/menu.pix3scene +0 -100
- package/templates/recipe-grid-3d/files/scenes/ui/result.pix3scene +0 -105
- package/templates/recipe-grid-3d/files/scripts/GridBoard.ts +0 -319
- package/templates/recipe-grid-3d/files/scripts/GridRules.ts +0 -278
- package/templates/recipe-grid-3d/files/scripts/MenuFlow.ts +0 -106
- package/templates/recipe-grid-3d/files/scripts/ScoreHud.ts +0 -94
- package/templates/recipe-grid-3d/template.yaml +0 -10
- package/templates/recipe-tapper-2d/files/README.md +0 -39
- package/templates/recipe-tapper-2d/files/design/recipe.md +0 -132
- package/templates/recipe-tapper-2d/files/design/tests/reachability.json +0 -4
- package/templates/recipe-tapper-2d/files/design/tests/routines/terminal-retry.json +0 -23
- package/templates/recipe-tapper-2d/files/scenes/main.pix3scene +0 -269
- package/templates/recipe-tapper-2d/files/scenes/menu.pix3scene +0 -100
- package/templates/recipe-tapper-2d/files/scenes/prefabs/hazard.pix3scene +0 -42
- package/templates/recipe-tapper-2d/files/scenes/prefabs/target.pix3scene +0 -45
- package/templates/recipe-tapper-2d/files/scenes/ui/result.pix3scene +0 -85
- package/templates/recipe-tapper-2d/files/scripts/GameRules.ts +0 -368
- package/templates/recipe-tapper-2d/files/scripts/MenuFlow.ts +0 -106
- package/templates/recipe-tapper-2d/files/scripts/ScoreHud.ts +0 -94
- package/templates/recipe-tapper-2d/files/scripts/Spawner.ts +0 -214
- package/templates/recipe-tapper-2d/files/scripts/TouchRules.ts +0 -192
- package/templates/recipe-tapper-2d/files/sprites/ph-hazard.png +0 -0
- package/templates/recipe-tapper-2d/files/sprites/ph-target.png +0 -0
- package/templates/recipe-tapper-2d/template.yaml +0 -10
|
@@ -1,230 +0,0 @@
|
|
|
1
|
-
# Pix3 Scene File (YAML)
|
|
2
|
-
# Playable 3D blank (portrait 1080x1920): 3D gameplay placeholder plus a 2D UI
|
|
3
|
-
# layer with a tap-to-start intro overlay, a score/lives/time HUD, and an end
|
|
4
|
-
# screen with a CTA button. `hud-root` carries all three components: GameFlow
|
|
5
|
-
# (phases), GameRules (score/lives/win-lose) and ScoreHud (display only).
|
|
6
|
-
#
|
|
7
|
-
# Full-screen UI lives in its own file under scenes/ui/ and is instanced into
|
|
8
|
-
# `hud-root` hidden (`visible: false` = editor only; `initiallyVisible` in the
|
|
9
|
-
# overlay file is what play mode reads), so opening this scene shows the stage
|
|
10
|
-
# rather than a dim or a CTA card:
|
|
11
|
-
# intro-overlay (intro-dim, intro-label) scenes/ui/intro.pix3scene
|
|
12
|
-
# end-screen (end-dim, end-label, cta-button) scenes/ui/end-screen.pix3scene
|
|
13
|
-
# Instance children keep their ids, so `GameFlow`'s introNode/endNode,
|
|
14
|
-
# `GameRules`' resultLabel and every `findNode` still resolve.
|
|
15
|
-
version: 1.0.0
|
|
16
|
-
metadata:
|
|
17
|
-
author: Pix3 Template
|
|
18
|
-
description: Playable 3D blank with intro overlay and CTA end screen
|
|
19
|
-
root:
|
|
20
|
-
- id: game-root
|
|
21
|
-
type: Node3D
|
|
22
|
-
name: Game Root
|
|
23
|
-
properties:
|
|
24
|
-
transform:
|
|
25
|
-
position: [0, 0, 0]
|
|
26
|
-
rotationEuler: [0, 0, 0]
|
|
27
|
-
scale: [1, 1, 1]
|
|
28
|
-
children:
|
|
29
|
-
- id: main-camera
|
|
30
|
-
type: Camera3D
|
|
31
|
-
name: Main Camera
|
|
32
|
-
properties:
|
|
33
|
-
projection: perspective
|
|
34
|
-
fov: 60
|
|
35
|
-
near: 0.1
|
|
36
|
-
far: 1000
|
|
37
|
-
transform:
|
|
38
|
-
position: [0, 3, 8]
|
|
39
|
-
rotationEuler: [-15, 0, 0]
|
|
40
|
-
scale: [1, 1, 1]
|
|
41
|
-
children: []
|
|
42
|
-
- id: key-light
|
|
43
|
-
type: DirectionalLightNode
|
|
44
|
-
name: Key Light
|
|
45
|
-
properties:
|
|
46
|
-
intensity: 1.2
|
|
47
|
-
color: "#ffffff"
|
|
48
|
-
transform:
|
|
49
|
-
position: [5, 8, 3]
|
|
50
|
-
rotationEuler: [-45, 35, 0]
|
|
51
|
-
scale: [1, 1, 1]
|
|
52
|
-
children: []
|
|
53
|
-
- id: ambient-light
|
|
54
|
-
type: AmbientLightNode
|
|
55
|
-
name: Ambient Light
|
|
56
|
-
properties:
|
|
57
|
-
intensity: 0.5
|
|
58
|
-
color: "#ffffff"
|
|
59
|
-
transform:
|
|
60
|
-
position: [0, 0, 0]
|
|
61
|
-
rotationEuler: [0, 0, 0]
|
|
62
|
-
scale: [1, 1, 1]
|
|
63
|
-
children: []
|
|
64
|
-
- id: ground
|
|
65
|
-
type: GeometryMesh
|
|
66
|
-
name: Ground
|
|
67
|
-
properties:
|
|
68
|
-
geometry: box
|
|
69
|
-
size: [12, 0.2, 12]
|
|
70
|
-
material:
|
|
71
|
-
type: lambert
|
|
72
|
-
color: "#2a2a3e"
|
|
73
|
-
transform:
|
|
74
|
-
position: [0, -0.1, 0]
|
|
75
|
-
rotationEuler: [0, 0, 0]
|
|
76
|
-
scale: [1, 1, 1]
|
|
77
|
-
children: []
|
|
78
|
-
- id: hero-box
|
|
79
|
-
type: GeometryMesh
|
|
80
|
-
name: Hero Box
|
|
81
|
-
properties:
|
|
82
|
-
geometry: box
|
|
83
|
-
size: [1, 1, 1]
|
|
84
|
-
material:
|
|
85
|
-
type: lambert
|
|
86
|
-
color: "#ffcf33"
|
|
87
|
-
transform:
|
|
88
|
-
position: [0, 0.5, 0]
|
|
89
|
-
rotationEuler: [0, 45, 0]
|
|
90
|
-
scale: [1, 1, 1]
|
|
91
|
-
components:
|
|
92
|
-
- id: hero-rotate
|
|
93
|
-
type: core:Rotate
|
|
94
|
-
enabled: true
|
|
95
|
-
config: {}
|
|
96
|
-
children: []
|
|
97
|
-
|
|
98
|
-
- id: hud-root
|
|
99
|
-
type: Group2D
|
|
100
|
-
name: HUD Root
|
|
101
|
-
properties:
|
|
102
|
-
width: 1080
|
|
103
|
-
height: 1920
|
|
104
|
-
layout:
|
|
105
|
-
enabled: true
|
|
106
|
-
horizontalAlign: stretch
|
|
107
|
-
verticalAlign: stretch
|
|
108
|
-
components:
|
|
109
|
-
- id: game-flow
|
|
110
|
-
type: user:GameFlow
|
|
111
|
-
enabled: true
|
|
112
|
-
config:
|
|
113
|
-
introNode: intro-overlay
|
|
114
|
-
endNode: end-screen
|
|
115
|
-
autoWinAfterSec: 15
|
|
116
|
-
skipIntro: false
|
|
117
|
-
- id: game-rules
|
|
118
|
-
type: user:GameRules
|
|
119
|
-
enabled: true
|
|
120
|
-
config:
|
|
121
|
-
winMode: score
|
|
122
|
-
targetScore: 10
|
|
123
|
-
timeLimitSec: 0
|
|
124
|
-
startingLives: 3
|
|
125
|
-
resultLabel: end-label
|
|
126
|
-
winText: "YOU WIN!"
|
|
127
|
-
loseText: "GAME OVER"
|
|
128
|
-
# The run starts when GameFlow leaves the tap gate, not when the scene loads.
|
|
129
|
-
startWithFlow: true
|
|
130
|
-
- id: score-hud
|
|
131
|
-
type: user:ScoreHud
|
|
132
|
-
enabled: true
|
|
133
|
-
config:
|
|
134
|
-
sourceNode: hud-root
|
|
135
|
-
scoreLabel: score-label
|
|
136
|
-
scoreFormat: "SCORE {value}"
|
|
137
|
-
timeLabel: time-label
|
|
138
|
-
timeFormat: "{value}"
|
|
139
|
-
livesBar: lives-bar
|
|
140
|
-
children:
|
|
141
|
-
- id: hud-label
|
|
142
|
-
type: Label2D
|
|
143
|
-
name: HUD Label
|
|
144
|
-
properties:
|
|
145
|
-
label: "PROTOTYPE"
|
|
146
|
-
labelFontSize: 40
|
|
147
|
-
labelColor: "#ffffff"
|
|
148
|
-
labelAlign: center
|
|
149
|
-
transform:
|
|
150
|
-
position: [0, 780]
|
|
151
|
-
scale: [1, 1]
|
|
152
|
-
rotation: 0
|
|
153
|
-
layout:
|
|
154
|
-
enabled: true
|
|
155
|
-
horizontalAlign: center
|
|
156
|
-
verticalAlign: top
|
|
157
|
-
children: []
|
|
158
|
-
- id: score-label
|
|
159
|
-
type: Label2D
|
|
160
|
-
name: Score Label
|
|
161
|
-
properties:
|
|
162
|
-
label: "SCORE 0"
|
|
163
|
-
labelFontSize: 44
|
|
164
|
-
labelColor: "#ffffff"
|
|
165
|
-
labelAlign: left
|
|
166
|
-
transform:
|
|
167
|
-
position: [-340, 880]
|
|
168
|
-
scale: [1, 1]
|
|
169
|
-
rotation: 0
|
|
170
|
-
layout:
|
|
171
|
-
enabled: true
|
|
172
|
-
horizontalAlign: left
|
|
173
|
-
verticalAlign: top
|
|
174
|
-
children: []
|
|
175
|
-
- id: time-label
|
|
176
|
-
type: Label2D
|
|
177
|
-
name: Time Label
|
|
178
|
-
properties:
|
|
179
|
-
label: "0"
|
|
180
|
-
labelFontSize: 44
|
|
181
|
-
labelColor: "#f5ae39"
|
|
182
|
-
labelAlign: center
|
|
183
|
-
transform:
|
|
184
|
-
position: [0, 880]
|
|
185
|
-
scale: [1, 1]
|
|
186
|
-
rotation: 0
|
|
187
|
-
layout:
|
|
188
|
-
enabled: true
|
|
189
|
-
horizontalAlign: center
|
|
190
|
-
verticalAlign: top
|
|
191
|
-
children: []
|
|
192
|
-
- id: lives-bar
|
|
193
|
-
type: Bar2D
|
|
194
|
-
name: Lives Bar
|
|
195
|
-
properties:
|
|
196
|
-
width: 240
|
|
197
|
-
height: 28
|
|
198
|
-
minValue: 0
|
|
199
|
-
maxValue: 3
|
|
200
|
-
value: 3
|
|
201
|
-
barColor: "#ff4d6d"
|
|
202
|
-
backBackgroundColor: "#2a3352"
|
|
203
|
-
showBorder: false
|
|
204
|
-
transform:
|
|
205
|
-
position: [340, 885]
|
|
206
|
-
scale: [1, 1]
|
|
207
|
-
rotation: 0
|
|
208
|
-
layout:
|
|
209
|
-
enabled: true
|
|
210
|
-
horizontalAlign: right
|
|
211
|
-
verticalAlign: top
|
|
212
|
-
children: []
|
|
213
|
-
# Tap gate — authored in scenes/ui/intro.pix3scene so this scene opens on
|
|
214
|
-
# the GAME. `visible: false` hides it in the EDITOR only; `initiallyVisible`
|
|
215
|
-
# (in the overlay file) is what play mode reads. Tick the eye to preview it
|
|
216
|
-
# composited over the stage.
|
|
217
|
-
- id: intro-overlay
|
|
218
|
-
name: Intro Overlay
|
|
219
|
-
instance: res://scenes/ui/intro.pix3scene
|
|
220
|
-
properties:
|
|
221
|
-
visible: false
|
|
222
|
-
# End screen — authored in scenes/ui/end-screen.pix3scene so this scene opens
|
|
223
|
-
# on the GAME. `visible: false` hides it in the EDITOR only; `initiallyVisible`
|
|
224
|
-
# (in the overlay file) is what play mode reads. Tick the eye to preview it
|
|
225
|
-
# composited over the stage.
|
|
226
|
-
- id: end-screen
|
|
227
|
-
name: End Screen
|
|
228
|
-
instance: res://scenes/ui/end-screen.pix3scene
|
|
229
|
-
properties:
|
|
230
|
-
visible: false
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
# Pix3 Scene File (YAML)
|
|
2
|
-
# Playable 3D — the END screen (result + CTA), in its own file so the game
|
|
3
|
-
# scene opens clean. `main.pix3scene` carries it as a one-line `instance:`
|
|
4
|
-
# reference marked `visible: false`, which hides it in the EDITOR only;
|
|
5
|
-
# `initiallyVisible: false` below is what play mode reads, and `user:GameFlow`
|
|
6
|
-
# reveals it on `finish()`.
|
|
7
|
-
#
|
|
8
|
-
# Edit it here, full-screen, in its own tab. To preview it composited over the
|
|
9
|
-
# game, tick the eye on `end-screen` in main.pix3scene — just do not commit
|
|
10
|
-
# that tick, or every iteration starts behind a CTA card again.
|
|
11
|
-
#
|
|
12
|
-
# Stable node ids (design/recipe.md is the contract — do not rename these):
|
|
13
|
-
# end-screen, end-dim, end-label, cta-button
|
|
14
|
-
version: 1.0.0
|
|
15
|
-
metadata:
|
|
16
|
-
author: Pix3 Template
|
|
17
|
-
description: End screen — dim, result headline and a PLAY NOW CTA button
|
|
18
|
-
root:
|
|
19
|
-
- id: end-screen
|
|
20
|
-
type: Group2D
|
|
21
|
-
name: End Screen
|
|
22
|
-
properties:
|
|
23
|
-
width: 1080
|
|
24
|
-
height: 1920
|
|
25
|
-
initiallyVisible: false
|
|
26
|
-
layout:
|
|
27
|
-
enabled: true
|
|
28
|
-
horizontalAlign: stretch
|
|
29
|
-
verticalAlign: stretch
|
|
30
|
-
children:
|
|
31
|
-
- id: end-dim
|
|
32
|
-
type: ColorRect2D
|
|
33
|
-
name: End Dim
|
|
34
|
-
properties:
|
|
35
|
-
width: 1080
|
|
36
|
-
height: 1920
|
|
37
|
-
color: "#000000"
|
|
38
|
-
opacity: 0.75
|
|
39
|
-
transform:
|
|
40
|
-
position: [0, 0]
|
|
41
|
-
scale: [1, 1]
|
|
42
|
-
rotation: 0
|
|
43
|
-
layout:
|
|
44
|
-
enabled: true
|
|
45
|
-
horizontalAlign: stretch
|
|
46
|
-
verticalAlign: stretch
|
|
47
|
-
children: []
|
|
48
|
-
- id: end-label
|
|
49
|
-
type: Label2D
|
|
50
|
-
name: End Label
|
|
51
|
-
properties:
|
|
52
|
-
label: "GREAT RUN!"
|
|
53
|
-
labelFontSize: 84
|
|
54
|
-
labelColor: "#ffcf33"
|
|
55
|
-
labelAlign: center
|
|
56
|
-
transform:
|
|
57
|
-
position: [0, 220]
|
|
58
|
-
scale: [1, 1]
|
|
59
|
-
rotation: 0
|
|
60
|
-
layout:
|
|
61
|
-
enabled: true
|
|
62
|
-
horizontalAlign: center
|
|
63
|
-
verticalAlign: center
|
|
64
|
-
children: []
|
|
65
|
-
- id: cta-button
|
|
66
|
-
type: Button2D
|
|
67
|
-
name: CTA Button
|
|
68
|
-
properties:
|
|
69
|
-
width: 480
|
|
70
|
-
height: 140
|
|
71
|
-
label: "PLAY NOW"
|
|
72
|
-
labelFontSize: 56
|
|
73
|
-
labelColor: "#1a1a2e"
|
|
74
|
-
backgroundColor: "#ffcf33"
|
|
75
|
-
hoverColor: "#ffe066"
|
|
76
|
-
pressedColor: "#e6b800"
|
|
77
|
-
buttonAction: cta
|
|
78
|
-
transform:
|
|
79
|
-
position: [0, -120]
|
|
80
|
-
scale: [1, 1]
|
|
81
|
-
rotation: 0
|
|
82
|
-
layout:
|
|
83
|
-
enabled: true
|
|
84
|
-
horizontalAlign: center
|
|
85
|
-
verticalAlign: center
|
|
86
|
-
components:
|
|
87
|
-
- id: cta-action
|
|
88
|
-
type: user:CtaButton
|
|
89
|
-
enabled: true
|
|
90
|
-
config: {}
|
|
91
|
-
children: []
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
# Pix3 Scene File (YAML)
|
|
2
|
-
# Playable 3D — the tap-to-start INTRO overlay, in its own file so the
|
|
3
|
-
# game scene opens clean. `main.pix3scene` carries it as a one-line `instance:`
|
|
4
|
-
# reference marked `visible: false`, which hides it in the EDITOR only.
|
|
5
|
-
# `initiallyVisible: true` below is what play mode reads, so the gate is UP at
|
|
6
|
-
# t=0 — in an ad container that first tap is what unlocks browser audio.
|
|
7
|
-
# `user:GameFlow` hides it on the first tap.
|
|
8
|
-
#
|
|
9
|
-
# Edit it here, full-screen, in its own tab. To preview it composited over the
|
|
10
|
-
# game, tick the eye on `intro-overlay` in main.pix3scene — just do not commit
|
|
11
|
-
# that tick, or every iteration starts behind the dim again.
|
|
12
|
-
#
|
|
13
|
-
# Stable node ids (design/recipe.md is the contract — do not rename these):
|
|
14
|
-
# intro-overlay, intro-dim, intro-label
|
|
15
|
-
version: 1.0.0
|
|
16
|
-
metadata:
|
|
17
|
-
author: Pix3 Template
|
|
18
|
-
description: Intro overlay — dim plus a TAP TO START label
|
|
19
|
-
root:
|
|
20
|
-
- id: intro-overlay
|
|
21
|
-
type: Group2D
|
|
22
|
-
name: Intro Overlay
|
|
23
|
-
properties:
|
|
24
|
-
width: 1080
|
|
25
|
-
height: 1920
|
|
26
|
-
initiallyVisible: true
|
|
27
|
-
layout:
|
|
28
|
-
enabled: true
|
|
29
|
-
horizontalAlign: stretch
|
|
30
|
-
verticalAlign: stretch
|
|
31
|
-
children:
|
|
32
|
-
- id: intro-dim
|
|
33
|
-
type: ColorRect2D
|
|
34
|
-
name: Intro Dim
|
|
35
|
-
properties:
|
|
36
|
-
width: 1080
|
|
37
|
-
height: 1920
|
|
38
|
-
color: "#000000"
|
|
39
|
-
opacity: 0.65
|
|
40
|
-
transform:
|
|
41
|
-
position: [0, 0]
|
|
42
|
-
scale: [1, 1]
|
|
43
|
-
rotation: 0
|
|
44
|
-
layout:
|
|
45
|
-
enabled: true
|
|
46
|
-
horizontalAlign: stretch
|
|
47
|
-
verticalAlign: stretch
|
|
48
|
-
children: []
|
|
49
|
-
- id: intro-label
|
|
50
|
-
type: Label2D
|
|
51
|
-
name: Tap To Start
|
|
52
|
-
properties:
|
|
53
|
-
label: "TAP TO START"
|
|
54
|
-
labelFontSize: 72
|
|
55
|
-
labelColor: "#ffffff"
|
|
56
|
-
labelAlign: center
|
|
57
|
-
transform:
|
|
58
|
-
position: [0, 0]
|
|
59
|
-
scale: [1, 1]
|
|
60
|
-
rotation: 0
|
|
61
|
-
layout:
|
|
62
|
-
enabled: true
|
|
63
|
-
horizontalAlign: center
|
|
64
|
-
verticalAlign: center
|
|
65
|
-
children: []
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CtaButton — the playable's call-to-action. Attach to a Button2D; on press it
|
|
3
|
-
* reports game end and logs the click. It deliberately does NOT open a store
|
|
4
|
-
* page: which URL a playable opens (and whether it opens one at all) is decided
|
|
5
|
-
* by the ad network at delivery time via `mraid.open` / `dapi.openStoreUrl`, so
|
|
6
|
-
* a hardcoded store URL in a template is a wrong default that ships a real
|
|
7
|
-
* navigation out of the game on every tap. Wire the network SDK here when you
|
|
8
|
-
* package the ad; until then the log is the whole contract.
|
|
9
|
-
*
|
|
10
|
-
* The press handler does nothing itself: it dispatches the named command
|
|
11
|
-
* `cta-click`, whose handler is the intent method `ctaClick()`. Keep that shape
|
|
12
|
-
* as you add buttons — a game whose reactions are named intents can be driven
|
|
13
|
-
* and tested by `scene.commands.dispatch(...)` rather than by simulated taps,
|
|
14
|
-
* the wiring survives any relayout of the UI, and one real tap is enough to
|
|
15
|
-
* prove the button still raises the intent it claims.
|
|
16
|
-
*/
|
|
17
|
-
import { Script, playable } from '@pix3/runtime';
|
|
18
|
-
import type { NodeBase } from '@pix3/runtime';
|
|
19
|
-
|
|
20
|
-
export class CtaButton extends Script {
|
|
21
|
-
private disposeCommands: (() => void)[] = [];
|
|
22
|
-
|
|
23
|
-
onAttach(node: NodeBase): void {
|
|
24
|
-
node.connect('pressed', this, this.handlePressed);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
onStart(): void {
|
|
28
|
-
// Registered here rather than in onAttach: `scene` is injected once the
|
|
29
|
-
// graph is built, which is after components are attached during load.
|
|
30
|
-
const commands = this.scene?.commands;
|
|
31
|
-
this.disposeCommands = [
|
|
32
|
-
commands?.register('cta-click', () => this.ctaClick(), {
|
|
33
|
-
description: 'Accept the call to action: end the session and report the CTA click.',
|
|
34
|
-
}),
|
|
35
|
-
].filter((dispose): dispose is () => void => dispose !== undefined);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
onDetach(): void {
|
|
39
|
-
for (const dispose of this.disposeCommands) {
|
|
40
|
-
dispose();
|
|
41
|
-
}
|
|
42
|
-
this.disposeCommands = [];
|
|
43
|
-
super.onDetach();
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/** Intent: the player accepted the call to action — end the session and report the click. */
|
|
47
|
-
ctaClick(): void {
|
|
48
|
-
playable.gameEnd();
|
|
49
|
-
console.info(`[CtaButton] CTA clicked (${this.node?.name ?? this.node?.id ?? 'unknown node'})`);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
private handlePressed = (): void => {
|
|
53
|
-
this.scene?.commands.dispatch('cta-click');
|
|
54
|
-
};
|
|
55
|
-
}
|