diff --git a/assets/fx/bonus-cash.mp3 b/assets/fx/bonus-cash.mp3 new file mode 100644 index 0000000..f0f5de2 Binary files /dev/null and b/assets/fx/bonus-cash.mp3 differ diff --git a/assets/fx/bonus-ctc.mp3 b/assets/fx/bonus-ctc.mp3 new file mode 100644 index 0000000..8c893da Binary files /dev/null and b/assets/fx/bonus-ctc.mp3 differ diff --git a/assets/fx/bonus-guitar.mp3 b/assets/fx/bonus-guitar.mp3 new file mode 100644 index 0000000..90ca788 Binary files /dev/null and b/assets/fx/bonus-guitar.mp3 differ diff --git a/assets/fx/smash-chair.mp3 b/assets/fx/smash-chair.mp3 new file mode 100644 index 0000000..bd21011 Binary files /dev/null and b/assets/fx/smash-chair.mp3 differ diff --git a/assets/fx/smash-cone.mp3 b/assets/fx/smash-cone.mp3 new file mode 100644 index 0000000..61628b5 Binary files /dev/null and b/assets/fx/smash-cone.mp3 differ diff --git a/assets/fx/smash-tv.mp3 b/assets/fx/smash-tv.mp3 new file mode 100644 index 0000000..036c5b6 Binary files /dev/null and b/assets/fx/smash-tv.mp3 differ diff --git a/assets/music/urban-theme.mp3 b/assets/music/urban-theme.mp3 new file mode 100644 index 0000000..c338870 Binary files /dev/null and b/assets/music/urban-theme.mp3 differ diff --git a/assets/music/urban-trap-theme.mp3 b/assets/music/urban-trap-theme.mp3 new file mode 100644 index 0000000..328a9da Binary files /dev/null and b/assets/music/urban-trap-theme.mp3 differ diff --git a/assets/sprites/smash-items.png b/assets/sprites/smash-items.png index 2a2301b..7cdea0c 100644 Binary files a/assets/sprites/smash-items.png and b/assets/sprites/smash-items.png differ diff --git a/assets/sprites/smash-items.psd b/assets/sprites/smash-items.psd index fdb0a00..c15fe61 100644 Binary files a/assets/sprites/smash-items.psd and b/assets/sprites/smash-items.psd differ diff --git a/src/data/levels/level01.js b/src/data/levels/level01.js index de946bf..5ab1223 100644 --- a/src/data/levels/level01.js +++ b/src/data/levels/level01.js @@ -384,10 +384,10 @@ export default { ], obstacles: [], items: [ - { type: "tv", mode: "gravity", x: 5754, y: 444 }, - { type: "cone", mode: "gravity", x: 2479, y: 369 }, - { type: "cone", mode: "gravity", x: 2721, y: 219 }, - { type: "cone", mode: "gravity", x: 2521, y: 136 }, + { type: "tv", mode: "gravity", x: 24538, y: 469 }, + { type: "cone", mode: "gravity", x: 11721, y: 836 }, + { type: "cone", mode: "gravity", x: 12063, y: 786 }, + { type: "cone", mode: "gravity", x: 12388, y: 728 }, ], goal: { x: 25420, y: 406, width: 280, height: 640 }, cameraBounds: { x: -600, y: -522, width: 27060, height: 2414 }, diff --git a/src/data/levels/level07.js b/src/data/levels/level07.js index 31f7d03..7e75d35 100644 --- a/src/data/levels/level07.js +++ b/src/data/levels/level07.js @@ -1,11 +1,10 @@ -// Scaffolding level - terrain is a copy of level06. -// Build out the real layout in editor.html, then replace this file. +// Generated by editor.html - review before dropping into src/data/levels/. export default { id: "level07", - name: "Rush Hour", - description: "Kids get home before dinner!", - kidsAboard: 3, - timeLimit: 41, + name: "We're Lost", + description: "Did anyone pay attention to how we got here?", + kidsAboard: 5, + timeLimit: 47, startPosition: { x: 200, y: 700 }, startAngle: 0, terrain: [ @@ -32,219 +31,267 @@ export default { { x: 930, y: 840 }, { x: 1000, y: 840 }, { x: 1070, y: 840 }, - { x: 1140, y: 840 }, - { x: 1210, y: 840 }, - { x: 1280, y: 840 }, - { x: 1350, y: 840 }, - { x: 1420, y: 840 }, - { x: 1490, y: 840 }, - { x: 1560, y: 840 }, - { x: 1630, y: 840 }, - { x: 1700, y: 840 }, - { x: 1770, y: 840 }, - { x: 1840, y: 840 }, - { x: 1910, y: 840 }, - { x: 1980, y: 840 }, - { x: 2050, y: 840 }, - { x: 2120, y: 840 }, - { x: 2190, y: 840 }, - { x: 2260, y: 840 }, - { x: 2330, y: 840 }, - { x: 2400, y: 840 }, - { x: 2470, y: 840 }, - { x: 2540, y: 840 }, - { x: 2610, y: 840 }, - { x: 2680, y: 840 }, - { x: 2750, y: 840 }, - { x: 2820, y: 840 }, - { x: 2890, y: 840 }, - { x: 2960, y: 840 }, - { x: 3030, y: 840 }, - { x: 3100, y: 840 }, - { x: 3170, y: 840 }, - { x: 3240, y: 840 }, - { x: 3310, y: 840 }, - { x: 3380, y: 840 }, - { x: 3450, y: 840 }, - { x: 3520, y: 840 }, + { x: 1140, y: 836 }, + { x: 1210, y: 830 }, + { x: 1280, y: 820 }, + { x: 1350, y: 808 }, + { x: 1420, y: 792 }, + { x: 1490, y: 776 }, + { x: 1560, y: 760 }, + { x: 1630, y: 744 }, + { x: 1700, y: 728 }, + { x: 1770, y: 712 }, + { x: 1840, y: 696 }, + { x: 1910, y: 680 }, + { x: 1980, y: 664 }, + { x: 2050, y: 648 }, + { x: 2120, y: 632 }, + { x: 2190, y: 616 }, + { x: 2260, y: 600 }, + { x: 2330, y: 584 }, + { x: 2400, y: 568 }, + { x: 2470, y: 584 }, + { x: 2540, y: 600 }, + { x: 2610, y: 616 }, + { x: 2680, y: 632 }, + { x: 2750, y: 648 }, + { x: 2820, y: 664 }, + { x: 2890, y: 680 }, + { x: 2960, y: 696 }, + { x: 3030, y: 712 }, + { x: 3100, y: 728 }, + { x: 3170, y: 744 }, + { x: 3240, y: 760 }, + { x: 3310, y: 776 }, + { x: 3380, y: 792 }, + { x: 3450, y: 808 }, + { x: 3520, y: 824 }, { x: 3590, y: 840 }, - { x: 3660, y: 840 }, - { x: 3730, y: 840 }, - { x: 3800, y: 840 }, - { x: 3870, y: 842 }, - { x: 3940, y: 846 }, - { x: 4010, y: 850 }, - { x: 4080, y: 858 }, - { x: 4150, y: 868 }, - { x: 4220, y: 878 }, - { x: 4290, y: 890 }, - { x: 4360, y: 904 }, - { x: 4430, y: 916 }, - { x: 4500, y: 930 }, - { x: 4570, y: 944 }, - { x: 4640, y: 956 }, - { x: 4710, y: 970 }, - { x: 4780, y: 982 }, - { x: 4850, y: 992 }, - { x: 4920, y: 1002 }, - { x: 4990, y: 1010 }, - { x: 5060, y: 1014 }, - { x: 5130, y: 1018 }, - { x: 5200, y: 1020 }, - { x: 5270, y: 1020 }, - { x: 5340, y: 1020 }, - { x: 5410, y: 1020 }, - { x: 5480, y: 1020 }, - { x: 5550, y: 1020 }, - { x: 5620, y: 1020 }, - { x: 5690, y: 1020 }, - { x: 5760, y: 1020 }, - { x: 5830, y: 1020 }, - { x: 5900, y: 1020 }, - { x: 5970, y: 1020 }, - { x: 6040, y: 1020 }, - { x: 6110, y: 1020 }, - { x: 6180, y: 1020 }, - { x: 6250, y: 1020 }, - { x: 6320, y: 1020 }, - { x: 6390, y: 1020 }, - { x: 6460, y: 1020 }, - { x: 6530, y: 1020 }, - { x: 6600, y: 1020 }, - { x: 6670, y: 1018 }, - { x: 6740, y: 1014 }, - { x: 6810, y: 1010 }, - { x: 6880, y: 1002 }, - { x: 6950, y: 992 }, - { x: 7020, y: 982 }, - { x: 7090, y: 970 }, - { x: 7160, y: 956 }, - { x: 7230, y: 944 }, - { x: 7300, y: 930 }, - { x: 7370, y: 916 }, - { x: 7440, y: 904 }, - { x: 7510, y: 890 }, - { x: 7580, y: 878 }, - { x: 7650, y: 868 }, - { x: 7720, y: 858 }, - { x: 7790, y: 850 }, - { x: 7860, y: 846 }, - { x: 7930, y: 842 }, - { x: 8000, y: 840 }, - { x: 8070, y: 840 }, - { x: 8140, y: 840 }, - { x: 8210, y: 840 }, - { x: 8280, y: 840 }, - { x: 8350, y: 840 }, - { x: 8420, y: 840 }, - { x: 8490, y: 840 }, - { x: 8560, y: 840 }, - { x: 8630, y: 840 }, - { x: 8700, y: 840 }, - { x: 8770, y: 840 }, - { x: 8840, y: 840 }, - { x: 8910, y: 840 }, - { x: 8980, y: 840 }, - { x: 9050, y: 840 }, - { x: 9120, y: 840 }, - { x: 9190, y: 840 }, - { x: 9260, y: 840 }, - { x: 9330, y: 840 }, - { x: 9400, y: 840 }, - { x: 9470, y: 840 }, - { x: 9540, y: 840 }, - { x: 9610, y: 840 }, - { x: 9680, y: 840 }, - { x: 9750, y: 840 }, - { x: 9820, y: 840 }, - { x: 9890, y: 840 }, - { x: 9960, y: 840 }, - { x: 10030, y: 840 }, - { x: 10100, y: 840 }, - { x: 10170, y: 840 }, - { x: 10240, y: 840 }, - { x: 10310, y: 840 }, - { x: 10380, y: 840 }, - { x: 10450, y: 840 }, - { x: 10520, y: 840 }, - { x: 10590, y: 840 }, - { x: 10660, y: 840 }, - { x: 10730, y: 840 }, - { x: 10800, y: 840 }, - { x: 10870, y: 840 }, - { x: 10940, y: 840 }, - { x: 11010, y: 840 }, - { x: 11080, y: 840 }, - { x: 11150, y: 840 }, - { x: 11220, y: 840 }, - { x: 11290, y: 840 }, - { x: 11360, y: 840 }, - { x: 11430, y: 840 }, - { x: 11500, y: 840 }, - { x: 11570, y: 840 }, - { x: 11640, y: 840 }, - { x: 11710, y: 840 }, - { x: 11780, y: 840 }, - { x: 11808, y: 840 }, - { x: 11878, y: 836 }, - { x: 11948, y: 822 }, - { x: 12018, y: 800 }, - { x: 12088, y: 768 }, - { x: 12158, y: 728 }, - { x: 12200, y: 700 }, - { x: 12270, y: 700 }, + { x: 3660, y: 856 }, + { x: 3730, y: 872 }, + { x: 3800, y: 888 }, + { x: 3870, y: 902 }, + { x: 3940, y: 914 }, + { x: 4010, y: 918 }, + { x: 4080, y: 914 }, + { x: 4150, y: 902 }, + { x: 4220, y: 888 }, + { x: 4290, y: 872 }, + { x: 4360, y: 856 }, + { x: 4430, y: 840 }, + { x: 4500, y: 824 }, + { x: 4570, y: 808 }, + { x: 4640, y: 792 }, + { x: 4710, y: 776 }, + { x: 4780, y: 760 }, + { x: 4850, y: 744 }, + { x: 4920, y: 728 }, + { x: 4990, y: 712 }, + { x: 5060, y: 696 }, + { x: 5130, y: 680 }, + { x: 5200, y: 664 }, + { x: 5270, y: 664 }, ] }, { points: [ - { x: 13704, y: 1180 }, - { x: 13774, y: 1180 }, - { x: 13844, y: 1180 }, - { x: 13914, y: 1180 }, - { x: 13984, y: 1180 }, - { x: 14054, y: 1180 }, - { x: 14080, y: 1180 }, - { x: 14150, y: 1180 }, - { x: 14220, y: 1180 }, - { x: 14290, y: 1180 }, - { x: 14360, y: 1180 }, - { x: 14430, y: 1180 }, - { x: 14500, y: 1180 }, - { x: 14570, y: 1180 }, - { x: 14640, y: 1180 }, - { x: 14710, y: 1180 }, - { x: 14780, y: 1180 }, - { x: 14850, y: 1180 }, - { x: 14920, y: 1180 }, - { x: 14990, y: 1180 }, - { x: 15060, y: 1180 }, - { x: 15130, y: 1180 }, - { x: 15200, y: 1180 }, - { x: 15270, y: 1180 }, - { x: 15340, y: 1180 }, - { x: 15410, y: 1180 }, - { x: 15480, y: 1180 }, - { x: 15550, y: 1180 }, - { x: 15620, y: 1180 }, - { x: 15690, y: 1180 }, - { x: 15760, y: 1180 }, - { x: 15830, y: 1180 }, - { x: 15900, y: 1180 }, - { x: 15970, y: 1180 }, - { x: 16040, y: 1180 }, - { x: 16110, y: 1180 }, - { x: 16180, y: 1180 }, - { x: 16250, y: 1180 }, - { x: 16320, y: 1180 }, - { x: 16390, y: 1180 }, - { x: 16460, y: 1180 }, - { x: 16530, y: 1180 }, - { x: 16600, y: 1180 }, - { x: 16670, y: 1180 }, - { x: 16740, y: 1180 }, - { x: 16810, y: 1180 }, - { x: 16880, y: 1180 }, + { x: 5760, y: 664 }, + { x: 5830, y: 664 }, + { x: 5900, y: 664 }, + { x: 5970, y: 664 }, + { x: 6040, y: 664 }, + { x: 6110, y: 664 }, + { x: 6180, y: 664 }, + { x: 6250, y: 664 }, + { x: 6320, y: 664 }, + { x: 6390, y: 664 }, + { x: 6460, y: 664 }, + { x: 6530, y: 664 }, + { x: 6600, y: 664 }, + { x: 6670, y: 664 }, + { x: 6740, y: 660 }, + { x: 6810, y: 654 }, + { x: 6880, y: 646 }, + { x: 6950, y: 636 }, + { x: 7020, y: 626 }, + { x: 7090, y: 614 }, + { x: 7160, y: 600 }, + { x: 7230, y: 588 }, + { x: 7300, y: 574 }, + { x: 7370, y: 560 }, + { x: 7440, y: 548 }, + { x: 7510, y: 536 }, + { x: 7580, y: 524 }, + { x: 7650, y: 512 }, + { x: 7720, y: 504 }, + { x: 7790, y: 496 }, + { x: 7860, y: 490 }, + { x: 7930, y: 486 }, + { x: 8000, y: 484 }, + { x: 8070, y: 482 }, + { x: 8140, y: 478 }, + { x: 8210, y: 474 }, + { x: 8280, y: 468 }, + { x: 8350, y: 462 }, + { x: 8420, y: 454 }, + { x: 8490, y: 442 }, + { x: 8560, y: 422 }, + { x: 8630, y: 396 }, + { x: 8700, y: 368 }, + { x: 8770, y: 340 }, + { x: 8840, y: 316 }, + { x: 8910, y: 296 }, + { x: 8980, y: 282 }, + { x: 9050, y: 278 }, + { x: 9120, y: 282 }, + { x: 9190, y: 296 }, + { x: 9260, y: 316 }, + { x: 9330, y: 340 }, + { x: 9400, y: 368 }, + { x: 9470, y: 396 }, + { x: 9540, y: 422 }, + { x: 9610, y: 442 }, + { x: 9680, y: 454 }, + { x: 9750, y: 458 }, + { x: 9820, y: 454 }, + { x: 9890, y: 442 }, + { x: 9960, y: 422 }, + { x: 10030, y: 396 }, + { x: 10100, y: 368 }, + { x: 10170, y: 340 }, + { x: 10240, y: 316 }, + { x: 10310, y: 296 }, + { x: 10380, y: 282 }, + { x: 10450, y: 278 }, + { x: 10520, y: 282 }, + { x: 10590, y: 296 }, + { x: 10660, y: 316 }, + { x: 10730, y: 340 }, + { x: 10800, y: 368 }, + { x: 10870, y: 368 }, + { x: 10940, y: 368 }, + { x: 11010, y: 368 }, + { x: 11080, y: 368 }, + { x: 11150, y: 368 }, + { x: 11220, y: 368 }, + { x: 11290, y: 368 }, + { x: 11360, y: 368 }, + { x: 11430, y: 368 }, + { x: 11500, y: 368 }, + { x: 11570, y: 368 }, + { x: 11640, y: 368 }, + { x: 11710, y: 368 }, + { x: 11780, y: 368 }, + { x: 11808, y: 368 }, + { x: 11878, y: 364 }, + { x: 11948, y: 350 }, + { x: 12018, y: 328 }, + { x: 12088, y: 296 }, + { x: 12158, y: 256 }, + { x: 12200, y: 228 }, + { x: 12270, y: 228 }, + ] }, + { points: [ + { x: 13320, y: 708 }, + { x: 13390, y: 708 }, + { x: 13460, y: 708 }, + { x: 13530, y: 708 }, + { x: 13600, y: 708 }, + { x: 13670, y: 750 }, + { x: 13740, y: 788 }, + { x: 13810, y: 826 }, + { x: 13880, y: 862 }, + { x: 13950, y: 892 }, + { x: 14020, y: 918 }, + { x: 14090, y: 940 }, + { x: 14160, y: 956 }, + { x: 14230, y: 966 }, + { x: 14300, y: 968 }, + { x: 14370, y: 966 }, + { x: 14440, y: 956 }, + { x: 14510, y: 940 }, + { x: 14580, y: 918 }, + { x: 14650, y: 892 }, + { x: 14720, y: 862 }, + { x: 14790, y: 826 }, + { x: 14860, y: 788 }, + { x: 14930, y: 750 }, + { x: 15000, y: 708 }, + { x: 15070, y: 666 }, + { x: 15140, y: 624 }, + { x: 15210, y: 584 }, + { x: 15280, y: 542 }, + { x: 15350, y: 502 }, + { x: 15420, y: 462 }, + { x: 15490, y: 422 }, + { x: 15560, y: 382 }, + { x: 15630, y: 342 }, + { x: 15700, y: 302 }, + { x: 15770, y: 262 }, + { x: 15840, y: 222 }, + { x: 15910, y: 182 }, + { x: 15980, y: 142 }, + { x: 16050, y: 102 }, + { x: 16120, y: 62 }, + { x: 16190, y: 22 }, + { x: 16260, y: -18 }, + { x: 16330, y: -58 }, + { x: 16400, y: -98 }, + { x: 16470, y: -96 }, + { x: 16540, y: -92 }, + { x: 16610, y: -86 }, + { x: 16680, y: -78 }, + { x: 16750, y: -70 }, + { x: 16820, y: -58 }, + { x: 16890, y: -46 }, + { x: 16960, y: -34 }, + { x: 17030, y: -22 }, + { x: 17100, y: -8 }, + { x: 17170, y: 6 }, + { x: 17240, y: 20 }, + { x: 17310, y: 32 }, + { x: 17380, y: 44 }, + { x: 17450, y: 54 }, + { x: 17520, y: 64 }, + { x: 17590, y: 72 }, + { x: 17660, y: 78 }, + { x: 17730, y: 82 }, + { x: 17800, y: 82 }, + { x: 17870, y: 82 }, + { x: 17940, y: 82 }, + { x: 18010, y: 82 }, + { x: 18080, y: 82 }, + { x: 18150, y: 82 }, + { x: 18220, y: 82 }, + { x: 18290, y: 82 }, + { x: 18360, y: 82 }, + { x: 18430, y: 82 }, + { x: 18500, y: 82 }, + { x: 18570, y: 82 }, + { x: 18640, y: 82 }, + { x: 18710, y: 82 }, + { x: 18780, y: 82 }, + { x: 18850, y: 82 }, + { x: 18920, y: 82 }, + { x: 18990, y: 82 }, + { x: 19060, y: 82 }, + { x: 19130, y: 82 }, + { x: 19200, y: 82 }, ] }, ], obstacles: [], - goal: { x: 16640, y: 940, width: 280, height: 640 }, - cameraBounds: { x: -600, y: -100, width: 18280, height: 2080 }, + items: [ + { type: "tv", mode: "gravity", x: 6179, y: 373 }, + { type: "chair", mode: "gravity", x: 9763, y: 315 }, + { type: "chair", mode: "gravity", x: 9046, y: 56 }, + { type: "chair", mode: "gravity", x: 10429, y: 106 }, + { type: "chair", mode: "gravity", x: 18463, y: -153 }, + { type: "tv", mode: "gravity", x: 18238, y: -170 }, + { type: "cone", mode: "gravity", x: 18696, y: -178 }, + ], + bonusItems: [ + { type: "guitar", x: 5521, y: 440 }, + { type: "guitar", x: 13171, y: 298 }, + { type: "cash", x: 16688, y: -420 }, + ], + goal: { x: 18960, y: -158, width: 280, height: 640 }, + cameraBounds: { x: -600, y: -898, width: 20600, height: 2666 }, }; diff --git a/src/entities/BonusItemManager.js b/src/entities/BonusItemManager.js index 7786aed..143f103 100644 --- a/src/entities/BonusItemManager.js +++ b/src/entities/BonusItemManager.js @@ -7,9 +7,9 @@ import { BONUS_ITEM } from '../config.js'; // Each bonus item is followed by its two firework-object frames, which are // the sprites the explosion burst is made of (see _explode below). const BONUS_TYPES = { - ctc: { frame: 0, fireworks: [1, 2], label: 'CTC Box' }, - guitar: { frame: 3, fireworks: [4, 5], label: 'Guitar' }, - cash: { frame: 6, fireworks: [7, 8], label: 'Cash' }, + ctc: { frame: 0, fireworks: [1, 2], label: 'CTC Box', soundKey: 'bonus_ctc' }, + guitar: { frame: 3, fireworks: [4, 5], label: 'Guitar', soundKey: 'bonus_guitar' }, + cash: { frame: 6, fireworks: [7, 8], label: 'Cash', soundKey: 'bonus_cash' }, }; export default class BonusItemManager { @@ -120,6 +120,16 @@ export default class BonusItemManager { const y = item.image.y; const { scene } = this; + // SFX: the item's own bonus clip (bonus-ctc.mp3 / bonus-guitar.mp3 / + // bonus-cash.mp3, loaded in PreloadScene). cache.audio.exists guards + // against a failed load - same load-tolerant pattern as voiceLine.js / + // kidFallSound.js, so a missing clip degrades to silent instead of + // throwing. Each item collects at most once, so no overlap concern. + const key = item.type.soundKey; + if (key && scene.cache.audio.exists(key)) { + scene.sound.add(key).play(); + } + // The bonus item sprite: quick "pop" (grow + fade) then it's gone - // the firework sprites below ARE the aftermath. scene.tweens.add({ diff --git a/src/entities/SmashItemManager.js b/src/entities/SmashItemManager.js index bfe9d7a..95a5e42 100644 --- a/src/entities/SmashItemManager.js +++ b/src/entities/SmashItemManager.js @@ -4,9 +4,9 @@ import { SMASH_ITEM } from '../config.js'; // 0 intact TV, 1 smashed TV, 2 intact chair, 3 smashed chair, // 4 intact cone, 5 smashed cone. const ITEM_TYPES = { - tv: { baseFrame: 0, smashedFrame: 1, label: 'TV' }, - chair: { baseFrame: 2, smashedFrame: 3, label: 'Chair' }, - cone: { baseFrame: 4, smashedFrame: 5, label: 'Cone' }, + tv: { baseFrame: 0, smashedFrame: 1, label: 'TV', soundKey: 'smash_tv' }, + chair: { baseFrame: 2, smashedFrame: 3, label: 'Chair', soundKey: 'smash_chair' }, + cone: { baseFrame: 4, smashedFrame: 5, label: 'Cone', soundKey: 'smash_cone' }, }; export default class SmashItemManager { @@ -172,6 +172,16 @@ export default class SmashItemManager { image.setAngularVelocity(SMASH_ITEM.launchSpin * dirX); item.smashed = true; + + // SFX: the item's own smash clip (smash-tv.mp3 / smash-chair.mp3 / + // smash-cone.mp3, loaded in PreloadScene). cache.audio.exists guards + // against a failed load - same load-tolerant pattern as voiceLine.js / + // kidFallSound.js, so a missing clip degrades to silent instead of + // throwing. Each item smashes at most once, so no overlap concern. + const key = item.type.soundKey; + if (key && this.scene.cache.audio.exists(key)) { + this.scene.sound.add(key).play(); + } } destroy() { diff --git a/src/scenes/PreloadScene.js b/src/scenes/PreloadScene.js index f1540c6..c79080f 100644 --- a/src/scenes/PreloadScene.js +++ b/src/scenes/PreloadScene.js @@ -33,6 +33,12 @@ export default class PreloadScene extends Phaser.Scene { this.load.audio('kid_count', 'assets/fx/kid-count.mp3'); this.load.audio('score_count', 'assets/fx/score-count.mp3'); this.load.audio('kid_reload', 'assets/fx/crowd-cheer.mp3'); + this.load.audio('smash_tv', 'assets/fx/smash-tv.mp3'); + this.load.audio('smash_chair', 'assets/fx/smash-chair.mp3'); + this.load.audio('smash_cone', 'assets/fx/smash-cone.mp3'); + this.load.audio('bonus_cash', 'assets/fx/bonus-cash.mp3'); + this.load.audio('bonus_ctc', 'assets/fx/bonus-ctc.mp3'); + this.load.audio('bonus_guitar', 'assets/fx/bonus-guitar.mp3'); loadKidFallSounds(this.load); // Not every level has a voice-over - this just attempts one per level