Noah Petherbridge
489a43ea8c
The game can now be played using only a touch screen! The left mouse click (Button1) can now move and control the player character. * A box in the very middle of the screen is the "Use" button and a deadzone for directional inputs. * Anywhere outside the middle and to the left registers a Left button, to the right a Right button, above the top of the middle is a Jump button, and below the bottom of the middle is a down input (for antigravity mode). * Tight platforming is possible: above and below the middle box, the left/right split is tight in the middle of the window. You can get tight jumps if jumping or go below if you don't want to jump. The left/right deadzone is only over the space of the Use button. If the player is idle for a while with no controller inputs, some hints will fade in about the touch controls. Note: the ScrollboxOffset to track the player character is changed to 60,60 from 60,100 so the camera will track tighter to the player and so the player will mostly be over the Use button on touch controls as long as he's away from a level boundary.
86 lines
1.9 KiB
Go
86 lines
1.9 KiB
Go
package balance
|
|
|
|
import (
|
|
"time"
|
|
|
|
"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: 60,
|
|
}
|
|
|
|
// 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
|
|
|
|
// Play Mode Touchscreen controls.
|
|
PlayModeIdleTimeout = 2200 * time.Millisecond
|
|
PlayModeAlphaStep = 8 // 0-255 alpha, steps per tick for fade in
|
|
PlayModeAlphaMax = 220
|
|
)
|
|
|
|
// Edit Mode Values
|
|
var (
|
|
// Number of Doodads per row in the palette.
|
|
UIDoodadsPerRow = 2
|
|
)
|