Noah Petherbridge
640e75ba4d
* You can now browse for a custom wallpaper image to use with your levels. A platform-native file picker dialog is used (no WASM support) * In the New/Edit Level Properties dialog, the Wallpaper drop-down includes an option to browse for a custom map. * When editing an existing level: the wallpaper takes effect immediately in your level once the file is picked. For NEW levels, the wallpaper will appear once the "Continue" button is pressed. * All common image types supported: png, jpeg, gif. * The wallpaper is embedded in the level using the filepath "assets/wallpapers/custom.b64img" as a Base64-encoded blob of the image data. * The `doodad show` command will list the names and sizes of files embedded in levels. `doodad show --attachment <name>` will get an attachment and print it to the console window. * To extract a wallpaper image from a level: `doodad show -a assets/wallpapers/custom.b64img | base64 -d > out.png`
69 lines
1.5 KiB
Go
69 lines
1.5 KiB
Go
package balance
|
|
|
|
// Numbers.
|
|
var (
|
|
// Window dimensions.
|
|
Width = 1024
|
|
Height = 768
|
|
|
|
// Speed to scroll a canvas with arrow keys in Edit Mode.
|
|
CanvasScrollSpeed = 8
|
|
|
|
// Window scrolling behavior in Play Mode.
|
|
// DEPRECATED: pixels close to window edges
|
|
ScrollboxHoz = 256 // horizontal px from window border to start scrol
|
|
ScrollboxVert = 160
|
|
// NEW: set scrollbox bounds by percents
|
|
ScrollboxHozPercent float64 = 0.25
|
|
ScrollboxVertPercent float64 = 0.40
|
|
|
|
// 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"
|
|
)
|
|
|
|
// Edit Mode Values
|
|
var (
|
|
// Number of Doodads per row in the palette.
|
|
UIDoodadsPerRow = 2
|
|
)
|