-
Notifications
You must be signed in to change notification settings - Fork 0
/
constants.js
137 lines (129 loc) · 3.1 KB
/
constants.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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
//canvas
const WIDTH = 900;
const HEIGHT = 640;
let player = {
height: 100,
width: 130
}
//obstacles
let obstacles = {
size: {
width: {
rocketWidth: 80,
ufoWidth: 112, //factor 1.6
anvilWidth: 80
},
height: {
rocketHeight: 187, //factor 2.3
ufoHeight: 70,
anvilHeight: 100 //factor 1.5
}
},
speed: {
xAxis: {
rocketX: 3,
ufoX: 4,
anvilX: 3
},
yAxis: {
rocketY: 3,
anvilY: 3
}
},
frequency: {
rocketFrequency: 400,
ufoFrequency: 300,
anvilFrequency: 200
},
buffer: 1.1
};
//background
let background = {
skySpeed: 0.5,
bottomSpeed: 2
}
//player
let verticalSpeed = 6;
let horizontalSpeed = 4;
//buffer for obstacles
let obstacleBuffer = 1.7;
//rise difficulty
let difficultyTime = 200;
let difficultyFactor = 1.1;
let collectibles = {
speed: {
xAxis: {
slowTimeX: 3,
makeSmallX: 4,
removeObstaclesX: 2,
supersizeObstaclesX: 0,
speedBonusX: 0
},
yAxis: {
slowTimeY: 0,
makeSmallY: 0,
removeObstaclesY: 4,
supersizeObstaclesY: 3,
speedBonusY: 3
}
},
frequency: {
slowTimeFrequency: 0,//1300,
makeSmallFrequency: secondsToFrames(10),
removeObstaclesFrequency: secondsToFrames(7),
supersizeObstaclesFrequency: secondsToFrames(7),
speedBonusFrequency: secondsToFrames(11)
},
duration: {
slowTimeDuration: 5000,
makeSmallDuration: 7000,
supersizeObstaclesDuration: 4000,
speedBonusDuration: 8000
},
factor: {
slowTimeFactor: 0.5,
makeSmallFactor: 0.5,
supersizeObstaclesFactor: 2,
speedBonusFactor: 1.4
}
}
//clouds
let clouds = {
yBorder: -300,
sizeFactor: { //small clouds first
cloud1Size: 0.1,
cloud2Size: 0.2,
cloud3Size: 0.3,
cloud4Size: 0.4,
cloud5Size: 0.5,
cloud6Size: 0.6,
cloud7Size: 0.7,
cloud8Size: 0.8,
cloud9Size: 0.9,
cloud10Size: 1
},
speed: { //fast clouds first
cloud1Speed: 0.6,
cloud2Speed: 0.7,
cloud3Speed: 0.8,
cloud4Speed: 0.9,
cloud5Speed: 1,
cloud6Speed: 1.1,
cloud7Speed: 1.2,
cloud8Speed: 1.3,
cloud9Speed: 1.4,
cloud10Speed: 1.5
},
frequency: {
cloud1Frequency: randomIntBetween(700, 1000),
cloud2Frequency: randomIntBetween(500, 1200),
cloud3Frequency: randomIntBetween(300, 1900),
cloud4Frequency: randomIntBetween(700, 2000),
cloud5Frequency: randomIntBetween(400, 1800),
cloud6Frequency: randomIntBetween(500, 1600),
cloud7Frequency: randomIntBetween(900, 2100),
cloud8Frequency: randomIntBetween(600, 3000),
cloud9Frequency: randomIntBetween(700, 2400),
cloud10Frequency: randomIntBetween(900, 2300)
}
}