Noah Petherbridge
1ac85c9297
* New Doodad: Checkpoint Flag. They update the player's spawn point whenever the player passes one. The most recently activated checkpoint is rendered brighter than the others. * End Level Modal: the fake alert box window drawn by the Play Mode is replaced with a fancy modal widget (similar to Alert and Confirm). It handles level victory or failure conditions and can show or hide all the buttons as needed. * Gameplay: There is a "Retry from Checkpoint" option added, which appears in the level failure modal. It will teleport you back to the Start Flag or the last Checkpoint Flag you had touched, without resetting the level -- your keys, unlocked doors, etc. will be preserved so you can retry. * Set a maximum speed on the "Camera Follows Actor" logic of 64 pixels per tick. This results in a smoother scrolling transition when the player jumps to a new location on the map, such as by a Warp Door. * Update the default color palettes: * All: Add a "hint" magenta color. * Colored Pencil: Add a "darkstone" solid color. Updates to the Doodads JavaScript API: * SetCheckpoint(Point(x, y)): set the player character's spawn position. Giving it Self.Position() is an easy way to set the player spawn to your doodad's location.
77 lines
1.7 KiB
Go
77 lines
1.7 KiB
Go
package balance
|
|
|
|
import "git.kirsle.net/go/render"
|
|
|
|
// Numbers.
|
|
var (
|
|
// Window dimensions.
|
|
Width = 1024
|
|
Height = 768
|
|
|
|
// Speed to scroll a canvas with arrow keys in Edit Mode.
|
|
CanvasScrollSpeed = 8
|
|
FollowActorMaxScrollSpeed = 64
|
|
|
|
// Window scrolling behavior in Play Mode.
|
|
ScrollboxOffset = render.Point{ // from center of screen
|
|
X: 60,
|
|
Y: 100,
|
|
}
|
|
|
|
// Player speeds
|
|
PlayerMaxVelocity float64 = 6
|
|
PlayerAcceleration float64 = 0.9
|
|
Gravity float64 = 6
|
|
GravityAcceleration float64 = 0.2
|
|
SlopeMaxHeight = 8 // max pixel height for player to walk up a slope
|
|
|
|
// Default chunk size for canvases.
|
|
ChunkSize = 128
|
|
|
|
// Default size for a new Doodad.
|
|
DoodadSize = 100
|
|
|
|
// Size of Undo/Redo history for map editor.
|
|
UndoHistory = 20
|
|
|
|
// Options for brush size.
|
|
BrushSizeOptions = []int{
|
|
0,
|
|
1,
|
|
2,
|
|
4,
|
|
8,
|
|
16,
|
|
24,
|
|
32,
|
|
48,
|
|
64,
|
|
}
|
|
DefaultEraserBrushSize = 8
|
|
MaxEraserBrushSize = 32 // the bigger, the slower
|
|
|
|
// Default player character doodad in Play Mode.
|
|
PlayerCharacterDoodad = "boy.doodad"
|
|
|
|
// Level name for the title screen.
|
|
DemoLevelName = "Tutorial 3.level"
|
|
|
|
// Level attachment filename for the custom wallpaper.
|
|
// NOTE: due to hard-coded "assets/wallpapers/" prefix in uix/canvas.go#LoadLevel.
|
|
CustomWallpaperFilename = "custom.b64img"
|
|
CustomWallpaperEmbedPath = "assets/wallpapers/custom.b64img"
|
|
|
|
// Publishing: Doodads-embedded-within-levels.
|
|
EmbeddedDoodadsBasePath = "assets/doodads/"
|
|
EmbeddedWallpaperBasePath = "assets/wallpapers/"
|
|
|
|
// File formats: save new levels and doodads gzip compressed
|
|
CompressDrawings = true
|
|
)
|
|
|
|
// Edit Mode Values
|
|
var (
|
|
// Number of Doodads per row in the palette.
|
|
UIDoodadsPerRow = 2
|
|
)
|