aboutsummaryrefslogtreecommitdiff
path: root/go/client/challenges.go
diff options
context:
space:
mode:
Diffstat (limited to 'go/client/challenges.go')
-rw-r--r--go/client/challenges.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/go/client/challenges.go b/go/client/challenges.go
index ca6e3563..6956282b 100644
--- a/go/client/challenges.go
+++ b/go/client/challenges.go
@@ -4,6 +4,7 @@ import (
"github.com/hajimehoshi/ebiten/v2"
"muhq.space/muhqs-game/go/activities"
"muhq.space/muhqs-game/go/game"
+ "muhq.space/muhqs-game/go/ui"
)
var availChallenges = map[string]func(string) *game.LocalState{
@@ -21,11 +22,11 @@ type challenges struct {
func newChallengesMenu(app *app, playerName string) *challenges {
var m *challenges
- labels := []string{}
- handlers := []func(){}
+ labels := make([]string, 0, len(availChallenges))
+ handlers := make([]func(*ui.SimpleButton), 0, len(availChallenges))
for k, start := range availChallenges {
labels = append(labels, k)
- handlers = append(handlers, func() {
+ handlers = append(handlers, func(*ui.SimpleButton) {
s := start(m.playerName)
m.startChallenge(s)
})