Added 2 levels.

This commit is contained in:
Sander Schobers 2019-12-29 18:11:04 +01:00
parent 3fb808ba78
commit 6eed028d82
5 changed files with 51 additions and 5 deletions

View File

@ -19,15 +19,15 @@ func (s *levelSelect) Enter(ctx *Context) error {
s.ctx = ctx
s.pack = s.ctx.Levels[s.packID]
s.Init()
name := func(id string, steps int) string {
name := func(i int, steps int) string {
if steps == 0 {
return fmt.Sprintf("Level %s", id)
return fmt.Sprintf("Level %d", i)
}
return fmt.Sprintf("Level %s (%d)", id, steps)
return fmt.Sprintf("Level %d (%d)", i, steps)
}
for _, id := range s.pack.order {
for i, id := range s.pack.order {
levelID := id
s.Add(name(levelID, s.ctx.Progress.Level(s.packID, levelID).Steps), func() {
s.Add(name(i+1, s.ctx.Progress.Level(s.packID, levelID).Steps), func() {
s.ctx.Navigation.PlayLevel(s.packID, levelID)
})
}

View File

@ -0,0 +1,11 @@
level:
._._._._._._._._._._
._._._._._._._._._._
._._._._._._._._._._
._._._._._._._._._._
._._._._._._._._._._
._._._._._._._._._._
._._._._._._._._._._
._._._._._._._._._._
._._._._._._._._._._
:level

View File

@ -6,8 +6,16 @@ level:
id: 1
:level
level:
id: 3
:level
level:
id: 2
:level
level:
id: 4
:level
:levels

View File

@ -0,0 +1,11 @@
level:
._._._._._._._._._._
._._._._._._._._._._
._~_#_#_#_#B#_._._._
._~_#B#_#_._#_._._._
._~_._#_~_#_#_._._._
._#X._#_~_#_._._._._
._._#_#B#_#_._._._._
._._#@#_._._._._._._
._._._._._._._._._._
:level

View File

@ -0,0 +1,16 @@
level:
._._._._._._._._._._._._
._._#_#_._._._._._._._._
._._#_#B#_#B#@#_#_._._._
._._#_#_#_#_#B#_#_._._._
._._._._._._#_._._._._._
._._._._._._#_._._._._._
._._._._._._#B._._._._._
._._._#_#_._#_._#_#_._._
._#_#_#_#_~_#_#_#_#_#_._
._#_._._#_._#_._#_._#_._
._#_._#X~_._~_._~_._#_._
._#_._._#_._#_._#_._#_._
._#_#_#_#_#_~_#_#_#_#_._
._._._._._._._._._._._._
:level