From c8dc02b64b4a37caf994bcca74b4a68c01f768be Mon Sep 17 00:00:00 2001 From: Chris Weed Date: Thu, 18 Jul 2024 22:03:48 -0500 Subject: [PATCH] Rest animation --- images.g.ts | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++ win.ts | 31 +++++++++++++++++++++++- 2 files changed, 100 insertions(+), 1 deletion(-) diff --git a/images.g.ts b/images.g.ts index 924bf11..015379f 100644 --- a/images.g.ts +++ b/images.g.ts @@ -3136,6 +3136,76 @@ d d e e e 6 6 6 6 6 6 6 e e d d . . . 9 6 6 9 9 9 9 9 6 6 6 . . . . . 9 6 9 9 9 9 9 9 9 9 9 . . . . . 9 9 9 9 9 9 9 9 9 . . . . +`]; + case "Pirate Rest": + case "anim8":return [img` +. . . . . . . . . . . . . . . . +. . . . . . . . . . . . . . . . +. . . . . . . . . . . . . . . . +. . . . . . . . . . . . . . . . +. . . . . . . . . . . . e e . . +. . . . . . . . e e e e c e e . +. . . . . . . . e e e e e c . . +. . . . . . . . f d d d e e e e +. . . . . . . . d f d f d f f . +. . . . . . . . d d b d d d b d +. . . . . . . . . d d d d b d d +. . . a . . . . c c d d d e e . +. . a a a . . c e e e c c c e e +f a a a a a e e e e e e e e e e +f a f c a e e e e e e c e e e . +f f c c c c e e e e e . . . . . +`, img` +. . . . . . . . . . . . . . . . +. . . . . . . . . . . . . . . . +. . . . . . . . . . . . . . . . +. . . . . . . . . . . . . . . . +. . . . . . . . e e . . e e . . +. . . . . . . . e e e e c e e . +. . . . . . . . . e e e e c . . +. . . . . . . . f d d d e e e e +. . . . . . . . d f d f d f f . +. . . . . . . . d d b d d d b d +. . . . . . . . . d d d d b d d +. . . a . . . . c c d d d e e . +. . a a a . . c e e e c c c e e +f a a a a a e e e e e e e e e e +f a f c a e e e e e e c e e e . +f f c c c c e e e e e . . . . . +`, img` +. . . . . . . . . . . . . . . . +. . . . . . . . . . . . . . . . +. . . . . . . . . . . . . . . . +. . . . . . . . . . . . . . . . +. . . . . . . . . . . . . . . . +. . . . . . . . e e . . e e . . +. . . . . . . . e e e e c e e . +. . . . . . . . . e e e e c . . +. . . . . . . . f d d d e e e e +. . . . . . . . d f d f d f f . +. . . . . . . . d d b d d d b d +. . . a . . . c e d d d d b d d +. . a a a . c e e e d d d c e e +f a a a a a e e e e e e e e e e +f a f c a e e e e e e c e e e . +f f c c c c e e e e e . . . . . +`, img` +. . . . . . . . . . . . . . . . +. . . . . . . . . . . . . . . . +. . . . . . . . . . . . . . . . +. . . . . . . . . . . . . . . . +. . . . . . . . . . . . . . . . +. . . . . . . . . . . . e e . . +. . . . . . . . e e e e c e e . +. . . . . . . . e e e e e c . . +. . . . . . . . f d d d e e e e +. . . . . . . . d f d f d f f . +. . . . . . . . d d b d d d b d +. . . a . . . c e d d d d b d d +. . a a a . c e e e d d d c e e +f a a a a a e e e e e e e e e e +f a f c a e e e e e e c e e e . +f f c c c c e e e e e . . . . . `]; } return null; diff --git a/win.ts b/win.ts index d867f91..fbd308e 100644 --- a/win.ts +++ b/win.ts @@ -2,6 +2,10 @@ namespace Win { let _title: Sprite let _totals: Sprite + let restingPlayer1: Sprite + let restingPlayer2: Sprite + let restingPlayer1Animation: Image[] = assets.animation`Pirate Rest` + let restingPlayer2Animation: Image[] = Utils.flipAnimation(Utils.swapAnimationColors(assets.animation`Pirate Rest`, 14, 4)) let island: Sprite let waves: Sprite[] = [] @@ -18,6 +22,28 @@ namespace Win { island.y = 60 island.z = 1 + restingPlayer1 = sprites.create(restingPlayer1Animation[0]) + restingPlayer2 = sprites.create(restingPlayer2Animation[0]) + restingPlayer1.x = 86 + restingPlayer1.y = 62 + restingPlayer1.z = 3 + restingPlayer2.x = 104 + restingPlayer2.y = 67 + restingPlayer2.z = 3 + animation.runImageAnimation( + restingPlayer1, + restingPlayer1Animation, + 500, + true + ) + pause(100) + animation.runImageAnimation( + restingPlayer2, + restingPlayer2Animation, + 500, + true + ) + Utils.getArrayOfLength(10).forEach(() => { const wave = sprites.create(assets.animation`wave`[0]) animation.runImageAnimation( @@ -36,7 +62,7 @@ namespace Win { _title = textsprite.create('Arrgh! Ye be pirates!', 1, 15) _title.x = 80 - _title.y = 78 + _title.y = 100 _title.z = 120 _totals = textsprite.create(totalRiches + '') @@ -54,6 +80,9 @@ namespace Win { island.destroy() waves.forEach(wave => wave.destroy()) + restingPlayer1.destroy() + restingPlayer2.destroy() + controller.player1.A.removeEventListener(ControllerButtonEvent.Pressed, game.reset) } }