-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path0_variables.js
203 lines (138 loc) · 3.83 KB
/
0_variables.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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
////Yet another recreation of a classic arcade game//////////
////lot of stuff in the code is written in Macedonian language, because of distinguishing things in my head, since this is my first project, i plan on using only english in future////////
////////////////////////VARIJABLI///////////////
let upgrade = [];
///////pukaci/////////
let newGame = 1;
let time = 0;
let difficulty = 0;
let butPos = 0.5;
let enemyPukacRate;
let upgradeRate = 4000;
let enemyPukacKos = [];
let enemyPukacKos2 = [];
let enemyPukac = [];
let pukac = [];
let asteroid = [];
let pukacRadius = 12;
let upgraded = 0;
let kosPukacSpeed;
let muvi = [];
let muvi2 = [];
let muvi3 = [];
let bossMuva = [];
let muvi4 = [];
let muvi5 = [];
let muvi6 = [];
let bossMuva2 = [];
let muvi7 = [];
let muvi8 = [];
let muvi9 = [];
let bossMuva3 = [];
let bossSize = 5;
let bossHealth = 600;
let bossHealthBar = 600;
let boss2Size = 5;
let boss2Health = 1000;
let boss2HealthBar = 1000;
let boss3Size = 5;
let boss3Health = 1800;
let boss3HealthBar = 1800;
let speedy = 2;
let speedy2 = 2;
let speedy3 = 2;
let avionce = [];
let avioncePosX = 0
let avioncePosY = 0;
let avioncePosZ = 0;
let prekidac = false;
let prekidac2 = false;
let kursumPrekidac = false;
let speedx = 0.2;
let speedx2 = -0.2;
let speedx3 = 0.3;
let asteroidSpeed = 3;
let speedKursum = -1;
let kHor;
let kVer;
let kDist;
let muva1x;
let muva1y;
let xAvionce;
let municija = 1;
let muviubieni = false;
let muviubieni2 = false;
let muviubieni3 = false;
let alarm;
let hitSound;
let backgroundMusic;
let pukanjeSound;
let pukanjeSound2;
let pukanjeSound3;
let upgradeSound;
let textZaUpgrade = [];
let asteroidCount = 250;
let delitel;
let font1;
let angle = 0;
let angle2 = 0;
let plasmaAngle = 0;
let airplaneModel;
let muvaModel;
let asteroidModel;
let butterflyModel;
let spiderModel;
let bulletModel;
let inox;
let asteroidTexture;
let asteroidTexture2;
let asteroidTexture3;
let butterflyTexture;
let butterflyTexture2;
let butterflyTexture3;
let spiderTexture;
let spiderTexture2;
let spiderTexture3;
let bulletTexture1;
let bulletTexture2;
let pukacLightx = 0;
let pukacLighty = 0;
let cameraDist = 0;
let bg1;
let bg2;
let bg3;
function preload() {
//////// fonts /////////
font1 = loadFont('fonts/Arial.ttf');
///////// models ///////////////
butterflyModel = loadModel('models/butterfly.obj', true);
airplaneModel = loadModel('models/airplane.obj', true);
muvaModel = loadModel('models/muva.obj', true);
asteroidModel = loadModel('models/asteroid2.obj', true);
spiderModel = loadModel('models/spider.obj', true);
bulletModel = loadModel('models/bullet.obj', true);
///////// textures //////////
inox = loadImage('textures/inox.jpg')
asteroidTexture = loadImage('textures/asteroid2.jpg');
asteroidTexture2 = loadImage('textures/asteroid3.jpg');
asteroidTexture3 = loadImage('textures/asteroid4.jpg');
butterflyTexture = loadImage('textures/butterfly.png');
butterflyTexture2 = loadImage('textures/butterfly2.png');
butterflyTexture3 = loadImage('textures/butterfly3.png');
spiderTexture = loadImage ('textures/spider.jpg');
spiderTexture2 = loadImage ('textures/spider4.jpg');
spiderTexture3 = loadImage ('textures/spider5.jpg');
bulletTexture1 = loadImage ('textures/brass.jpg');
bulletTexture2 = loadImage ('textures/copper.jpg');
//////// sounds //////////////
hitSound = loadSound("sounds/hit1.mp3");
pukanjeSound = loadSound("sounds/gun1.mp3");
pukanjeSound2 = loadSound("sounds/gun2.mp3");
pukanjeSound3 = loadSound("sounds/gun3.mp3");
upgradeSound = loadSound("sounds/reload.mp3");
alarm = loadSound("sounds/bossAlarm.mp3");
/////////// backgrounds /////////////////
bg1 = loadImage('background/space2.png');
bg2 = loadImage('background/stars.jpg');
bg3 = loadImage('background/space3.png');
}