diff options
author | davidovski <david@davidovski.xyz> | 2024-04-23 19:05:02 +0100 |
---|---|---|
committer | davidovski <david@davidovski.xyz> | 2024-04-23 19:05:02 +0100 |
commit | a77fc96b2e5f125d5bb0e920fe60d8111f9a2b69 (patch) | |
tree | 28409fc37861b1698ddf0669a8e77083e490e691 | |
parent | 69db833ebae7a426fb60d117c67f0b83632618d8 (diff) |
add final level
-rw-r--r-- | TODO | 2 | ||||
-rw-r--r-- | level.go | 94 | ||||
-rwxr-xr-x | levelgen.py | 47 | ||||
-rw-r--r-- | main.go | 12 | ||||
-rw-r--r-- | objects.go | 2 |
5 files changed, 139 insertions, 18 deletions
@@ -7,7 +7,7 @@ - [ ] add an actual ending - [ ] animateExit - [x] add voiceover -- [ ] add more levels +- [x] add more levels - [x] add more items - [x] add << and || on pause and play - [x] add menu @@ -298,7 +298,7 @@ func StartLevel6(g *Game) { g.QueueState(levelStart) - g.audioPlayer.voiceAudio[6].Play() + g.audioPlayer.voiceAudio[9].Play() g.toPlace = append(g.toPlace, NewHPlatform(g, 0, 0)) g.toPlace = append(g.toPlace, NewHPlatform(g, 0, 0)) @@ -376,6 +376,7 @@ func StartLevel7(g *Game) { g.toPlace = append(g.toPlace, NewRightSideSpring(g, 0, 0)) g.toPlace = append(g.toPlace, NewSpring(g, 0, 0)) + g.audioPlayer.voiceAudio[6].Play() // after end g.QueueState(ReverseLevel) // after reversed @@ -396,6 +397,7 @@ func StartLevel8(g *Game) { g.exit.x = 5 * tileSize g.exit.y = 1 * tileSize + g.audioPlayer.voiceAudio[7].Play() // after end g.QueueState(ReverseLevel) @@ -403,5 +405,93 @@ func StartLevel8(g *Game) { g.QueueState(func (g *Game){ afterReversed(g) }) - g.QueueState(StartLevel7) + g.QueueState(StartLevelFinal) +} +func StartLevelFinal(g *Game) { + g.SetPlacing() + //noMoveable(g) + + g.ClearAll() + tilemap := NewTilemap([][]int{ + { +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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, 0, 0, +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +0, 0, 0, 0, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 0, 0, 0, 0, 0, +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}, + + }, 25) + + g.tilemap = &tilemap + g.tilemap.UpdateSurface() + g.player.startx = 5 * tileSize + g.player.starty = 11 * tileSize + + g.exit.startx = 17 * tileSize + g.exit.starty = 11 * tileSize + g.exit.movable = true + + g.ResetAll() + g.playerAi = g.playerAi[:0] + + g.QueueState(levelStart) + + //g.audioPlayer.voiceAudio[3].Play() + g.toPlace = append(g.toPlace, NewBox(g, 0, 0)) + g.toPlace = append(g.toPlace, NewRightSideSpring(g, 0, 0)) + g.toPlace = append(g.toPlace, NewSpring(g, 0, 0)) + g.toPlace = append(g.toPlace, NewLeftSideSpring(g, 0, 0)) + g.toPlace = append(g.toPlace, NewVPlatform(g, 0, 0)) + + g.audioPlayer.voiceAudio[10].Play() + // after end + g.QueueState(ReverseLevel) + // after reversed + g.QueueState(afterReversed) + g.QueueState(StartLevelFinalMore) +} +func StartLevelFinalMore(g *Game) { + g.SetPlacing() + g.toPlace = append(g.toPlace, NewBox(g, 0, 0)) + g.toPlace = append(g.toPlace, NewSpring(g, 0, 0)) + g.toPlace = append(g.toPlace, NewSpike(g, 0, 0)) + + // after end + g.QueueState(ReverseLevel) + + // after reversed + g.QueueState(func (g *Game){ + afterReversed(g) + }) + g.QueueState(StartLevelFinalMore) } diff --git a/levelgen.py b/levelgen.py index 7e2e270..a17afd8 100755 --- a/levelgen.py +++ b/levelgen.py @@ -1,24 +1,43 @@ #!/usr/bin/env python array = [ - "#########################", - "#########################", - "#########################", - "#########################", - "#########################", - "#########################", - "#########################", " ", " ", " ", - " ##### ##### ", - " ##### ## ##### ", - " ##### ## ##### ", - " ##### ## ##### ", - " ##### ## ##### ", - " ##### ## ##### ", - " ##### ## ##### ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ###", + " ###", + "#### #####", + "#### #####", + "#### #####", + "#########################", + "#########################", ] #array = [ +# "#########################", +# "#########################", +# "#########################", +# "#########################", +# "#########################", +# "#########################", +# "#########################", +# " ", +# " ", +# " ", +# " ##### ##### ", +# " ##### ## ##### ", +# " ##### ## ##### ", +# " ##### ## ##### ", +# " ##### ## ##### ", +# " ##### ## ##### ", +# " ##### ## ##### ", +# ] +#array = [ # " ", # " ", # " ", @@ -111,6 +111,14 @@ var ( voice6Ogg_src []byte //go:embed assets/vo/voice7.ogg voice7Ogg_src []byte + //go:embed assets/vo/voice8.ogg + voice8Ogg_src []byte + //go:embed assets/vo/voice9.ogg + voice9Ogg_src []byte + //go:embed assets/vo/voice10.ogg + voice10Ogg_src []byte + //go:embed assets/vo/voice11.ogg + voice11Ogg_src []byte ) var ( @@ -894,6 +902,10 @@ func (g *Game) LoadAudio() { voice5Ogg_src, voice6Ogg_src, voice7Ogg_src, + voice8Ogg_src, + voice9Ogg_src, + voice10Ogg_src, + voice11Ogg_src, }, g.audioPlayer.audioContext) } @@ -380,7 +380,7 @@ func NewExit(game *Game, x, y float32) *GameObject{ exit := NewObject(game, x, y) exit.images = []*ebiten.Image{ - tilesImage.SubImage(image.Rect(0, 16, 31, 48)).(*ebiten.Image), + tilesImage.SubImage(image.Rect(0, 16, 32, 48)).(*ebiten.Image), } exit.onCollideUp = OnCollideExit exit.onCollideDown = OnCollideExit |