summer-engine 1.0.1 → 1.2.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.
@@ -0,0 +1,441 @@
1
+ ---
2
+ name: make-game
3
+ description: End-to-end game creation workflow. Use when the user wants to build a complete game, start a new project, or says "make me a game". Orchestrates project setup, asset creation, scene building, scripting, and testing.
4
+ license: MIT
5
+ compatibility:
6
+ - Cursor
7
+ - Claude Code
8
+ - Windsurf
9
+ ---
10
+
11
+ # Make a Game with Summer Engine
12
+
13
+ Step-by-step workflow for building a complete game. Follow phases 0-6 in order. Each phase must complete before moving to the next.
14
+
15
+ **Rule**: Scene operations (.tscn) use MCP tools. Script files (.gd) use host file-edit tools (Write/Edit). Never cross the streams.
16
+
17
+ ---
18
+
19
+ ## Phase 0: Gather Requirements
20
+
21
+ Before touching any tools, ask the user:
22
+ 1. **What kind of game?** (platformer, FPS, top-down, puzzle, racing, etc.)
23
+ 2. **2D or 3D?**
24
+ 3. **Art style?** (realistic, low-poly, cartoon, pixel art)
25
+ 4. **Core mechanic?** One sentence. ("player jumps between platforms collecting coins")
26
+ 5. **Scope?** (1 level prototype, or multi-level)
27
+
28
+ Use this decision matrix:
29
+
30
+ | Genre | Root Type | Camera | Player Body | Dimension |
31
+ |-------|-----------|--------|-------------|-----------|
32
+ | FPS | Node3D | Camera3D on player | CharacterBody3D | 3D |
33
+ | Platformer 2D | Node2D | Camera2D following | CharacterBody2D | 2D |
34
+ | Platformer 3D | Node3D | Camera3D following | CharacterBody3D | 3D |
35
+ | Top-down | Node2D | Camera2D | CharacterBody2D | 2D |
36
+ | Puzzle | Node2D or Control | Camera2D or none | varies | 2D |
37
+ | Racing | Node3D | Camera3D behind car | VehicleBody3D | 3D |
38
+
39
+ ---
40
+
41
+ ## Phase 1: Project Bootstrap
42
+
43
+ ### 1a. Get context
44
+
45
+ ```
46
+ summer_get_agent_playbook()
47
+ summer_get_project_context()
48
+ ```
49
+
50
+ If a scene is open: `summer_get_scene_tree()` to see what exists.
51
+
52
+ ### 1b. Configure project
53
+
54
+ ```
55
+ summer_project_setting(key="application/config/name", value="<game name>")
56
+ summer_project_setting(key="display/window/size/viewport_width", value=1280)
57
+ summer_project_setting(key="display/window/size/viewport_height", value=720)
58
+ summer_project_setting(key="application/run/main_scene", value="res://scenes/main_level.tscn")
59
+ ```
60
+
61
+ For 2D pixel art, add:
62
+ ```
63
+ summer_project_setting(key="rendering/textures/canvas_textures/default_texture_filter", value=0)
64
+ ```
65
+
66
+ ### 1c. Create scenes
67
+
68
+ ```
69
+ summer_create_scene(path="res://scenes/main_level.tscn", rootName="World", allow_temporary_scene_mutation=true)
70
+ summer_create_scene(path="res://scenes/player.tscn", rootName="Player", allow_temporary_scene_mutation=true)
71
+ ```
72
+
73
+ ### 1d. Folder conventions
74
+
75
+ - `res://scenes/` -- .tscn files
76
+ - `res://scripts/` -- .gd files
77
+ - `res://assets/models/` -- 3D models
78
+ - `res://assets/textures/` -- images, sprites
79
+ - `res://assets/audio/` -- sounds, music
80
+
81
+ ---
82
+
83
+ ## Phase 2: Asset Pipeline
84
+
85
+ Pick the right strategy per asset. Prefer this order: Library > Generate > Primitives.
86
+
87
+ ### Strategy A: Asset Library (fastest, 25k+ free models)
88
+
89
+ For environment props, furniture, nature, vehicles:
90
+
91
+ ```
92
+ summer_search_assets(query="low-poly tree", assetType="3d_model", limit=5)
93
+ summer_import_asset(query="wooden barrel", parent="./World/Props", assetType="3d_model")
94
+ ```
95
+
96
+ ### Strategy B: AI Generation (custom assets)
97
+
98
+ **Images** (textures, sprites, UI art) -- sync, returns immediately:
99
+ ```
100
+ summer_generate_image(prompt="top-down grass tileset, seamless, 512x512", style="cartoon")
101
+ ```
102
+ Returns `localPath` -- use Read tool to show the user for approval.
103
+ Then import:
104
+ ```
105
+ summer_import_from_url(url="<asset.fileUrl>", path="res://assets/textures/grass.png")
106
+ ```
107
+
108
+ **3D models** -- async, waits up to 5 min by default:
109
+ ```
110
+ summer_generate_3d(prompt="low-poly treasure chest with gold coins", kind="text-to-3d")
111
+ ```
112
+ Returns completed result directly. Then import the model URL.
113
+
114
+ **Image-to-3D** -- generate concept art first, then convert:
115
+ ```
116
+ summer_generate_image(prompt="medieval sword, ornate handle, game asset, white background")
117
+ # Show to user, get approval
118
+ summer_generate_3d(kind="image-to-3d", imageUrl="<asset.fileUrl>")
119
+ ```
120
+
121
+ **Audio** -- sync:
122
+ ```
123
+ summer_generate_audio(capability="sound_effects", text="sword swing whoosh")
124
+ summer_generate_audio(capability="music", prompt="upbeat adventure theme", durationSeconds=30)
125
+ summer_generate_audio(capability="text_to_speech", text="Welcome, adventurer!", voiceId="<id>")
126
+ ```
127
+
128
+ **Parallel generation**: Start multiple 3D jobs with `wait=false`, work on scene setup, then check later:
129
+ ```
130
+ summer_generate_3d(prompt="...", wait=false) -> jobId: "abc"
131
+ summer_generate_3d(prompt="...", wait=false) -> jobId: "def"
132
+ # ... do scene work ...
133
+ summer_check_job(jobId="abc")
134
+ summer_check_job(jobId="def")
135
+ ```
136
+
137
+ ### Strategy C: Primitive Meshes (instant, offline)
138
+
139
+ For prototyping or blocking out levels:
140
+ ```
141
+ summer_add_node(parent="./World", type="MeshInstance3D", name="Floor")
142
+ summer_set_prop(path="./World/Floor", key="mesh", value="BoxMesh")
143
+ summer_set_resource_property(nodePath="./World/Floor", resourceProperty="mesh", subProperty="size", value="Vector3(20, 0.2, 20)")
144
+ ```
145
+
146
+ ---
147
+
148
+ ## Phase 3: Scene Construction
149
+
150
+ ### 3a. Build environment with batch
151
+
152
+ Use `summer_batch` for multi-step setup in one undo step:
153
+
154
+ ```
155
+ summer_batch(ops=[
156
+ {"op":"AddNode","parent":"./","type":"Node3D","name":"Level"},
157
+ {"op":"AddNode","parent":"./Level","type":"MeshInstance3D","name":"Ground"},
158
+ {"op":"SetProp","path":"./Level/Ground","key":"mesh","value":"PlaneMesh"},
159
+ {"op":"SetResourceProperty","nodePath":"./Level/Ground","resourceProperty":"mesh","subProperty":"size","value":"Vector2(50,50)"},
160
+ {"op":"AddNode","parent":"./","type":"DirectionalLight3D","name":"Sun"},
161
+ {"op":"SetProp","path":"./Sun","key":"rotation_degrees","value":"Vector3(-45,30,0)"},
162
+ {"op":"SetProp","path":"./Sun","key":"shadow_enabled","value":"true"},
163
+ {"op":"AddNode","parent":"./","type":"WorldEnvironment","name":"Env"}
164
+ ])
165
+ ```
166
+
167
+ ### 3b. Build player
168
+
169
+ **3D FPS/Third-person:**
170
+ ```
171
+ summer_open_scene(path="res://scenes/player.tscn")
172
+ summer_batch(ops=[
173
+ {"op":"AddNode","parent":"./","type":"CollisionShape3D","name":"Collision"},
174
+ {"op":"SetProp","path":"./Collision","key":"shape","value":"CapsuleShape3D"},
175
+ {"op":"AddNode","parent":"./","type":"Camera3D","name":"Camera"},
176
+ {"op":"SetProp","path":"./Camera","key":"position","value":"Vector3(0,1.6,0)"}
177
+ ])
178
+ ```
179
+
180
+ **2D Platformer:**
181
+ ```
182
+ summer_open_scene(path="res://scenes/player.tscn")
183
+ summer_batch(ops=[
184
+ {"op":"AddNode","parent":"./","type":"CollisionShape2D","name":"Collision"},
185
+ {"op":"SetProp","path":"./Collision","key":"shape","value":"RectangleShape2D"},
186
+ {"op":"AddNode","parent":"./","type":"Sprite2D","name":"Sprite"},
187
+ {"op":"AddNode","parent":"./","type":"Camera2D","name":"Camera"}
188
+ ])
189
+ ```
190
+
191
+ ### 3c. Input bindings
192
+
193
+ ```
194
+ summer_input_map_bind(name="move_forward", events=[{"type":"key","key":"W"}])
195
+ summer_input_map_bind(name="move_back", events=[{"type":"key","key":"S"}])
196
+ summer_input_map_bind(name="move_left", events=[{"type":"key","key":"A"}])
197
+ summer_input_map_bind(name="move_right", events=[{"type":"key","key":"D"}])
198
+ summer_input_map_bind(name="jump", events=[{"type":"key","key":"Space"}])
199
+ summer_input_map_bind(name="interact", events=[{"type":"key","key":"E"}])
200
+ ```
201
+
202
+ ### 3d. Place assets in scene
203
+
204
+ ```
205
+ summer_open_scene(path="res://scenes/main_level.tscn")
206
+ summer_instantiate_scene(parent="./Level", scene="res://scenes/player.tscn", name="Player")
207
+ summer_instantiate_scene(parent="./Level", scene="res://assets/models/tree.glb", name="Tree1")
208
+ summer_set_prop(path="./Level/Tree1", key="position", value="Vector3(5, 0, 3)")
209
+ ```
210
+
211
+ ### 3e. Save
212
+
213
+ ```
214
+ summer_save_scene()
215
+ ```
216
+
217
+ ---
218
+
219
+ ## Phase 4: Scripting
220
+
221
+ **Write .gd files with host file-edit tools (Write/Edit). Attach via MCP.**
222
+
223
+ Workflow:
224
+ 1. Write the script file to disk
225
+ 2. Attach: `summer_set_prop(path="./Player", key="script", value="res://scripts/player.gd")`
226
+ 3. Check: `summer_get_script_errors(path="res://scripts/player.gd")`
227
+ 4. Wire signals: `summer_connect_signal(emitter="./Coin", signal="body_entered", receiver="./Coin", method="_on_body_entered")`
228
+
229
+ ### 3D Player Controller (FPS)
230
+
231
+ Write to `res://scripts/player.gd`:
232
+
233
+ ```gdscript
234
+ extends CharacterBody3D
235
+
236
+ @export var speed: float = 5.0
237
+ @export var jump_velocity: float = 4.5
238
+ @export var mouse_sensitivity: float = 0.002
239
+
240
+ var gravity: float = ProjectSettings.get_setting("physics/3d/default_gravity")
241
+
242
+ func _ready() -> void:
243
+ Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
244
+
245
+ func _unhandled_input(event: InputEvent) -> void:
246
+ if event is InputEventMouseMotion:
247
+ rotate_y(-event.relative.x * mouse_sensitivity)
248
+ $Camera.rotate_x(-event.relative.y * mouse_sensitivity)
249
+ $Camera.rotation.x = clampf($Camera.rotation.x, -PI/2, PI/2)
250
+ if event.is_action_pressed("ui_cancel"):
251
+ Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
252
+
253
+ func _physics_process(delta: float) -> void:
254
+ if not is_on_floor():
255
+ velocity.y -= gravity * delta
256
+
257
+ if Input.is_action_just_pressed("jump") and is_on_floor():
258
+ velocity.y = jump_velocity
259
+
260
+ var input_dir := Input.get_vector("move_left", "move_right", "move_forward", "move_back")
261
+ var direction := (transform.basis * Vector3(input_dir.x, 0, input_dir.y)).normalized()
262
+
263
+ if direction:
264
+ velocity.x = direction.x * speed
265
+ velocity.z = direction.z * speed
266
+ else:
267
+ velocity.x = move_toward(velocity.x, 0, speed)
268
+ velocity.z = move_toward(velocity.z, 0, speed)
269
+
270
+ move_and_slide()
271
+ ```
272
+
273
+ ### 2D Platformer Controller
274
+
275
+ Write to `res://scripts/player.gd`:
276
+
277
+ ```gdscript
278
+ extends CharacterBody2D
279
+
280
+ @export var speed: float = 200.0
281
+ @export var jump_velocity: float = -350.0
282
+
283
+ var gravity: float = ProjectSettings.get_setting("physics/2d/default_gravity")
284
+
285
+ func _physics_process(delta: float) -> void:
286
+ if not is_on_floor():
287
+ velocity.y += gravity * delta
288
+
289
+ if Input.is_action_just_pressed("jump") and is_on_floor():
290
+ velocity.y = jump_velocity
291
+
292
+ var direction := Input.get_axis("move_left", "move_right")
293
+ velocity.x = direction * speed if direction else move_toward(velocity.x, 0, speed)
294
+
295
+ move_and_slide()
296
+ ```
297
+
298
+ ### Collectible Pickup
299
+
300
+ Write to `res://scripts/collectible.gd`:
301
+
302
+ ```gdscript
303
+ extends Area3D
304
+
305
+ signal collected
306
+
307
+ func _ready() -> void:
308
+ body_entered.connect(_on_body_entered)
309
+
310
+ func _on_body_entered(body: Node3D) -> void:
311
+ if body.is_in_group("player"):
312
+ collected.emit()
313
+ queue_free()
314
+ ```
315
+
316
+ ### Simple Enemy Patrol
317
+
318
+ Write to `res://scripts/enemy_patrol.gd`:
319
+
320
+ ```gdscript
321
+ extends CharacterBody3D
322
+
323
+ @export var speed: float = 2.0
324
+ @export var patrol_distance: float = 5.0
325
+
326
+ var start_pos: Vector3
327
+ var direction: float = 1.0
328
+ var gravity: float = ProjectSettings.get_setting("physics/3d/default_gravity")
329
+
330
+ func _ready() -> void:
331
+ start_pos = global_position
332
+
333
+ func _physics_process(delta: float) -> void:
334
+ if not is_on_floor():
335
+ velocity.y -= gravity * delta
336
+
337
+ velocity.x = direction * speed
338
+ move_and_slide()
339
+
340
+ if global_position.distance_to(start_pos) > patrol_distance:
341
+ direction *= -1
342
+ ```
343
+
344
+ ---
345
+
346
+ ## Phase 5: Test and Debug
347
+
348
+ ```
349
+ summer_clear_console()
350
+ summer_play()
351
+ ```
352
+
353
+ After a few seconds:
354
+ ```
355
+ summer_get_diagnostics()
356
+ ```
357
+
358
+ If errors:
359
+ ```
360
+ summer_get_console(type="error")
361
+ summer_get_script_errors(path="res://scripts/player.gd")
362
+ ```
363
+
364
+ Fix, then:
365
+ ```
366
+ summer_stop()
367
+ # apply fix
368
+ summer_play()
369
+ ```
370
+
371
+ ### Common errors
372
+
373
+ | Error | Cause | Fix |
374
+ |-------|-------|-----|
375
+ | "Node not found" | Bad $NodePath | Check path with `summer_get_scene_tree()` |
376
+ | "Invalid call" on move_and_slide | Wrong base class | Script must extend CharacterBody3D/2D |
377
+ | Falling through floor | No collision | Add StaticBody3D + CollisionShape3D to ground |
378
+ | "No main scene" | Not configured | `summer_project_setting(key="application/run/main_scene", ...)` |
379
+ | Mouse not captured | Missing in _ready | Add `Input.mouse_mode = Input.MOUSE_MODE_CAPTURED` |
380
+
381
+ ---
382
+
383
+ ## Phase 6: Iterate
384
+
385
+ After first playable, ask the user what to improve. Common next steps:
386
+
387
+ - **More levels**: Create new .tscn, instantiate player, add to scene list
388
+ - **Enemies**: New scene + patrol script + spawn in level
389
+ - **UI/HUD**: Add CanvasLayer + Control nodes (see ui-basics skill)
390
+ - **Sound**: Generate with `summer_generate_audio`, attach AudioStreamPlayer3D
391
+ - **Lighting**: Set up WorldEnvironment + lights (see 3d-lighting skill)
392
+ - **Game states**: Main menu > gameplay > game over flow via SceneTree.change_scene_to_file()
393
+
394
+ ---
395
+
396
+ ## Anti-Patterns
397
+
398
+ - Never write .tscn files with host file tools -- always use MCP scene tools
399
+ - Never guess node paths -- call `summer_get_scene_tree()` first
400
+ - Never edit scenes while game is running -- call `summer_stop()` first
401
+ - Never skip `summer_save_scene()` -- unsaved changes are editor-only
402
+ - Script .gd files must exist on disk BEFORE attaching via `summer_set_prop`
403
+ - `summer_create_scene` requires `allow_temporary_scene_mutation=true`
404
+ - Node paths use `./` prefix. File paths use `res://` prefix. Never mix them.
405
+
406
+ ---
407
+
408
+ ## Tool Quick Reference
409
+
410
+ | Category | Tool | Purpose |
411
+ |----------|------|---------|
412
+ | Setup | `summer_get_agent_playbook` | Safe workflow guide |
413
+ | Setup | `summer_get_project_context` | Project name, paths, status |
414
+ | Setup | `summer_project_setting` | Set project.godot values |
415
+ | Scene | `summer_create_scene` | New scene file |
416
+ | Scene | `summer_open_scene` | Switch to scene |
417
+ | Scene | `summer_get_scene_tree` | Read scene structure |
418
+ | Scene | `summer_save_scene` | Save to disk |
419
+ | Nodes | `summer_add_node` | Add node |
420
+ | Nodes | `summer_set_prop` | Set property |
421
+ | Nodes | `summer_set_resource_property` | Set sub-resource prop |
422
+ | Nodes | `summer_remove_node` | Delete node |
423
+ | Nodes | `summer_instantiate_scene` | Place .tscn/.glb |
424
+ | Nodes | `summer_batch` | Multi-op, one undo |
425
+ | Nodes | `summer_connect_signal` | Wire signals |
426
+ | Nodes | `summer_inspect_node` | Read node details |
427
+ | Input | `summer_input_map_bind` | Bind keys to actions |
428
+ | Assets | `summer_search_assets` | Search 25k+ library |
429
+ | Assets | `summer_import_asset` | Search + import + place |
430
+ | Assets | `summer_import_from_url` | Import from URL |
431
+ | Generate | `summer_generate_image` | AI image gen |
432
+ | Generate | `summer_generate_audio` | AI audio/SFX/music |
433
+ | Generate | `summer_generate_3d` | AI 3D model gen |
434
+ | Generate | `summer_generate_video` | AI video gen |
435
+ | Generate | `summer_check_job` | Poll async jobs |
436
+ | Debug | `summer_play` | Run game |
437
+ | Debug | `summer_stop` | Stop game |
438
+ | Debug | `summer_get_diagnostics` | Error overview |
439
+ | Debug | `summer_get_console` | Read output |
440
+ | Debug | `summer_get_script_errors` | Check .gd compile |
441
+ | Debug | `summer_clear_console` | Clear output |