From d52e61afa5df81bd43621536d1d01b153038b6bf Mon Sep 17 00:00:00 2001 From: Chris Weed Date: Wed, 17 Jul 2024 23:21:04 -0500 Subject: [PATCH] Music added --- boatBattle.ts | 4 ++++ images.g.ts | 4 ++++ main.ts | 2 +- treasureIsland.ts | 6 +++++- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/boatBattle.ts b/boatBattle.ts index d147e86..41f63f2 100644 --- a/boatBattle.ts +++ b/boatBattle.ts @@ -59,6 +59,8 @@ namespace BoatBattle { }) PirateLives.show() + + music.play(music.createSong(assets.song`BoatBattle`), music.PlaybackMode.LoopingInBackground) } export function render() { @@ -79,6 +81,8 @@ namespace BoatBattle { treasure.destroy() scene.setBackgroundImage(assets.image`empty`) + + music.stopAllSounds() } export function onWin(callback: () => void) { diff --git a/images.g.ts b/images.g.ts index af95b26..924bf11 100644 --- a/images.g.ts +++ b/images.g.ts @@ -3157,6 +3157,10 @@ d d e e e 6 6 6 6 6 6 6 e e d d case "Invading Them Landlubbers":return hex`00780004080a0400001c00010a006400f401640000040000000000000000000000000005000004900000000c00011d0c000e00011e0e001000012210001200012020002c00011b2c002e00011e2e003000012230003200012740004c00011d4c004e00011e4e005000012250005200012060006c00011b6c006e00011e6e007000012270007200012780008c00011d8c008e00011e8e0090000122900092000120a000ac00011bac00ae00011eae00b0000122b000b200012705001c000f0a006400f4010a0000040000000000000000000000000000000002680100000c0001160c000e0001160e001000011610001200011620002c0001162c002e0001162e003000011630003200011634003800010f38003a0001113a003c0001123c003e00011440004c0001164c004e0001164e005000011650005200011660006c0001166c006e0001166e007000011670007200011674007800010f78007a0001117a007c0001127c007e00011480008c0001168c008e0001168e0090000116900092000116a000ac000116ac00ae000116ae00b0000116b000b2000116b400b800010fb800ba000111ba00bc000112bc00be000114c000cc000116cc00ce000116ce00d0000116d000d2000116e000ec000116ec00ee000116ee00f0000116f000f2000116f400f800010ff800fa000111fa00fc000112fc00fe00011400010c0101160c010e0101160e011001011610011201011620012c0101162c012e0101162e013001011630013201011634013801010f38013a0101113a013c0101123c013e01011406001c00010a006400f4016400000400000000000000000000000000000000029300c000d00002272ad000d200022529d200d400022427d800da00022427da00dc00022529e000ec0002292cec00ee0002272aee00f000022529f000f20002292c00010e0102292c0e01100102242710011201022225120114010225292001220102292c2201240102272a240126010225292601280102242728012a0102292c2a012c0102272a2c012e010225292e01340102242709010e02026400000403780000040a000301000000640001c80000040100000000640001640000040100000000fa0004af00000401c80000040a00019600000414000501006400140005010000002c0104dc00000401fa0000040a0001c8000004140005d0076400140005d0070000c800029001f40105c201f4010a0005900114001400039001000005c201f4010500058403050032000584030000fa00049001000005c201f4010500058403c80032000584030500640005840300009001049001000005c201f4010500058403c80064000584030500c8000584030000f40105ac0d000404a00f00000a0004ac0d2003010004a00f0000280004ac0d9001010004a00f0000280002d00700040408070f0064000408070000c80003c800c8000e7d00c80019000e64000f0032000e78000000fa00032c01c8000ee100c80019000ec8000f0032000edc000000fa0003f401c8000ea901c80019000e90010f0032000ea4010000fa0001c8000004014b000000c800012c01000401c8000000c8000190010004012c010000c80002c800000404c8000f0064000496000000c80002c2010004045e010f006400042c010000640002c409000404c4096400960004f6090000f40102b80b000404b80b64002c0104f40b0000f401022003000004200300040a000420030000ea01029001000004900100040a000490010000900102d007000410d0076400960010d0070000c80058020000010001060400050001060800090001060a000b0001060c000d0001061000110001061400150001061800190001061a001b0001061c001d0001062000210001062400250001062800290001062a002b0001062c002d0001063000310001063400350001063800390001063a003b0001063c003d0001064000410001064400450001064800490001064a004b0001064c004d0001065000510001065400550001065800590001065a005b0001065c005d0001066000610001066400650001066800690001066a006b0001066c006d0001067000710001067400750001067800790001067a007b0001067c007d0001068000810001068400850001068800890001068a008b0001068c008d0001069000910001069400950001069800990001069a009b0001069c009d000106a000a1000106a400a5000106a800a9000106aa00ab000106ac00ad000106b000b1000106b400b5000106b800b9000106ba00bb000106bc00bd000106c000c1000106c400c5000106c800c9000106ca00cb000106cc00cd000106d000d1000106d400d5000106d800d9000106da00db000106dc00dd000106e000e1000106e400e5000106e800e9000106ea00eb000106ec00ed000106f000f1000106f400f5000106f800f9000106fa00fb000106fc00fd0001060001010101060401050101060801090101060a010b0101060c010d0101061001110101061401150101061801190101061a011b0101061c011d0101062001210101062401250101062801290101062a012b0101062c012d0101063001310101063401350101063801390101063a013b0101063c013d010106`; case "song10": case "Title":return hex`0078000408030300001c00010a006400f401640000040000000000000000000000000005000004660000000400012704000800012508001400012714001c00012a1c002800012728002c0001252c003000012430003400012734003800012a38004000012740004800012a48004a0001294a004c0001274c005400012554005600012756005800012a58005c00012c06001c00010a006400f4016400000400000000000000000000000000000000025a0000000200012908000a00012710001200012918001a00012c20002200012928002a00012730003200012538003a00012740004200012948004a00012750005200012958005a00012c5a005c00012a5c005e0001295e006000012709010e02026400000403780000040a000301000000640001c80000040100000000640001640000040100000000fa0004af00000401c80000040a00019600000414000501006400140005010000002c0104dc00000401fa0000040a0001c8000004140005d0076400140005d0070000c800029001f40105c201f4010a0005900114001400039001000005c201f4010500058403050032000584030000fa00049001000005c201f4010500058403c80032000584030500640005840300009001049001000005c201f4010500058403c80064000584030500c8000584030000f40105ac0d000404a00f00000a0004ac0d2003010004a00f0000280004ac0d9001010004a00f0000280002d00700040408070f0064000408070000c80003c800c8000e7d00c80019000e64000f0032000e78000000fa00032c01c8000ee100c80019000ec8000f0032000edc000000fa0003f401c8000ea901c80019000e90010f0032000ea4010000fa0001c8000004014b000000c800012c01000401c8000000c8000190010004012c010000c80002c800000404c8000f0064000496000000c80002c2010004045e010f006400042c010000640002c409000404c4096400960004f6090000f40102b80b000404b80b64002c0104f40b0000f401022003000004200300040a000420030000ea01029001000004900100040a000490010000900102d007000410d0076400960010d0070000c800c0000000010001060400050001060600070001060800090001060c000d0001061000110001061200130001061400150001061800190001061c001d0001061e001f0001062000210001062400250001062800290001062a002b0001062c002d0001063000310001063400350001063600370001063800390001063c003d0001064000410001064200430001064400450001064800490001064c004d0001064e004f0001065000510001065400550001065800590001065a005b0001065c005d000106`; + case "song12": + case "Treasure Island Theme":return hex`0078000408040200001c00010a006400f401640000040000000000000000000000000005000004420000001000012710002000012520003000012230004000012440005000012750005400012554005800012458006800012568006c0001246c007000012070008000012206001c00010a006400f401640000040000000000000000000000000000000002300000000400012a10001400012c20002400012730003400012940004400012a50005400012c600064000125700074000127`; + case "song13": + case "BoatBattle":return hex`0078000408060400001c00010a006400f401640000040000000000000000000000000005000004500100000200012702000400012504000600012208000a0001270a000c0001250c000e00012210001200012712001400012514001600012918001a0001271a001c0001251c001e00012920002200012722002400012524002600012228002a0001272a002c0001252c002e00012230003200012732003400012534003600012938003a0001273a003c0001253c003e00012940004200012742004400012544004600012248004a0001274a004c0001254c004e00012250005200012752005400012554005600012958005a0001275a005c0001255c005e00012960006200012762006400012564006600012268006a0001276a006c0001256c006e00012270007200012772007400012574007600012978007a0001277a007c0001257c007e00012980008200011488008a00011490009200011498009a000114a000a2000114a800aa000114b000b2000114b800ba00011405001c000f0a006400f4010a00000400000000000000000000000000000000024e0000002000012220004000011e40004200011448004a00011450005200011458005a00011460006200011468006a00011470007200011478007a0001149000a0000120a000b0000127b000c000012507001c00020a006400f401640000040000000000000000000000000000000003fc0000000200011108000a00011110001200011118001a00011120002200011128002a00011130003200011138003a00011140006000011960008000011880008200011682008400011284008600011186008800011288008a0001168a008c0001148c008e0001118e009000011290009200011692009400011294009600011196009800011298009a0001169a009c0001149c009e0001119e00a0000112a000a2000116a200a4000112a400a6000111a600a8000112a800aa000116aa00ac000114ac00ae000111ae00b0000112b000b2000116b200b4000112b400b6000111b600b8000112b800ba000116ba00bc000114bc00be000111be00c000011209010e02026400000403780000040a000301000000640001c80000040100000000640001640000040100000000fa0004af00000401c80000040a00019600000414000501006400140005010000002c0104dc00000401fa0000040a0001c8000004140005d0076400140005d0070000c800029001f40105c201f4010a0005900114001400039001000005c201f4010500058403050032000584030000fa00049001000005c201f4010500058403c80032000584030500640005840300009001049001000005c201f4010500058403c80064000584030500c8000584030000f40105ac0d000404a00f00000a0004ac0d2003010004a00f0000280004ac0d9001010004a00f0000280002d00700040408070f0064000408070000c80003c800c8000e7d00c80019000e64000f0032000e78000000fa00032c01c8000ee100c80019000ec8000f0032000edc000000fa0003f401c8000ea901c80019000e90010f0032000ea4010000fa0001c8000004014b000000c800012c01000401c8000000c8000190010004012c010000c80002c800000404c8000f0064000496000000c80002c2010004045e010f006400042c010000640002c409000404c4096400960004f6090000f40102b80b000404b80b64002c0104f40b0000f401022003000004200300040a000420030000ea01029001000004900100040a000490010000900102d007000410d0076400960010d0070000c80020010000010001040400050001060800090001040c000d0001061000110001041400150001061800190001041c001d0001062000210001042400250001062800290001042c002d0001063000310001043400350001063800390001043c003d0001064000410001044400450001064800490001044c004d0001065000510001045400550001065800590001045c005d0001066000610001046400650001066800690001046c006d0001067000710001047400750001067800790001047c007d0001068000810001048400850001068800890001048c008d0001069000910001049400950001069800990001049c009d000106a000a1000104a400a5000106a800a9000104ac00ad000106b000b1000104b400b5000106b800b9000104bc00bd000106`; } return null; }) diff --git a/main.ts b/main.ts index 8dbb15c..46e4105 100644 --- a/main.ts +++ b/main.ts @@ -35,7 +35,7 @@ const playerState = { currentIsland: '' } -const version: string = 'v0.12' +const version: string = 'v1.0' const debugMode: boolean = false let currentState: States diff --git a/treasureIsland.ts b/treasureIsland.ts index b5db149..6406f64 100644 --- a/treasureIsland.ts +++ b/treasureIsland.ts @@ -12,7 +12,9 @@ namespace TreasureIsland { export function init() { scene.setBackgroundColor(9) - // scene.setBackgroundImage(assets.image`Treasarr Island`) + + music.play(music.createSong(assets.song`Treasure Island Theme`), music.PlaybackMode.LoopingInBackground) + island = sprites.create(assets.image`Treasarr Island`) island.x = 80 island.y = 60 @@ -77,6 +79,8 @@ namespace TreasureIsland { scene.setBackgroundColor(0) scene.setBackgroundImage(assets.image`empty`) + + music.stopAllSounds() } function touchTreasure({ pirate }: AttackCallbackParams) {