-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathconfig.js
119 lines (93 loc) · 3.06 KB
/
config.js
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
//===========//
// Constants //
//===========//
const urlParams = new URLSearchParams(window.location.search)
const DOF_MODE = urlParams.has("dof")
const SHADOW_MODE = urlParams.has("shadow")
const SMALL_MODE = urlParams.has("small") || !urlParams.has("big")
const MASSIVE_MODE = urlParams.has("massive")
const D2_MODE = urlParams.has("2d")
const D1_MODE = urlParams.has("1d")
const VR_MODE = urlParams.has("vr")
const TINY_MODE = urlParams.has("tiny")/* | true*/
const LONG_MODE = urlParams.has("long")
const PURE_RANDOM_MODE = urlParams.has("pure")
const SHUFFLE_MODE = urlParams.has("shuffle")
const FIRING_MODE = urlParams.has("firing")
const MEDIUM_MODE = urlParams.has("medium")
const RIDICULOUS_MODE = urlParams.has("ridiculous")
const NO_SECRET_MODE = urlParams.has("nosecret")
const DARK_MODE = urlParams.has("dark")
const DEFAULT_RANDOMNESS_MODE = "track"
const RANDOM = SHUFFLE_MODE? "shuffle" : (PURE_RANDOM_MODE? "pure" : (FIRING_MODE? "firing" : DEFAULT_RANDOMNESS_MODE))
const FLOOR_TYPE = urlParams.has("nofloor")? "nofloor" : "floor"
let MAX_X = (SMALL_MODE? 30 : 50) * (D1_MODE? 2 : 1) * (D2_MODE? 5 : 1)
let MAX_Z = D1_MODE? 0 : (D2_MODE? 0 : MAX_X)
let MAX_Y = D1_MODE? 0 : (SMALL_MODE? 30 : 40) * (D2_MODE? 8 : 1)
if (TINY_MODE) {
MAX_X = Math.floor(MAX_X * 0.6)
MAX_Z = Math.floor(MAX_Z * 0.6)
MAX_Y = Math.floor(MAX_Y * 0.7)
}
if (MASSIVE_MODE) {
MAX_X = Math.floor(MAX_X * 2.5)
MAX_Z = Math.floor(MAX_Z * 2.5)
MAX_Y = Math.floor(MAX_Y * 1.5)
}
if (RIDICULOUS_MODE) {
MAX_X = Math.floor(MAX_X * 3.0)
MAX_Z = Math.floor(MAX_Z * 3.0)
MAX_Y = Math.floor(MAX_Y * 1.5)
}
if (LONG_MODE) {
MAX_X = Math.floor(MAX_X * 1.3)
MAX_Z = Math.floor(MAX_Z * 1)
MAX_Y = Math.floor(MAX_Y * 0.75)
}
if (MEDIUM_MODE) {
MAX_X = 40 * (D1_MODE? 2 : 1) * (D2_MODE? 5 : 1)
MAX_Y = 35 * (D2_MODE? 8 : 1)
MAX_Z = D1_MODE? 0 : (D2_MODE? 0 : MAX_X)
}
let SIZE = SMALL_MODE? "small" : "big"
if (TINY_MODE) SIZE = "tiny"
else if (MASSIVE_MODE) SIZE = "massive"
else if (MEDIUM_MODE) SIZE = "medium"
const SHAPE = LONG_MODE? "long" : "cube"
const MIN_X = -MAX_X
const MIN_Z = -MAX_Z
const MIN_Y = 0
const WORLD_WIDTH = MAX_X * 2 + 1
const WORLD_DEPTH = MAX_Z * 2 + 1
const WORLD_HEIGHT = MAX_Y
const WORLD_AREA = {
x: [MIN_X, MAX_X],
y: [MIN_Y, MAX_Y],
z: [MIN_Z, MAX_Z],
}
const ATOM_SIZE = 0.01
const ATOM_SCALE = 1.0
const CAMERA_START_X = 0
let CAMERA_START_Y = (D2_MODE? WORLD_HEIGHT/2 : (SMALL_MODE? 85 : 140)) * ATOM_SIZE
let CAMERA_START_Z = (SMALL_MODE? 125 : 200) * (D2_MODE? 2 : 1) * ATOM_SIZE
if (MEDIUM_MODE) {
CAMERA_START_Y = CAMERA_START_Y * 1.25
CAMERA_START_Z = CAMERA_START_Z * 1.25
}
if (MASSIVE_MODE) {
CAMERA_START_Y = CAMERA_START_Y * 2.25
CAMERA_START_Z = CAMERA_START_Z * 2.25
}
if (TINY_MODE) {
CAMERA_START_Y = CAMERA_START_Y * 0.65
CAMERA_START_Z = CAMERA_START_Z * 0.7
}
if (D2_MODE) {
//CAMERA_START_Y = CAMERA_START_Y * 2.8
CAMERA_START_Z = CAMERA_START_Z * 2.25
}
const CAMERA_SPEED = 2
//window.history.replaceState({}, "", window.location.pathname)
let SPEED_MOD = urlParams.get("speed")
if (SPEED_MOD === null) SPEED_MOD = "1"
SPEED_MOD = parseFloat(SPEED_MOD)