GitHubНачать

Эта страница ещё не переведена на русский язык, поэтому ниже показан английский оригинал.

Руководства

The puzzle2d template

A spark slides until a wall stops it and lights every lamp it passes; lighting all of a level's lamps within its moves wins the level, and a slide into a void or running out of moves loses it. Because the HUD, board and bottom bar stack vertically, the root scope requests portrait orientation on phones (cx.RequestOrientation(core.OrientationPortrait)). The template shows how a puzzle game grows: the rules in board.go, where each move is an undo.History move that undoes and redoes exactly; the levels in levels.yaml, a versioned YAML file with unknown fields refused and a canonical form, which levels.go reads and writes; the input map in game.yaml, bound into input.Actions with swipes from input.GestureRecognizer; moves animated with tween on a fixed-step game.Loop; and the stars of each level kept with save. To change the game, add or edit levels in levels.yaml, whose tests check that every level can be won in its par; run go tool game playtest to verify solvability, difficulty order, unintended shortcuts and moves over par through playtest.yaml and playtest_test.go; rebind the controls in game.yaml; add a tile in board.go and draw it in draw.go. The template's README lists the controls, the level format and every file.

Saving progress

Spark Slide saves the best stars earned on each level. If the stored progress came from a newer game version or cannot be recovered, Spark Slide keeps the existing save and lets you play for the current session. The notice stays visible on the level select and while playing. Update the game to open a newer save.

If a write fails, your stars remain available while the game is open. Free up space if storage is full, then choose Retry save to write your current progress. Save details shows the slot error, game version and build and lets you copy them for support. The English and Chinese notice text lives in strings/.

Редактировать страницу