-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathglobals.go
133 lines (102 loc) · 3.35 KB
/
globals.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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
package main
import (
"rapidengine/child"
"rapidengine/cmd"
"rapidengine/configuration"
"rapidengine/input"
"rapidengine/lighting"
"rapidengine/material"
)
// --------------------------------------------------
// Globals.go contains all the global variables in the project.
// This is not good practice.
// --------------------------------------------------
// Rapid Engine
var Engine *cmd.Engine
var Config configuration.EngineConfig
var Inputs *input.Input
// Screen Size
var ScreenWidth = 1920
var ScreenHeight = 1080
// Mouse Settings
var MouseSensitivity = 9.0
// --------------------------------------------------
// Children
// --------------------------------------------------
var BaseGravity = float32(1710.0)
var BaseSpeedX = float32(150.0)
var BaseSpeedY = float32(600.0)
var BlockSelect *child.Child2D
// World
var WorldChild *child.Child2D
var SkyChild *child.Child2D
var NoCollisionChild *child.Child2D
var NatureChild *child.Child2D
var GrassChild *child.Child2D
var CloudChild *child.Child2D
var SunChild *child.Child2D
var Back1Child *child.Child2D
var Back2Child *child.Child2D
var Back3Child *child.Child2D
var Back4Child *child.Child2D
var Back5Child *child.Child2D
var Back6Child *child.Child2D
var l lighting.PointLight
// --------------------------------------------------
// General
// --------------------------------------------------
var GamePaused bool
var CurrentWorld int
// --------------------------------------------------
// World Generation
// --------------------------------------------------
var Seed = int64(0)
// Size
const WorldWidth = 3000
const WorldHeight = 2000
const BlockSize = 32
// Height
const Flatness = 0.25
const GrassMinimum = 1500
// Cave generation
const CaveStartingThreshold = 0.27
const CaveEndingThreshold = 0.42
const CaveThresholdDelta = 0.002
const CaveIterations = 20
const CaveBirthLimit = 4
const CaveDeathLimit = 3
const SecondCaveIterations = 5
const SecondCaveBirthLimit = 3
const SecondCaveDeathLimit = 2
// Stone generation
const StoneFrequencyDelta = 0.001
const StoneStartingFrequency = 0.32
const StoneEndingFrequency = 0.77
const StoneTopDeviation = 10
// Data
var WorldMap WorldTree
var HeightMap [WorldWidth]int
var CaveMap [][]bool
// --------------------------------------------------
// Scenes
// --------------------------------------------------
var TitleScene *cmd.Scene
var ChooseScene *cmd.Scene
var LoadingScene *cmd.Scene
var WorldScene *cmd.Scene
var MenuScene *cmd.Scene
var SaveScene *cmd.Scene
var HotbarScene *cmd.Scene
var InventoryScene *cmd.Scene
var RespawnScene *cmd.Scene
var EM *EnemyManager
// --------------------------------------------------
// Theme Materials
// --------------------------------------------------
var ButtonMaterial *material.BasicMaterial
// --------------------------------------------------
// Data
// --------------------------------------------------
var TransparentBlocks = []string{"backdirt", "torch"} //"topGrass1", "topGrass2", "topGrass3", "treeRightRoot", "treeLeftRoot", "treeTrunk", "treeBottomRoot", "treeBranchR1", "treeBranchL1", "flower1", "flower2", "flower3", "pebble"}
var natureBlocks = []string{"leaves", "treeRightRoot", "treeLeftRoot", "treeTrunk", "treeBottomRoot", "treeBranchR1", "treeBranchL1", "topGrass1", "topGrass2", "topGrass3", "flower1", "flower2", "flower3", "pebble"}
var cloudMaterial *material.BasicMaterial