diff --git a/cmd/krampus19/levelselect.go b/cmd/krampus19/levelselect.go index 342c96a..0c0e118 100644 --- a/cmd/krampus19/levelselect.go +++ b/cmd/krampus19/levelselect.go @@ -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) }) } diff --git a/cmd/krampus19/res/levels/empty.txt b/cmd/krampus19/res/levels/empty.txt new file mode 100644 index 0000000..fde7f6f --- /dev/null +++ b/cmd/krampus19/res/levels/empty.txt @@ -0,0 +1,11 @@ +level: +._._._._._._._._._._ +._._._._._._._._._._ +._._._._._._._._._._ +._._._._._._._._._._ +._._._._._._._._._._ +._._._._._._._._._._ +._._._._._._._._._._ +._._._._._._._._._._ +._._._._._._._._._._ +:level \ No newline at end of file diff --git a/cmd/krampus19/res/levels/pack1.txt b/cmd/krampus19/res/levels/pack1.txt index 9783ea4..c9f7bf6 100644 --- a/cmd/krampus19/res/levels/pack1.txt +++ b/cmd/krampus19/res/levels/pack1.txt @@ -6,8 +6,16 @@ level: id: 1 :level +level: +id: 3 +:level + level: id: 2 :level +level: +id: 4 +:level + :levels \ No newline at end of file diff --git a/cmd/krampus19/res/levels/pack1_level3.txt b/cmd/krampus19/res/levels/pack1_level3.txt new file mode 100644 index 0000000..05f24d2 --- /dev/null +++ b/cmd/krampus19/res/levels/pack1_level3.txt @@ -0,0 +1,11 @@ +level: +._._._._._._._._._._ +._._._._._._._._._._ +._~_#_#_#_#B#_._._._ +._~_#B#_#_._#_._._._ +._~_._#_~_#_#_._._._ +._#X._#_~_#_._._._._ +._._#_#B#_#_._._._._ +._._#@#_._._._._._._ +._._._._._._._._._._ +:level \ No newline at end of file diff --git a/cmd/krampus19/res/levels/pack1_level4.txt b/cmd/krampus19/res/levels/pack1_level4.txt new file mode 100644 index 0000000..503fd94 --- /dev/null +++ b/cmd/krampus19/res/levels/pack1_level4.txt @@ -0,0 +1,16 @@ +level: +._._._._._._._._._._._._ +._._#_#_._._._._._._._._ +._._#_#B#_#B#@#_#_._._._ +._._#_#_#_#_#B#_#_._._._ +._._._._._._#_._._._._._ +._._._._._._#_._._._._._ +._._._._._._#B._._._._._ +._._._#_#_._#_._#_#_._._ +._#_#_#_#_~_#_#_#_#_#_._ +._#_._._#_._#_._#_._#_._ +._#_._#X~_._~_._~_._#_._ +._#_._._#_._#_._#_._#_._ +._#_#_#_#_#_~_#_#_#_#_._ +._._._._._._._._._._._._ +:level \ No newline at end of file