bmad-method 4.9.0 → 4.9.1
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/CHANGELOG.md +7 -0
- package/bmad-core/tasks/shard-doc.md +1 -1
- package/bmad-core/templates/architecture-tmpl.md +2 -2
- package/bmad-core/templates/brownfield-architecture-tmpl.md +2 -2
- package/bmad-core/templates/front-end-spec-tmpl.md +1 -1
- package/bmad-core/utils/workflow-management.md +5 -5
- package/dist/agents/architect.txt +4 -4
- package/dist/agents/bmad-master.txt +11 -11
- package/dist/agents/bmad-orchestrator.txt +5 -5
- package/dist/agents/dev.txt +9 -17
- package/dist/agents/pm.txt +1 -1
- package/dist/agents/po.txt +1 -1
- package/dist/agents/ux-expert.txt +1 -1
- package/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-designer.txt +144 -18
- package/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-developer.txt +139 -95
- package/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-sm.txt +39 -0
- package/dist/expansion-packs/bmad-2d-phaser-game-dev/teams/phaser-2d-nodejs-game-team.txt +310 -118
- package/dist/expansion-packs/bmad-infrastructure-devops/agents/infra-devops-platform.txt +16 -16
- package/dist/expansion-packs/expansion-creator/agents/bmad-the-creator.txt +25 -27
- package/dist/teams/team-all.txt +20 -28
- package/dist/teams/team-fullstack.txt +11 -11
- package/dist/teams/team-ide-minimal.txt +15 -23
- package/dist/teams/team-no-ui.txt +10 -10
- package/docs/core-architecture.md +5 -3
- package/docs/how-to-contribute-with-pull-requests.md +6 -6
- package/docs/user-guide.md +51 -66
- package/expansion-packs/bmad-2d-phaser-game-dev/data/development-guidelines.md +107 -87
- package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-architecture-tmpl.md +4 -4
- package/expansion-packs/bmad-2d-phaser-game-dev/templates/level-design-doc-tmpl.md +21 -2
- package/expansion-packs/bmad-infrastructure-devops/README.md +5 -5
- package/expansion-packs/bmad-infrastructure-devops/templates/infrastructure-platform-from-arch-tmpl.md +0 -0
- package/expansion-packs/expansion-creator/tasks/create-agent.md +10 -10
- package/expansion-packs/expansion-creator/tasks/generate-expansion-pack.md +2 -4
- package/expansion-packs/expansion-creator/templates/agent-teams-tmpl.md +6 -6
- package/expansion-packs/expansion-creator/templates/agent-tmpl.md +15 -15
- package/expansion-packs/expansion-creator/utils/workflow-management.md +8 -8
- package/package.json +1 -1
- package/tools/installer/README.md +3 -3
- package/tools/installer/package.json +1 -1
|
@@ -10,7 +10,7 @@ This document establishes coding standards, architectural patterns, and developm
|
|
|
10
10
|
|
|
11
11
|
**Required tsconfig.json settings:**
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
```json
|
|
14
14
|
{
|
|
15
15
|
"compilerOptions": {
|
|
16
16
|
"strict": true,
|
|
@@ -23,11 +23,12 @@ This document establishes coding standards, architectural patterns, and developm
|
|
|
23
23
|
"exactOptionalPropertyTypes": true
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
```
|
|
26
|
+
```
|
|
27
27
|
|
|
28
28
|
### Type Definitions
|
|
29
29
|
|
|
30
30
|
**Game Object Interfaces:**
|
|
31
|
+
|
|
31
32
|
```typescript
|
|
32
33
|
// Core game entity interface
|
|
33
34
|
interface GameEntity {
|
|
@@ -51,9 +52,10 @@ interface GameSystem {
|
|
|
51
52
|
update(delta: number): void;
|
|
52
53
|
shutdown(): void;
|
|
53
54
|
}
|
|
54
|
-
```
|
|
55
|
+
```
|
|
55
56
|
|
|
56
57
|
**Scene Data Interfaces:**
|
|
58
|
+
|
|
57
59
|
```typescript
|
|
58
60
|
// Scene transition data
|
|
59
61
|
interface SceneData {
|
|
@@ -71,28 +73,32 @@ interface GameState {
|
|
|
71
73
|
interface GameSettings {
|
|
72
74
|
musicVolume: number;
|
|
73
75
|
sfxVolume: number;
|
|
74
|
-
difficulty:
|
|
76
|
+
difficulty: "easy" | "normal" | "hard";
|
|
75
77
|
controls: ControlScheme;
|
|
76
78
|
}
|
|
77
|
-
```
|
|
79
|
+
```
|
|
78
80
|
|
|
79
81
|
### Naming Conventions
|
|
80
82
|
|
|
81
83
|
**Classes and Interfaces:**
|
|
84
|
+
|
|
82
85
|
- PascalCase for classes: `PlayerSprite`, `GameManager`, `AudioSystem`
|
|
83
86
|
- PascalCase with 'I' prefix for interfaces: `IGameEntity`, `IPlayerController`
|
|
84
87
|
- Descriptive names that indicate purpose: `CollisionManager` not `CM`
|
|
85
88
|
|
|
86
89
|
**Methods and Variables:**
|
|
90
|
+
|
|
87
91
|
- camelCase for methods and variables: `updatePosition()`, `playerSpeed`
|
|
88
92
|
- Descriptive names: `calculateDamage()` not `calcDmg()`
|
|
89
93
|
- Boolean variables with is/has/can prefix: `isActive`, `hasCollision`, `canMove`
|
|
90
94
|
|
|
91
95
|
**Constants:**
|
|
96
|
+
|
|
92
97
|
- UPPER_SNAKE_CASE for constants: `MAX_PLAYER_SPEED`, `DEFAULT_VOLUME`
|
|
93
98
|
- Group related constants in enums or const objects
|
|
94
99
|
|
|
95
100
|
**Files and Directories:**
|
|
101
|
+
|
|
96
102
|
- kebab-case for file names: `player-controller.ts`, `audio-manager.ts`
|
|
97
103
|
- PascalCase for scene files: `MenuScene.ts`, `GameScene.ts`
|
|
98
104
|
|
|
@@ -101,18 +107,19 @@ interface GameSettings {
|
|
|
101
107
|
### Scene Organization
|
|
102
108
|
|
|
103
109
|
**Scene Lifecycle Management:**
|
|
110
|
+
|
|
104
111
|
```typescript
|
|
105
112
|
class GameScene extends Phaser.Scene {
|
|
106
113
|
private gameManager!: GameManager;
|
|
107
114
|
private inputManager!: InputManager;
|
|
108
115
|
|
|
109
116
|
constructor() {
|
|
110
|
-
super({ key:
|
|
117
|
+
super({ key: "GameScene" });
|
|
111
118
|
}
|
|
112
119
|
|
|
113
120
|
preload(): void {
|
|
114
121
|
// Load only scene-specific assets
|
|
115
|
-
this.load.image(
|
|
122
|
+
this.load.image("player", "assets/player.png");
|
|
116
123
|
}
|
|
117
124
|
|
|
118
125
|
create(data: SceneData): void {
|
|
@@ -137,28 +144,29 @@ class GameScene extends Phaser.Scene {
|
|
|
137
144
|
this.inputManager.destroy();
|
|
138
145
|
|
|
139
146
|
// Remove event listeners
|
|
140
|
-
this.events.off(
|
|
147
|
+
this.events.off("*");
|
|
141
148
|
}
|
|
142
149
|
}
|
|
143
|
-
|
|
150
|
+
```
|
|
144
151
|
|
|
145
152
|
**Scene Transitions:**
|
|
146
153
|
|
|
147
|
-
|
|
154
|
+
```typescript
|
|
148
155
|
// Proper scene transitions with data
|
|
149
|
-
this.scene.start(
|
|
156
|
+
this.scene.start("NextScene", {
|
|
150
157
|
playerScore: this.playerScore,
|
|
151
|
-
currentLevel: this.currentLevel + 1
|
|
158
|
+
currentLevel: this.currentLevel + 1,
|
|
152
159
|
});
|
|
153
160
|
|
|
154
161
|
// Scene overlays for UI
|
|
155
|
-
this.scene.launch(
|
|
162
|
+
this.scene.launch("PauseMenuScene");
|
|
156
163
|
this.scene.pause();
|
|
157
|
-
```
|
|
164
|
+
```
|
|
158
165
|
|
|
159
166
|
### Game Object Patterns
|
|
160
167
|
|
|
161
168
|
**Component-Based Architecture:**
|
|
169
|
+
|
|
162
170
|
```typescript
|
|
163
171
|
// Base game entity
|
|
164
172
|
abstract class GameEntity extends Phaser.GameObjects.Sprite {
|
|
@@ -179,11 +187,11 @@ abstract class GameEntity extends Phaser.GameObjects.Sprite {
|
|
|
179
187
|
}
|
|
180
188
|
|
|
181
189
|
update(delta: number): void {
|
|
182
|
-
this.components.forEach(component => component.update(delta));
|
|
190
|
+
this.components.forEach((component) => component.update(delta));
|
|
183
191
|
}
|
|
184
192
|
|
|
185
193
|
destroy(): void {
|
|
186
|
-
this.components.forEach(component => component.destroy());
|
|
194
|
+
this.components.forEach((component) => component.destroy());
|
|
187
195
|
this.components.clear();
|
|
188
196
|
super.destroy();
|
|
189
197
|
}
|
|
@@ -195,17 +203,18 @@ class Player extends GameEntity {
|
|
|
195
203
|
private health!: HealthComponent;
|
|
196
204
|
|
|
197
205
|
constructor(scene: Phaser.Scene, x: number, y: number) {
|
|
198
|
-
super(scene, x, y,
|
|
206
|
+
super(scene, x, y, "player");
|
|
199
207
|
|
|
200
208
|
this.movement = this.addComponent(new MovementComponent(this));
|
|
201
209
|
this.health = this.addComponent(new HealthComponent(this, 100));
|
|
202
210
|
}
|
|
203
211
|
}
|
|
204
|
-
```
|
|
212
|
+
```
|
|
205
213
|
|
|
206
214
|
### System Management
|
|
207
215
|
|
|
208
216
|
**Singleton Managers:**
|
|
217
|
+
|
|
209
218
|
```typescript
|
|
210
219
|
class GameManager {
|
|
211
220
|
private static instance: GameManager;
|
|
@@ -214,7 +223,7 @@ class GameManager {
|
|
|
214
223
|
|
|
215
224
|
constructor(scene: Phaser.Scene) {
|
|
216
225
|
if (GameManager.instance) {
|
|
217
|
-
throw new Error(
|
|
226
|
+
throw new Error("GameManager already exists!");
|
|
218
227
|
}
|
|
219
228
|
|
|
220
229
|
this.scene = scene;
|
|
@@ -224,7 +233,7 @@ class GameManager {
|
|
|
224
233
|
|
|
225
234
|
static getInstance(): GameManager {
|
|
226
235
|
if (!GameManager.instance) {
|
|
227
|
-
throw new Error(
|
|
236
|
+
throw new Error("GameManager not initialized!");
|
|
228
237
|
}
|
|
229
238
|
return GameManager.instance;
|
|
230
239
|
}
|
|
@@ -237,13 +246,14 @@ class GameManager {
|
|
|
237
246
|
GameManager.instance = null!;
|
|
238
247
|
}
|
|
239
248
|
}
|
|
240
|
-
```
|
|
249
|
+
```
|
|
241
250
|
|
|
242
251
|
## Performance Optimization
|
|
243
252
|
|
|
244
253
|
### Object Pooling
|
|
245
254
|
|
|
246
255
|
**Required for High-Frequency Objects:**
|
|
256
|
+
|
|
247
257
|
```typescript
|
|
248
258
|
class BulletPool {
|
|
249
259
|
private pool: Bullet[] = [];
|
|
@@ -262,7 +272,7 @@ class BulletPool {
|
|
|
262
272
|
}
|
|
263
273
|
|
|
264
274
|
getBullet(): Bullet | null {
|
|
265
|
-
const bullet = this.pool.find(b => !b.active);
|
|
275
|
+
const bullet = this.pool.find((b) => !b.active);
|
|
266
276
|
if (bullet) {
|
|
267
277
|
bullet.setActive(true);
|
|
268
278
|
bullet.setVisible(true);
|
|
@@ -270,7 +280,7 @@ class BulletPool {
|
|
|
270
280
|
}
|
|
271
281
|
|
|
272
282
|
// Pool exhausted - create new bullet
|
|
273
|
-
console.warn(
|
|
283
|
+
console.warn("Bullet pool exhausted, creating new bullet");
|
|
274
284
|
return new Bullet(this.scene, 0, 0);
|
|
275
285
|
}
|
|
276
286
|
|
|
@@ -280,13 +290,13 @@ class BulletPool {
|
|
|
280
290
|
bullet.setPosition(0, 0);
|
|
281
291
|
}
|
|
282
292
|
}
|
|
283
|
-
|
|
293
|
+
```
|
|
284
294
|
|
|
285
295
|
### Frame Rate Optimization
|
|
286
296
|
|
|
287
297
|
**Performance Monitoring:**
|
|
288
298
|
|
|
289
|
-
|
|
299
|
+
```typescript
|
|
290
300
|
class PerformanceMonitor {
|
|
291
301
|
private frameCount: number = 0;
|
|
292
302
|
private lastTime: number = 0;
|
|
@@ -311,9 +321,10 @@ class PerformanceMonitor {
|
|
|
311
321
|
// Reduce particle counts, disable effects, etc.
|
|
312
322
|
}
|
|
313
323
|
}
|
|
314
|
-
```
|
|
324
|
+
```
|
|
315
325
|
|
|
316
326
|
**Update Loop Optimization:**
|
|
327
|
+
|
|
317
328
|
```typescript
|
|
318
329
|
// Avoid expensive operations in update loops
|
|
319
330
|
class GameScene extends Phaser.Scene {
|
|
@@ -334,13 +345,14 @@ class GameScene extends Phaser.Scene {
|
|
|
334
345
|
}
|
|
335
346
|
}
|
|
336
347
|
}
|
|
337
|
-
```
|
|
348
|
+
```
|
|
338
349
|
|
|
339
350
|
## Input Handling
|
|
340
351
|
|
|
341
352
|
### Cross-Platform Input
|
|
342
353
|
|
|
343
354
|
**Input Abstraction:**
|
|
355
|
+
|
|
344
356
|
```typescript
|
|
345
357
|
interface InputState {
|
|
346
358
|
moveLeft: boolean;
|
|
@@ -356,7 +368,7 @@ class InputManager {
|
|
|
356
368
|
moveRight: false,
|
|
357
369
|
jump: false,
|
|
358
370
|
action: false,
|
|
359
|
-
pause: false
|
|
371
|
+
pause: false,
|
|
360
372
|
};
|
|
361
373
|
|
|
362
374
|
private keys!: { [key: string]: Phaser.Input.Keyboard.Key };
|
|
@@ -368,12 +380,12 @@ class InputManager {
|
|
|
368
380
|
}
|
|
369
381
|
|
|
370
382
|
private setupKeyboard(): void {
|
|
371
|
-
this.keys = this.scene.input.keyboard.addKeys(
|
|
383
|
+
this.keys = this.scene.input.keyboard.addKeys("W,A,S,D,SPACE,ESC,UP,DOWN,LEFT,RIGHT");
|
|
372
384
|
}
|
|
373
385
|
|
|
374
386
|
private setupTouch(): void {
|
|
375
|
-
this.scene.input.on(
|
|
376
|
-
this.scene.input.on(
|
|
387
|
+
this.scene.input.on("pointerdown", this.handlePointerDown, this);
|
|
388
|
+
this.scene.input.on("pointerup", this.handlePointerUp, this);
|
|
377
389
|
}
|
|
378
390
|
|
|
379
391
|
update(): void {
|
|
@@ -388,20 +400,21 @@ class InputManager {
|
|
|
388
400
|
return { ...this.inputState };
|
|
389
401
|
}
|
|
390
402
|
}
|
|
391
|
-
```
|
|
403
|
+
```
|
|
392
404
|
|
|
393
405
|
## Error Handling
|
|
394
406
|
|
|
395
407
|
### Graceful Degradation
|
|
396
408
|
|
|
397
409
|
**Asset Loading Error Handling:**
|
|
410
|
+
|
|
398
411
|
```typescript
|
|
399
412
|
class AssetManager {
|
|
400
413
|
loadAssets(): Promise<void> {
|
|
401
414
|
return new Promise((resolve, reject) => {
|
|
402
|
-
this.scene.load.on(
|
|
403
|
-
this.scene.load.on(
|
|
404
|
-
this.scene.load.on(
|
|
415
|
+
this.scene.load.on("filecomplete", this.handleFileComplete, this);
|
|
416
|
+
this.scene.load.on("loaderror", this.handleLoadError, this);
|
|
417
|
+
this.scene.load.on("complete", () => resolve());
|
|
405
418
|
|
|
406
419
|
this.scene.load.start();
|
|
407
420
|
});
|
|
@@ -417,21 +430,21 @@ class AssetManager {
|
|
|
417
430
|
private loadFallbackAsset(key: string): void {
|
|
418
431
|
// Load placeholder or default assets
|
|
419
432
|
switch (key) {
|
|
420
|
-
case
|
|
421
|
-
this.scene.load.image(
|
|
433
|
+
case "player":
|
|
434
|
+
this.scene.load.image("player", "assets/defaults/default-player.png");
|
|
422
435
|
break;
|
|
423
436
|
default:
|
|
424
437
|
console.warn(`No fallback for asset: ${key}`);
|
|
425
438
|
}
|
|
426
439
|
}
|
|
427
440
|
}
|
|
428
|
-
|
|
441
|
+
```
|
|
429
442
|
|
|
430
443
|
### Runtime Error Recovery
|
|
431
444
|
|
|
432
445
|
**System Error Handling:**
|
|
433
446
|
|
|
434
|
-
|
|
447
|
+
```typescript
|
|
435
448
|
class GameSystem {
|
|
436
449
|
protected handleError(error: Error, context: string): void {
|
|
437
450
|
console.error(`Error in ${context}:`, error);
|
|
@@ -445,11 +458,11 @@ class GameSystem {
|
|
|
445
458
|
|
|
446
459
|
private attemptRecovery(context: string): void {
|
|
447
460
|
switch (context) {
|
|
448
|
-
case
|
|
461
|
+
case "update":
|
|
449
462
|
// Reset system state
|
|
450
463
|
this.reset();
|
|
451
464
|
break;
|
|
452
|
-
case
|
|
465
|
+
case "render":
|
|
453
466
|
// Disable visual effects
|
|
454
467
|
this.disableEffects();
|
|
455
468
|
break;
|
|
@@ -459,16 +472,17 @@ class GameSystem {
|
|
|
459
472
|
}
|
|
460
473
|
}
|
|
461
474
|
}
|
|
462
|
-
```
|
|
475
|
+
```
|
|
463
476
|
|
|
464
477
|
## Testing Standards
|
|
465
478
|
|
|
466
479
|
### Unit Testing
|
|
467
480
|
|
|
468
481
|
**Game Logic Testing:**
|
|
482
|
+
|
|
469
483
|
```typescript
|
|
470
484
|
// Example test for game mechanics
|
|
471
|
-
describe(
|
|
485
|
+
describe("HealthComponent", () => {
|
|
472
486
|
let healthComponent: HealthComponent;
|
|
473
487
|
|
|
474
488
|
beforeEach(() => {
|
|
@@ -476,30 +490,31 @@ describe('HealthComponent', () => {
|
|
|
476
490
|
healthComponent = new HealthComponent(mockEntity, 100);
|
|
477
491
|
});
|
|
478
492
|
|
|
479
|
-
test(
|
|
493
|
+
test("should initialize with correct health", () => {
|
|
480
494
|
expect(healthComponent.currentHealth).toBe(100);
|
|
481
495
|
expect(healthComponent.maxHealth).toBe(100);
|
|
482
496
|
});
|
|
483
497
|
|
|
484
|
-
test(
|
|
498
|
+
test("should handle damage correctly", () => {
|
|
485
499
|
healthComponent.takeDamage(25);
|
|
486
500
|
expect(healthComponent.currentHealth).toBe(75);
|
|
487
501
|
expect(healthComponent.isAlive()).toBe(true);
|
|
488
502
|
});
|
|
489
503
|
|
|
490
|
-
test(
|
|
504
|
+
test("should handle death correctly", () => {
|
|
491
505
|
healthComponent.takeDamage(150);
|
|
492
506
|
expect(healthComponent.currentHealth).toBe(0);
|
|
493
507
|
expect(healthComponent.isAlive()).toBe(false);
|
|
494
508
|
});
|
|
495
509
|
});
|
|
496
|
-
```
|
|
510
|
+
```
|
|
497
511
|
|
|
498
512
|
### Integration Testing
|
|
499
513
|
|
|
500
514
|
**Scene Testing:**
|
|
515
|
+
|
|
501
516
|
```typescript
|
|
502
|
-
describe(
|
|
517
|
+
describe("GameScene Integration", () => {
|
|
503
518
|
let scene: GameScene;
|
|
504
519
|
let mockGame: Phaser.Game;
|
|
505
520
|
|
|
@@ -509,62 +524,60 @@ describe('GameScene Integration', () => {
|
|
|
509
524
|
scene = new GameScene();
|
|
510
525
|
});
|
|
511
526
|
|
|
512
|
-
test(
|
|
527
|
+
test("should initialize all systems", () => {
|
|
513
528
|
scene.create({});
|
|
514
529
|
|
|
515
530
|
expect(scene.gameManager).toBeDefined();
|
|
516
531
|
expect(scene.inputManager).toBeDefined();
|
|
517
532
|
});
|
|
518
533
|
});
|
|
519
|
-
```
|
|
534
|
+
```
|
|
520
535
|
|
|
521
536
|
## File Organization
|
|
522
537
|
|
|
523
538
|
### Project Structure
|
|
524
539
|
|
|
525
|
-
|
|
526
|
-
|
|
540
|
+
```
|
|
527
541
|
src/
|
|
528
542
|
├── scenes/
|
|
529
|
-
│
|
|
530
|
-
│
|
|
531
|
-
│
|
|
532
|
-
│
|
|
533
|
-
│
|
|
543
|
+
│ ├── BootScene.ts # Initial loading and setup
|
|
544
|
+
│ ├── PreloadScene.ts # Asset loading with progress
|
|
545
|
+
│ ├── MenuScene.ts # Main menu and navigation
|
|
546
|
+
│ ├── GameScene.ts # Core gameplay
|
|
547
|
+
│ └── UIScene.ts # Overlay UI elements
|
|
534
548
|
├── gameObjects/
|
|
535
|
-
│
|
|
536
|
-
│
|
|
537
|
-
│
|
|
538
|
-
│
|
|
539
|
-
│
|
|
540
|
-
│
|
|
541
|
-
│
|
|
542
|
-
│
|
|
543
|
-
│
|
|
544
|
-
│
|
|
545
|
-
│
|
|
546
|
-
│
|
|
549
|
+
│ ├── entities/
|
|
550
|
+
│ │ ├── Player.ts # Player game object
|
|
551
|
+
│ │ ├── Enemy.ts # Enemy base class
|
|
552
|
+
│ │ └── Collectible.ts # Collectible items
|
|
553
|
+
│ ├── components/
|
|
554
|
+
│ │ ├── MovementComponent.ts
|
|
555
|
+
│ │ ├── HealthComponent.ts
|
|
556
|
+
│ │ └── CollisionComponent.ts
|
|
557
|
+
│ └── ui/
|
|
558
|
+
│ ├── Button.ts # Interactive buttons
|
|
559
|
+
│ ├── HealthBar.ts # Health display
|
|
560
|
+
│ └── ScoreDisplay.ts # Score UI
|
|
547
561
|
├── systems/
|
|
548
|
-
│
|
|
549
|
-
│
|
|
550
|
-
│
|
|
551
|
-
│
|
|
552
|
-
│
|
|
562
|
+
│ ├── GameManager.ts # Core game state management
|
|
563
|
+
│ ├── InputManager.ts # Cross-platform input handling
|
|
564
|
+
│ ├── AudioManager.ts # Sound and music system
|
|
565
|
+
│ ├── SaveManager.ts # Save/load functionality
|
|
566
|
+
│ └── PerformanceMonitor.ts # Performance tracking
|
|
553
567
|
├── utils/
|
|
554
|
-
│
|
|
555
|
-
│
|
|
556
|
-
│
|
|
557
|
-
│
|
|
568
|
+
│ ├── ObjectPool.ts # Generic object pooling
|
|
569
|
+
│ ├── MathUtils.ts # Game math helpers
|
|
570
|
+
│ ├── AssetLoader.ts # Asset management utilities
|
|
571
|
+
│ └── EventBus.ts # Global event system
|
|
558
572
|
├── types/
|
|
559
|
-
│
|
|
560
|
-
│
|
|
561
|
-
│
|
|
573
|
+
│ ├── GameTypes.ts # Core game type definitions
|
|
574
|
+
│ ├── UITypes.ts # UI-related types
|
|
575
|
+
│ └── SystemTypes.ts # System interface definitions
|
|
562
576
|
├── config/
|
|
563
|
-
│
|
|
564
|
-
│
|
|
565
|
-
│
|
|
566
|
-
└── main.ts
|
|
567
|
-
|
|
577
|
+
│ ├── GameConfig.ts # Phaser game configuration
|
|
578
|
+
│ ├── GameBalance.ts # Game balance parameters
|
|
579
|
+
│ └── AssetConfig.ts # Asset loading configuration
|
|
580
|
+
└── main.ts # Application entry point
|
|
568
581
|
```
|
|
569
582
|
|
|
570
583
|
## Development Workflow
|
|
@@ -572,21 +585,25 @@ src/
|
|
|
572
585
|
### Story Implementation Process
|
|
573
586
|
|
|
574
587
|
1. **Read Story Requirements:**
|
|
588
|
+
|
|
575
589
|
- Understand acceptance criteria
|
|
576
590
|
- Identify technical requirements
|
|
577
591
|
- Review performance constraints
|
|
578
592
|
|
|
579
593
|
2. **Plan Implementation:**
|
|
594
|
+
|
|
580
595
|
- Identify files to create/modify
|
|
581
596
|
- Consider component architecture
|
|
582
597
|
- Plan testing approach
|
|
583
598
|
|
|
584
599
|
3. **Implement Feature:**
|
|
600
|
+
|
|
585
601
|
- Follow TypeScript strict mode
|
|
586
602
|
- Use established patterns
|
|
587
603
|
- Maintain 60 FPS performance
|
|
588
604
|
|
|
589
605
|
4. **Test Implementation:**
|
|
606
|
+
|
|
590
607
|
- Write unit tests for game logic
|
|
591
608
|
- Test cross-platform functionality
|
|
592
609
|
- Validate performance targets
|
|
@@ -599,6 +616,7 @@ src/
|
|
|
599
616
|
### Code Review Checklist
|
|
600
617
|
|
|
601
618
|
**Before Committing:**
|
|
619
|
+
|
|
602
620
|
- [ ] TypeScript compiles without errors
|
|
603
621
|
- [ ] All tests pass
|
|
604
622
|
- [ ] Performance targets met (60 FPS)
|
|
@@ -612,20 +630,22 @@ src/
|
|
|
612
630
|
## Performance Targets
|
|
613
631
|
|
|
614
632
|
### Frame Rate Requirements
|
|
633
|
+
|
|
615
634
|
- **Desktop**: Maintain 60 FPS at 1080p
|
|
616
635
|
- **Mobile**: Maintain 60 FPS on mid-range devices, minimum 30 FPS on low-end
|
|
617
636
|
- **Optimization**: Implement dynamic quality scaling when performance drops
|
|
618
637
|
|
|
619
638
|
### Memory Management
|
|
639
|
+
|
|
620
640
|
- **Total Memory**: Under 100MB for full game
|
|
621
641
|
- **Per Scene**: Under 50MB per gameplay scene
|
|
622
642
|
- **Asset Loading**: Progressive loading to stay under limits
|
|
623
643
|
- **Garbage Collection**: Minimize object creation in update loops
|
|
624
644
|
|
|
625
645
|
### Loading Performance
|
|
646
|
+
|
|
626
647
|
- **Initial Load**: Under 5 seconds for game start
|
|
627
648
|
- **Scene Transitions**: Under 2 seconds between scenes
|
|
628
649
|
- **Asset Streaming**: Background loading for upcoming content
|
|
629
650
|
|
|
630
651
|
These guidelines ensure consistent, high-quality game development that meets performance targets and maintains code quality across all implementation stories.
|
|
631
|
-
```
|
|
@@ -59,7 +59,7 @@ This architecture is designed to support the gameplay mechanics defined in the G
|
|
|
59
59
|
|
|
60
60
|
[[LLM: Design a clear folder structure for game development]]
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
```text
|
|
63
63
|
{{game_name}}/
|
|
64
64
|
├── src/
|
|
65
65
|
│ ├── scenes/ # Game scenes
|
|
@@ -80,7 +80,7 @@ This architecture is designed to support the gameplay mechanics defined in the G
|
|
|
80
80
|
│ ├── stories/ # Development stories
|
|
81
81
|
│ └── architecture/ # Technical docs
|
|
82
82
|
└── dist/ # Built game files
|
|
83
|
-
```
|
|
83
|
+
```
|
|
84
84
|
|
|
85
85
|
### Module Organization
|
|
86
86
|
|
|
@@ -365,7 +365,7 @@ const gameConfig: Phaser.Types.Core.GameConfig = {
|
|
|
365
365
|
},
|
|
366
366
|
// Additional configuration...
|
|
367
367
|
};
|
|
368
|
-
```
|
|
368
|
+
```
|
|
369
369
|
|
|
370
370
|
### Game Balance Configuration
|
|
371
371
|
|
|
@@ -386,7 +386,7 @@ export const GameBalance = {
|
|
|
386
386
|
},
|
|
387
387
|
// Additional balance parameters...
|
|
388
388
|
};
|
|
389
|
-
|
|
389
|
+
```
|
|
390
390
|
|
|
391
391
|
## Development Guidelines
|
|
392
392
|
|