Skip to content

Commit

Permalink
Rest animation
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikketer committed Jul 19, 2024
1 parent 71b5121 commit c8dc02b
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 1 deletion.
70 changes: 70 additions & 0 deletions images.g.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
31 changes: 30 additions & 1 deletion win.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = []

Expand All @@ -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(
Expand All @@ -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 + '')
Expand All @@ -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)
}
}

0 comments on commit c8dc02b

Please sign in to comment.