forked from ranchblt/geometry-jumper
/
consts.go
118 lines (93 loc) · 2.85 KB
/
consts.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
package game
import (
"github.com/golang/freetype/truetype"
"github.com/hajimehoshi/ebiten"
"github.com/uber-go/zap"
)
const (
DefaultSpeed = 4
// delay between pattern spawning (milliseconds)
PatternDelayMillis = 1000
// 'difficulty' constants for patterns?
LowDifficulty = "LOW"
MediumDifficulty = "MEDIUM"
HighDifficulty = "HIGH"
// Track constants
UpperTrack = 1
LowerTrack = 2
// shape constants
TriangleType = 1
CircleType = 2
SquareType = 3
// triangle movement state constants
TriangleBeforeSwap = 1
TriangleDuringSwap = 2
TriangleAfterSwap = 3
// space (in pixels, I guess?) between the two tracks
UpperTrackYAxis = 150
LowerTrackYAxis = 250
// x constants for sides and player
PlayerX = 60
LeftSide = 50
RightSide = 375
// this should be screen width probably, not a constant 400
TrackLength = 400
// default angle values IN DEGREES!!!! (go math requires radians but degrees make more sense...)
DefaultCircleAngleOfDescent float64 = 35
DefaultTriangleAngleOfDescent float64 = 45
JumpHeight = LowerTrackYAxis - UpperTrackYAxis
JumpUpSpeed = 5
JumpDownSpeed = 3
StartingUpperSpeedLimit = 4
MinimumSpeed = 4
ScreenWidth = 400
ScreenHeight = 400
// difficulty unlock points
MediumDifficultyUnlockSeconds = 60
HighDifficultyUnlockSeconds = 120
ColorSwapUnlockSeconds = 240
// difficulty lock points
LowDifficultyLockSeconds = 150
MediumDifficultyLockSeconds = 180
)
var (
Debug = false
// slice of all shape types
ShapeTypes = [...]int{TriangleType, CircleType, SquareType}
// slice of all difficulties
DifficultyTypes = [...]string{LowDifficulty, MediumDifficulty, HighDifficulty}
// track mappings so you can use the track ID to get the track's position on the y axis
TrackMappings = map[int]int{
UpperTrack: UpperTrackYAxis,
LowerTrack: LowerTrackYAxis,
}
// subsequent track shows us what track comes after the one we're currently on.
SubsequentTracks = map[int]int{
UpperTrack: LowerTrack,
LowerTrack: UpperTrack,
}
PersonStandingImage *ebiten.Image
PersonJumpingImage *ebiten.Image
PlatformImage *ebiten.Image
SquareImage *ebiten.Image
TriangleImage *ebiten.Image
CircleImage *ebiten.Image
UpperTrackLine *ebiten.Image
LowerTrackLine *ebiten.Image
TitleImage *ebiten.Image
EndImage *ebiten.Image
UpperTrackOpts *ebiten.DrawImageOptions
LowerTrackOpts *ebiten.DrawImageOptions
ShapeImageMap map[int][]*ebiten.Image
HitboxImageMap map[int]*ebiten.Image
// color mapping constants
DefaultSquareColorMap ebiten.ColorM
DefaultCircleColorMap ebiten.ColorM
DefaultTriangleColorMap ebiten.ColorM
// shape to default color map
ColorMappings map[int]ebiten.ColorM
Font *truetype.Font
// pattern collection
GamePatternCollection *PatternCollection
logger zap.Logger
)