2018-08-17 03:37:19 +00:00
|
|
|
package balance
|
|
|
|
|
2021-10-05 02:51:31 +00:00
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"git.kirsle.net/go/render"
|
|
|
|
)
|
2021-06-14 03:25:42 +00:00
|
|
|
|
2018-08-17 03:37:19 +00:00
|
|
|
// Numbers.
|
|
|
|
var (
|
2018-10-08 17:38:49 +00:00
|
|
|
// Window dimensions.
|
|
|
|
Width = 1024
|
|
|
|
Height = 768
|
|
|
|
|
2021-12-24 05:11:45 +00:00
|
|
|
// Title screen height needed for the main menu. Phones in landscape
|
|
|
|
// mode will switch to the horizontal layout if less than this height.
|
|
|
|
TitleScreenResponsiveHeight = 600
|
|
|
|
|
2018-08-17 03:37:19 +00:00
|
|
|
// Speed to scroll a canvas with arrow keys in Edit Mode.
|
2021-08-16 03:17:53 +00:00
|
|
|
CanvasScrollSpeed = 8
|
|
|
|
FollowActorMaxScrollSpeed = 64
|
2018-09-23 22:20:45 +00:00
|
|
|
|
2019-04-10 01:28:08 +00:00
|
|
|
// Window scrolling behavior in Play Mode.
|
2021-06-14 03:25:42 +00:00
|
|
|
ScrollboxOffset = render.Point{ // from center of screen
|
2021-08-12 03:40:31 +00:00
|
|
|
X: 60,
|
2021-10-05 02:51:31 +00:00
|
|
|
Y: 60,
|
2021-06-14 03:25:42 +00:00
|
|
|
}
|
2019-04-10 01:28:08 +00:00
|
|
|
|
|
|
|
// Player speeds
|
2021-10-08 01:24:18 +00:00
|
|
|
PlayerMaxVelocity float64 = 7
|
2021-10-08 03:50:24 +00:00
|
|
|
PlayerJumpVelocity float64 = -23
|
2021-10-08 01:24:18 +00:00
|
|
|
PlayerAcceleration float64 = 0.12
|
2021-10-08 01:49:09 +00:00
|
|
|
Gravity float64 = 7
|
2021-10-08 01:24:18 +00:00
|
|
|
GravityAcceleration float64 = 0.1
|
2021-06-13 21:53:21 +00:00
|
|
|
SlopeMaxHeight = 8 // max pixel height for player to walk up a slope
|
2019-04-10 01:28:08 +00:00
|
|
|
|
2018-09-23 22:20:45 +00:00
|
|
|
// Default chunk size for canvases.
|
2018-10-18 06:01:21 +00:00
|
|
|
ChunkSize = 128
|
2018-09-26 17:04:46 +00:00
|
|
|
|
|
|
|
// Default size for a new Doodad.
|
|
|
|
DoodadSize = 100
|
2019-07-03 23:22:30 +00:00
|
|
|
|
|
|
|
// Size of Undo/Redo history for map editor.
|
|
|
|
UndoHistory = 20
|
Eraser Tool, Brush Sizes
* Implement Brush Sizes for drawtool.Stroke and add a UI to the tools panel
to control the brush size.
* Brush sizes: 1, 2, 4, 8, 16, 24, 32, 48, 64
* Add the Eraser Tool to editor mode. It uses a default brush size of 16
and a max size of 32 due to some performance issues.
* The Undo/Redo system now remembers the original color of pixels when
you change them, so that Undo will set them back how they were instead
of deleting the pixel entirely. Due to performance issues, this only
happens when your Brush Size is 0 (drawing single-pixel shapes).
* UI: Add an IntVariable option to ui.Label to bind showing the value of
an int reference.
Aforementioned performance issues:
* When we try to remember whole rects of pixels for drawing thick
shapes, it requires a ton of scanning for each step of the shape. Even
de-duplicating pixel checks, tons of extra reads are constantly
checked.
* The Eraser is the only tool that absolutely needs to be able to
remember wiped pixels AND have large brush sizes. The performance
sucks and lags a bit if you erase a lot all at once, but it's a
trade-off for now.
* So pixels aren't remembered when drawing lines in your level with
thick brushes, so the Undo action will simply delete your pixels and not
reset them. Only the Eraser can bring back pixels.
2019-07-12 02:07:46 +00:00
|
|
|
|
|
|
|
// Options for brush size.
|
|
|
|
BrushSizeOptions = []int{
|
|
|
|
0,
|
|
|
|
1,
|
|
|
|
2,
|
|
|
|
4,
|
|
|
|
8,
|
|
|
|
16,
|
|
|
|
24,
|
|
|
|
32,
|
|
|
|
48,
|
|
|
|
64,
|
|
|
|
}
|
|
|
|
DefaultEraserBrushSize = 8
|
|
|
|
MaxEraserBrushSize = 32 // the bigger, the slower
|
2020-09-19 05:35:43 +00:00
|
|
|
|
2022-01-03 06:36:32 +00:00
|
|
|
// Interval for auto-save in the editor
|
|
|
|
AutoSaveInterval = 5 * time.Minute
|
|
|
|
|
2020-09-19 05:35:43 +00:00
|
|
|
// Default player character doodad in Play Mode.
|
|
|
|
PlayerCharacterDoodad = "boy.doodad"
|
|
|
|
|
2022-01-03 06:36:32 +00:00
|
|
|
// Level names for the title screen.
|
|
|
|
DemoLevelName = []string{
|
|
|
|
"Tutorial 1.level",
|
|
|
|
"Tutorial 2.level",
|
|
|
|
"Tutorial 3.level",
|
|
|
|
}
|
2021-06-07 01:59:04 +00:00
|
|
|
|
|
|
|
// Level attachment filename for the custom wallpaper.
|
|
|
|
// NOTE: due to hard-coded "assets/wallpapers/" prefix in uix/canvas.go#LoadLevel.
|
2021-06-13 21:53:21 +00:00
|
|
|
CustomWallpaperFilename = "custom.b64img"
|
2021-06-07 01:59:04 +00:00
|
|
|
CustomWallpaperEmbedPath = "assets/wallpapers/custom.b64img"
|
2021-06-13 21:53:21 +00:00
|
|
|
|
|
|
|
// Publishing: Doodads-embedded-within-levels.
|
|
|
|
EmbeddedDoodadsBasePath = "assets/doodads/"
|
|
|
|
EmbeddedWallpaperBasePath = "assets/wallpapers/"
|
2021-07-14 02:23:09 +00:00
|
|
|
|
|
|
|
// File formats: save new levels and doodads gzip compressed
|
|
|
|
CompressDrawings = true
|
2021-10-05 02:51:31 +00:00
|
|
|
|
|
|
|
// Play Mode Touchscreen controls.
|
|
|
|
PlayModeIdleTimeout = 2200 * time.Millisecond
|
|
|
|
PlayModeAlphaStep = 8 // 0-255 alpha, steps per tick for fade in
|
|
|
|
PlayModeAlphaMax = 220
|
2018-08-17 03:37:19 +00:00
|
|
|
)
|
2018-10-20 22:42:49 +00:00
|
|
|
|
|
|
|
// Edit Mode Values
|
|
|
|
var (
|
|
|
|
// Number of Doodads per row in the palette.
|
|
|
|
UIDoodadsPerRow = 2
|
|
|
|
)
|