2018-08-17 03:37:19 +00:00
|
|
|
package balance
|
|
|
|
|
|
|
|
// Numbers.
|
|
|
|
var (
|
2018-10-08 17:38:49 +00:00
|
|
|
// Window dimensions.
|
|
|
|
Width = 1024
|
|
|
|
Height = 768
|
|
|
|
|
2018-08-17 03:37:19 +00:00
|
|
|
// Speed to scroll a canvas with arrow keys in Edit Mode.
|
2019-12-28 03:16:34 +00:00
|
|
|
CanvasScrollSpeed = 8
|
2018-09-23 22:20:45 +00:00
|
|
|
|
2019-04-10 01:28:08 +00:00
|
|
|
// Window scrolling behavior in Play Mode.
|
2020-01-03 04:23:27 +00:00
|
|
|
ScrollboxHoz = 256 // horizontal px from window border to start scrol
|
|
|
|
ScrollboxVert = 128
|
2019-04-10 01:28:08 +00:00
|
|
|
|
|
|
|
// Player speeds
|
2020-04-05 04:00:32 +00:00
|
|
|
PlayerMaxVelocity float64 = 6
|
|
|
|
PlayerAcceleration float64 = 0.2
|
|
|
|
Gravity float64 = 6
|
2020-04-12 02:21:12 +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
|
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
|
|
|
|
)
|