-
Notifications
You must be signed in to change notification settings - Fork 8
/
indexTemp.html
263 lines (254 loc) · 76 KB
/
indexTemp.html
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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Gun Game Adventure</title>
<style>
.btn-play,.menu input[type=color]:hover{cursor:pointer}*{font-family:Consolas,monospace}body{background-color:#fff;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}audio{position:absolute;opacity:.4;top:5px;right:5px;height:30px}.overlay{height:100%;width:100%;position:fixed;z-index:10;left:0;top:0;background:url(objects/bg.png);overflow-x:hidden;transition:.5s}#chatBox,#conversation{transition-duration:.3s}.menu{position:relative;top:25%;width:320px;height:320px;margin:auto;background-color:rgba(20,20,20,.6);padding:10px;border-radius:8px;overflow-y:auto}#alert,#chatBox,#menuWhenDie{position:fixed}.menu input[type=text]{display:inline-block;width:275px;font-size:1.3em;padding:5px 10px;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;border:none;outline:0;border-radius:5px;margin-bottom:10px}.menu input[type=color]{opacity:0;width:100%;height:100%;border:none;padding:0}#color-picker-wrapper:hover{border:2px solid #DDD}#color-picker-wrapper{display:inline-block;margin:auto 0;border:2px solid #999;border-radius:50%;width:25px;height:25px}.btn-play,.menu select{display:block;font-weight:700}.menu select{color:#eee;width:100%;text-indent:10px;padding:5px 10px;font-size:1.2em;border:2px solid #07BC16;border-radius:5px;background-color:transparent;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;margin-bottom:10px}.btn-play,.guide p{font-size:1.1em;width:100%}.menu option{background-color:#222}.btn-play{border:none;margin:5px 0;padding:10px 0;color:#fff;border-radius:5px}.gr-btn{width:100%;display:flex;justify-content:space-between;flex-wrap:wrap}.item{width:48%}.guide{display:none;margin:25px 2px 2px;background-color:#313135;border-radius:5px}.guide p{margin:5px 0 2px 5px;color:#999;text-align:left}#closebtn,#menuWhenDie input{font-size:22px;cursor:pointer}.guide b{color:#ddd}.blue{background-color:#2A6787}.green{background-color:#608d27}.gray{background-color:rgba(60,60,60,.8)}.blue:hover{background-color:#4C89A9}.green:hover{background-color:#80af49}#menuWhenDie input:hover,.gray:hover{background-color:rgba(70,70,70,1)}#menuWhenDie{display:none;z-index:3;left:50%;top:50%;transform:translate(-50%,-50%)}#menuWhenDie input{width:150px;padding:10px;border:none;border-radius:3px;background-color:rgba(70,70,70,.6);color:#fff;opacity:.5;transition:.1s}#menuWhenDie input:nth-child(2){width:70px}#menuWhenDie input:hover{opacity:.9}#alert{z-index:2;display:block;top:40px;right:5px;padding:20px;background-color:#111;opacity:0;color:#fff;font-weight:700;transition:.3s}#closebtn{margin-left:15px;color:#fff;font-weight:700;float:right;line-height:20px;transition:.3s}#chatBox{display:none;left:0;bottom:5px;width:300px;height:300px;padding:5px;opacity:.6;z-index:2}#conversation{background-color:rgba(51,51,51,.2);color:#fff;width:100%;height:260px;overflow:auto;word-wrap:break-word;white-space:-moz-pre-wrap;white-space:pre-wrap}#conversation p{padding:8px 0;margin:0}#typing{width:100%;padding:5px 0 0}#typing input[type=text]{font-size:16px;background-color:rgba(0,0,0,.4);color:#fff;border:none;height:30px;width:235px;z-index:2}#showHideChat{background-color:rgba(51,51,51,.8);color:#fff;border:none;width:50px}#showHideChat:hover{background-color:#fff;color:#000;cursor:pointer}::-webkit-scrollbar{width:7px;height:7px}::-webkit-scrollbar-track{background:#444}::-webkit-scrollbar-thumb{background:#999;border-radius:5px}::-webkit-scrollbar-thumb:hover{background:#fff}
</style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.7.2/p5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.7.2/addons/p5.dom.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.7.2/addons/p5.sound.min.js"></script>
<script>
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}};$jscomp.arrayIterator=function(a){return{next:$jscomp.arrayIteratorImpl(a)}};$jscomp.makeIterator=function(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):$jscomp.arrayIterator(a)};
function Point(a,b){this.x=a;this.y=b;this.col=color(random(255),random(255),random(255));this.update=function(){this.x+=random(-1,1);this.y+=random(-1,1);this.x>width?this.x=1:0>this.x&&(this.x=width-1);this.y>height?this.y=1:0>this.y&&(this.y=height-1)};this.show=function(){point(this.x,this.y)}}
function Rectangle(a,b,c,d){this.x=a;this.y=b;this.w=c;this.h=d;this.contains=function(a){return a.pos.x>=this.x-this.w/2&&a.pos.x<=this.x+this.w/2&&a.pos.y>this.y-this.h/2&&a.pos.y<this.y+this.h/2};this.intersects=function(a){return!(a.x+a.w/2<this.x-this.w/2||a.y+a.h/2<this.y-this.h/2||a.x-a.w/2>this.x+this.w/2||a.y-a.h/2>this.y+this.h/2)}}
function Circle(a,b,c){this.x=a;this.y=b;this.r=c;this.contains=function(a){return dist(a.pos.x,a.pos.y,this.x,this.y)<this.r};this.intersects=function(a){var b=Math.abs(a.x-this.x),c=Math.abs(a.y-this.y),d=this.r,l=a.w;a=a.h;var m=dist(b,c,l,a);return b>d+l||c>d+a?!1:b<=l||c<=a?!0:m<=this.rSquared}}function QuadTree(a,b){this.boundary=a;this.capacity=b;this.points=[];this.divided=!1}
QuadTree.prototype.subdivice=function(){var a=this.boundary.x,b=this.boundary.y,c=this.boundary.w/2,d=this.boundary.h/2,e=new Rectangle(a-c/2,b-d/2,c,d),f=new Rectangle(a+c/2,b-d/2,c,d),k=new Rectangle(a-c/2,b+d/2,c,d);a=new Rectangle(a+c/2,b+d/2,c,d);this.topLeft=new QuadTree(e,this.capacity);this.topRight=new QuadTree(f,this.capacity);this.botLeft=new QuadTree(k,this.capacity);this.botRight=new QuadTree(a,this.capacity);this.divided=!0};
QuadTree.prototype.insert=function(a){if(!this.boundary.contains(a))return!1;if(this.points.length<this.capacity)return this.points.push(a),!0;this.divided||this.subdivice();return this.topLeft.insert(a)||this.topRight.insert(a)||this.botLeft.insert(a)||this.botRight.insert(a)?!0:!1};
QuadTree.prototype.query=function(a,b,c){b||(b=[]);if(!a.intersects(this.boundary))return b;for(var d=0;d<this.points.length;d++)if(a.contains(this.points[d])&&(b.push(this.points[d]),c))return b;this.divided&&(this.topLeft.query(a,b),this.topRight.query(a,b),this.botLeft.query(a,b),this.botRight.query(a,b));return b};QuadTree.prototype.clear=function(){this.points=[];this.divided&&(this.topLeft.clear(),this.topRight.clear(),this.botLeft.clear(),this.topRight.clear());this.divided=!1};
QuadTree.prototype.show=function(a){if("points at mouse"!=a){stroke(100);if("points"==a||"grid+points"==a){strokeWeight(4);for(var b=0;b<this.points.length;b++)this.points[b].show()}if("grid"==a||"grid+points"==a)noFill(),0<this.points.length?(stroke(255),strokeWeight(2)):strokeWeight(1),b=realToFake(this.boundary.x,this.boundary.y),rect(b.x,b.y,this.boundary.w,this.boundary.h);this.divided&&(this.topLeft.show(a),this.topRight.show(a),this.botLeft.show(a),this.botRight.show(a))}};
var worlds={normal:{SizeTree:[50,150],SizeRock:[50,300],SizeWater:[400,1E3],SizeBarrel:[50,120],maxBarrel:35,maxRock:30,maxTree:100,maxWater:4,maxItem:300,bg:[20,20,20]},flat:{SizeTree:[0,0],SizeRock:[0,0],SizeWater:[0,0],SizeBarrel:[0],maxBarrel:0,maxRock:0,maxTree:0,maxWater:0,maxItem:400,bg:[20,20,20]},winter:{SizeTree:[100,180],SizeRock:[100,300],SizeWater:[300,700],SizeBarrel:[70,150],maxBarrel:35,maxRock:20,maxTree:15,maxWater:5,maxItem:400,bg:[73,78,86,220]},jungle:{SizeTree:[50,400],SizeRock:[100,
400],SizeWater:[100,400],SizeBarrel:[50,70],maxBarrel:5,maxRock:10,maxTree:150,maxWater:2,maxItem:450,bg:[3,20,9]},mountain:{SizeTree:[50,150],SizeRock:[200,600],SizeWater:[70,200],SizeBarrel:[50,100],maxBarrel:35,maxRock:50,maxTree:50,maxWater:1,maxItem:100,bg:[15,4,40,220]},beach:{SizeTree:[50,200],SizeRock:[150,300],SizeWater:[1700,3500],SizeBarrel:[50,70],maxBarrel:30,maxRock:10,maxTree:100,maxWater:7,maxItem:100,bg:[124,108,58]},barrel:{SizeTree:[0],SizeRock:[0],SizeWater:[0],SizeBarrel:[100,
150],maxBarrel:70,maxRock:0,maxTree:0,maxWater:0,maxItem:200,bg:[54,80,80]}};function GameMap(a,b,c){this.size=v(a,b);this.safezone=v(a,b);this.gridSize=c||200;this.hiddenMinimap=!1}GameMap.prototype.run=function(){this.drawGrid();this.drawEdge()};
GameMap.prototype.createMinimap=function(){this.minimapSize=270;this.offSetX=width-this.minimapSize-10;this.minimap?this.minimap.clear():this.minimap=createGraphics(this.minimapSize,this.minimapSize);this.minimap.fill(world.bg[0],world.bg[1],world.bg[2],150);this.minimap.stroke(100,150);this.minimap.strokeWeight(1);this.minimap.rect(0,0,this.minimapSize-2,this.minimapSize-2);this.minimap.noStroke();for(var a=$jscomp.makeIterator(wArr),b=a.next();!b.done;b=a.next())b=b.value,this.minimap.fill(b.col[0],
b.col[1],b.col[2],100),this.circleToMinimap(b.pos,b.radius,!0);a=$jscomp.makeIterator(rArr);for(b=a.next();!b.done;b=a.next())b=b.value,this.minimap.fill(b.col[0],b.col[1],b.col[2],200),this.circleToMinimap(b.pos,b.radius,!0);a=$jscomp.makeIterator(tArr);for(b=a.next();!b.done;b=a.next())b=b.value,this.minimap.fill(b.col[0],b.col[1],b.col[2],200),this.circleToMinimap(b.pos,b.radius,!0)};
GameMap.prototype.convert=function(a,b){return b?map(a,0,this.minimapSize,0,this.size.x):map(a,0,this.size.x,0,this.minimapSize)};GameMap.prototype.convertXY=function(a,b){return b?v(this.convert(a.x,!0),this.convert(a.y,!0)):v(this.convert(a.x),this.convert(a.y))};GameMap.prototype.circleToMinimap=function(a,b,c){a=this.convertXY(a);b=this.convert(b);c?this.minimap.ellipse(a.x,a.y,2*b,2*b):ellipse(a.x+this.offSetX,a.y+height-(this.minimapSize+10),2*b,2*b)};
GameMap.prototype.rectToMinimap=function(a,b,c){a=this.convertXY(a);b=this.convertXY(b);c?this.minimap.rect(a.x,a.y,b.x,b.y):rect(a.x+this.offSetX,a.y+height-(this.minimapSize+10),b.x,b.y)};
GameMap.prototype.showMinimap=function(){this.offSetX=this.hiddenMinimap?lerp(this.offSetX,width+10,.2):lerp(this.offSetX,width-this.minimapSize-10,.2);if(this.offSetX<width){image(this.minimap,this.offSetX,height-(this.minimapSize+10));strokeWeight(1);for(var a=$jscomp.makeIterator(pArr),b=a.next();!b.done;b=a.next())b=b.value,this.showPortals(b.inGate),b.outGate&&this.showPortals(b.outGate);a=$jscomp.makeIterator(redArr);for(b=a.next();!b.done;b=a.next())b=b.value,stroke(b.redValue,0,0),fill(b.redValue,
10,10,50),this.circleToMinimap(b.pos,b.radius,!1);noFill();a=$jscomp.makeIterator(eArr);for(b=a.next();!b.done;b=a.next())b=b.value,b==viewport.target||b.hide||(b.idTeam==viewport.target.idTeam?(stroke(0,255,0),strokeWeight(2)):(stroke(150),strokeWeight(1)),this.circleToMinimap(b.pos,100,!1));stroke(255);a=viewport.target.pos;0<a.x&&a.x<gmap.size.x&&0<a.y&&a.y<gmap.size.y&&(this.rectToMinimap(viewport.pos,v(width,height),!1),viewport.target.hide||(fill(170),this.circleToMinimap(viewport.target.pos,
100,!1)));mouseX>this.offSetX&&mouseY>height-this.minimapSize-10&&(keyIsDown(81)?(a=this.convertXY(v(mouseX,mouseY).sub(v(this.offSetX,height-this.minimapSize-10)),!0),viewport.pos=a):(textAlign(RIGHT),noStroke(),fill(150),text('hold "Q" to see',width-10,height-this.minimapSize-20)))}};
GameMap.prototype.showPortals=function(a){fill("out"==a.type?"orange":"blue");noStroke();this.circleToMinimap(a.pos,mil/4%150,!1);if(a.connectWith){var b=this.convertXY(a.pos).add(this.offSetX,height-(this.minimapSize+10));a=this.convertXY(a.connectWith.pos).add(this.offSetX,height-(this.minimapSize+10));stroke(200,50);line(b.x,b.y,a.x,a.y)}};
GameMap.prototype.drawEdge=function(){var a=v(0,0),b=v(this.size.x,0),c=v(0,this.size.y),d=v(this.size.x,this.size.y);stroke(255);strokeWeight(3);line(a.x,a.y,b.x,b.y);line(b.x,b.y,d.x,d.y);line(d.x,d.y,c.x,d.y);line(c.x,c.y,a.x,a.y)};
GameMap.prototype.drawGrid=function(){stroke(50,70);strokeWeight(3);for(var a=1,b=viewport.pos.x-width/2;b<viewport.pos.x+width/2;b+=a)0==floor(b)%this.gridSize&&(a=this.gridSize,line(b,viewport.pos.y-height/2,b,viewport.pos.y+height/2));a=1;for(b=viewport.pos.y-height/2;b<viewport.pos.y+height/2;b+=a)0==floor(b)%this.gridSize&&(a=this.gridSize,line(viewport.pos.x-width/2,b,viewport.pos.x+width/2,b))};
function Viewport(a){this.target=a||v(100,100);this.pos=a.pos.copy()||v(100,100);this.follow=!0;this.borderSize=25}Viewport.prototype.changeTarget=function(a){if(a)this.target=a;else if(eArr.length){a=gmap.size.x;for(var b=eArr[0],c=$jscomp.makeIterator(eArr),d=c.next();!d.done;d=c.next()){d=d.value;var e=p5.Vector.dist(d.pos,this.target.pos);e<a&&(a=e,b=d)}this.target=b}};
Viewport.prototype.run=function(){if(this.follow&&!keyIsDown(81))this.pos=p5.Vector.lerp(this.pos,this.target.pos,60/(fr+1)*.1);else if(mouseX>width-this.borderSize||mouseX<this.borderSize||mouseY>height-this.borderSize||mouseY<this.borderSize){var a=v(mouseX-width/2,mouseY-height/2).setMag(30);viewport.pos.add(a);noStroke();fill(200,20);25>mouseY&&rect(width/2,12.5,width,25);mouseY>height-25&&rect(width/2,height-12.5,width,25);25>mouseX&&rect(12.5,height/2,25,height);mouseX>width-25&&rect(width-
12.5,height/2,25,height)}};function Tree(a,b,c){this.pos=v(a,b);this.radius=c;this.col=[random(20),random(50,100),random(20)]}Tree.prototype.run=function(){insideViewport(this)&&this.show();this.update()};
Tree.prototype.update=function(){var a=getPlayers(this.pos,this.radius+maxSizeNow,[]);if(a.length){a=$jscomp.makeIterator(a);for(var b=a.next();!b.done;b=a.next())b=b.value,p5.Vector.dist(this.pos,b.pos)<this.radius-b.radius/2&&(b.setFric(.75,100),b.hide=!0)}a=getBullets(this.pos,this.radius+maxSizeNow,[]);if(a.length)for(a=$jscomp.makeIterator(a),b=a.next();!b.done;b=a.next())if(b=b.value,p5.Vector.dist(this.pos,b.pos)<this.radius+b.info.radius&&(b.end(),this.radius-=b.info.radius/2,.8<random()&&
(b=this.pos.copy().add(v(random(-1,1),random(-1,1)).setMag(this.radius)),b=new Item(b.x,b.y),b.vel=p5.Vector.sub(b.pos,this.pos).setMag(15-b.radius),iArr.push(b)),20>this.radius)){this.end();break}};
Tree.prototype.end=function(){insideViewport(this)&&addSound("audio/tree_break_01.mp3");if(.6<random(1)){var a=getValueAtIndex(weapons,floor(random(getObjectLength(weapons)/2-1)));iArr.push(new Item(this.pos.x,this.pos.y,null,this.col,a))}for(a=0;a<random(1,5);a++)iArr.push(new Item(this.pos.x+random(-30,30),this.pos.y+random(-30,30)));tArr.splice(tArr.indexOf(this),1)};
Tree.prototype.show=function(){fill(this.col[0],this.col[1],this.col[2],240);noStroke();ellipse(this.pos.x,this.pos.y,2*this.radius+100*ampLevel)};function Rock(a,b,c){this.pos=v(a,b);this.radius=c;a=floor(random(30,70));this.col=[a,a,a]}Rock.prototype.run=function(){insideViewport(this)&&this.show();this.update()};
Rock.prototype.update=function(){var a=getBullets(this.pos,this.radius,[]);if(a.length){a=$jscomp.makeIterator(a);for(var b=a.next();!b.done;b=a.next())if(b=b.value,effects.collision(this,b,!1,!0),this.radius-=b.info.radius/4,20>this.radius){this.end(b);break}}a=getPlayers(this.pos,this.radius+maxSizeNow,[]);if(a.length)for(a=$jscomp.makeIterator(a),b=a.next();!b.done;b=a.next()){b=b.value;var c=p5.Vector.dist(this.pos,b.pos);c<this.radius+b.radius&&(effects.collision(this,b,c),b.nextPoint&&(b.nextPoint=
v(b.pos.x+random(-300,300),b.pos.y+random(-300,300))))}a=getItems(this.pos,this.radius,[]);if(a.length)for(a=$jscomp.makeIterator(a),b=a.next();!b.done;b=a.next())effects.collision(this,b.value)};
Rock.prototype.end=function(a){insideViewport(this)&&addSound("audio/stone_break_01.mp3");for(a=0;2>a;a++){var b=getObjectLength(weapons);b=getValueAtIndex(weapons,floor(random(b/2,b)));iArr.push(new Item(this.pos.x,this.pos.y,null,this.col,b))}for(a=0;a<random(10,20);a++)iArr.push(new Item(this.pos.x+random(-30,30),this.pos.y+random(-30,30)));rArr.splice(rArr.indexOf(this),1)};
Rock.prototype.show=function(){fill(this.col[0],this.col[1],this.col[2]);stroke(70);strokeWeight(2);ellipse(this.pos.x,this.pos.y,2*this.radius)};function Barrel(a,b,c){this.pos=v(a,b);this.radius=c;this.col=[30,30,30];this.lidpos=this.pos.copy().add(v(random(-1,1),random(-1,1)).setMag(.5*this.radius));this.health=this.radius}Barrel.prototype.run=function(){insideViewport(this)&&this.show();this.update()};
Barrel.prototype.update=function(){var a=getBullets(this.pos,this.radius,[]);if(a.length){a=$jscomp.makeIterator(a);for(var b=a.next();!b.done;b=a.next())if(b=b.value,fill(100,20,20,100),ellipse(this.pos.x,this.pos.y,2*this.radius+20),this.health-=b.info.damage,b.end(),0>this.health){this.end(b);break}}a=getPlayers(this.pos,this.radius+maxSizeNow,[]);if(a.length)for(a=$jscomp.makeIterator(a),b=a.next();!b.done;b=a.next())b=b.value,p5.Vector.dist(this.pos,b.pos)<this.radius+b.radius&&(effects.collision(this,
b),b.nextPoint&&(b.nextPoint=v(b.pos.x+random(-300,300),b.pos.y+random(-300,300))));a=getItems(this.pos,this.radius,[]);if(a.length)for(a=$jscomp.makeIterator(a),b=a.next();!b.done;b=a.next())effects.collision(this,b.value)};
Barrel.prototype.end=function(a){effects.smoke(this.pos.x,this.pos.y,3,1E3,40,20);effects.explore(this.pos,.15*this.radius,[255,100,50],a.o);effects.force("out",["item"],this.pos,this.radius+400,[]);var b=getPlayers(this.pos,this.radius+300+maxSizeNow,[]);if(b.length){b=$jscomp.makeIterator(b);for(var c=b.next();!c.done;c=b.next()){c=c.value;var d=p5.Vector.dist(this.pos,c.pos);d<this.radius+300+c.radius&&(d=map(d-c.radius-this.radius,0,300,this.radius,0),c.vel.add(p5.Vector.sub(c.pos,this.pos).setMag(d/
2)),c.shield?c.healthShield>d?c.healthShield-=d:(c.healthShield=0,c.health-=d-c.healthShield):c.health-=d,c.updateSize(),0>=c.health&&c.die(a))}}for(b=0;1>b;b++)c=getObjectLength(weapons),c=getValueAtIndex(weapons,floor(random(c/2,c))),iArr.push(new Item(this.pos.x,this.pos.y,null,this.col,c));for(b=0;b<this.radius/30;b++)c=v(random(-1,1),random(-1,1)).setMag(random(.5,3)),c=new Bullet(this.pos,c,bulletTypes.Mine,a.o),bArr.push(c);rArr.splice(rArr.indexOf(this),1)};
Barrel.prototype.show=function(){fill(this.col[0],this.col[1],this.col[2]);stroke(80);strokeWeight(4);ellipse(this.pos.x,this.pos.y,2*this.radius);fill(0);noStroke();ellipse(this.lidpos.x,this.lidpos.y,.25*this.radius);20>this.health&&random(1)>fr/60*.9&&effects.smoke(this.lidpos.x,this.lidpos.y,1,500,1,5)};function Water(a,b,c){this.pos=v(a,b);this.radius=c||random(50,400);this.col=[21,53,117];this.preRipple=mil;this.delay=800;this.ripple=[]}Water.prototype.run=function(){this.show()};
Water.prototype.show=function(){noStroke();fill(this.col[0],this.col[1],this.col[2],150);ellipse(this.pos.x,this.pos.y,2*this.radius);this.trackPlayer();this.showRipple()};
Water.prototype.trackPlayer=function(){var a=getPlayers(this.pos,this.radius,[]);if(a.length){a=$jscomp.makeIterator(a);for(var b=a.next();!b.done;b=a.next())b=b.value,p5.Vector.dist(this.pos,b.pos)<this.radius-b.radius/2&&(b.vel.mag()>b.maxSpeed/2&&mil-this.preRipple>this.delay&&(this.ripple.push({x:b.pos.x,y:b.pos.y,r:10}),this.preRipple=mil,b==p&&addSound("audio/footstep_water_02.mp3")),b.setFric(.75,100))}a=getBullets(this.pos,this.radius,[]);if(a.length)for(a=$jscomp.makeIterator(a),b=a.next();!b.done;b=
a.next())b=b.value,p5.Vector.dist(this.pos,b.pos)<this.radius-b.info.radius/2&&b.vel.mult(.95)};Water.prototype.showRipple=function(){for(var a=this.ripple.length-1;0<=a;a--){var b=this.ripple[a];fill(150,10);stroke(150,200-2*b.r);strokeWeight(2);ellipse(b.x,b.y,2*b.r);b.r+=60/(fr+1);255<2*b.r&&this.ripple.splice(a,1)}};
function Item(a,b,c,d,e){this.pos=v(a,b);this.vel=v(0,0);this.radius=c||random(5,15);this.born=mil;this.life=random(6E4,3E5);this.col=(this.nameGun=e)?weapons[this.nameGun].color:d||[random(255),random(255),random(255)]}Item.prototype.run=function(){insideViewport(this)&&(this.update(),this.show());mil-this.born>this.life&&iArr.splice(iArr.indexOf(this),1)};
Item.prototype.eatBy=function(a){if(!this.nameGun||a!=p){var b=p5.Vector.dist(this.pos,a.pos);b<a.radius?(a.health+=this.radius/5,a.score+=this.radius/10,a.updateSize(),iArr.splice(iArr.indexOf(this),1)):this.vel=v(a.pos.x-this.pos.x,a.pos.y-this.pos.y).setMag(250/(b-a.radius)).limit(15)}};Item.prototype.update=function(){this.pos.add(random(-2,2),random(-2,2));this.pos.add(this.vel.copy().mult(60/(fr+1)));this.vel.mult(.8);collisionEdge(this,1)};
Item.prototype.show=function(){if(this.nameGun){var a=this.col;fill(10);stroke(a[0],a[1],a[2]);strokeWeight(1);ellipse(this.pos.x,this.pos.y,30);fill(a[0],a[1],a[2]);noStroke();text(this.nameGun,this.pos.x,this.pos.y)}else noStroke(),fill(this.col[0],this.col[1],this.col[2],50),ellipse(this.pos.x,this.pos.y,2*this.radius),fill(this.col[0],this.col[1],this.col[2],150),ellipse(this.pos.x,this.pos.y,1.5*this.radius),fill(this.col[0],this.col[1],this.col[2],255),ellipse(this.pos.x,this.pos.y,this.radius)};
var RandomName="Jacob;William;Ethan;Daniel;Logan;God Of God;Matthew;Lucas;Jackson;David;Samuel;Dont Kill Me;Luke;Henry;Andrew;Nathan;Huong;Nhien;Hacker;Nhung;Huynh;Dat;Dinh;Hanh;Ros;Tay;Japan Anti Virus;Thanh;Hue;Nang;Mua;DeadClick;Bao;Tam;FuckYou;Dem;Sang;Cute;Dude;Kiss;Hope;Car;God;Ninja;Fake;Alan;Hoi;Diem;Master;Be Friend or Die;Ch\u1ea5m;Yi;Yasuo;Irela;Vi;Lux;Sion;Doctor;U r mine;Jinx;Jhin;Roma;Computer;Fax;Plane;Sky;Head;Tree;Lake;Water;Fire;Snow;Mountain;Dog;H\u00f3ng;Cat;Bird;Snack;Candy;Huu;Noah;Mason;Best Gamer;Hoang;Hien;Linh;Nam;Tam;Hau;Foria;J A V A;Hoa;Thao;Trang;Thuy;Huan;Luong;Test Game;...;Hao;Thuan;Nga;Huy;Hang;An;Anh;Call me;Thien;Ngan;<3;Love;Michael;Seclo;Play Alone;Heo;Julia;Jame;Thomson;LOL;Ris;Soldier;Tris;Nhan;Dang;Dam;Hi Five;Viet Nam;US".split(";"),
musics={SongList:[{name:"Sea Wave Sound - Nature Sound - Beach Bums",link:"https://api.soundcloud.com/tracks/200099207/stream?client_id=587aa2d384f7333a886010d5f52f302a"},{name:"Relaxation Music Sleeping - Rain and Thunder (1 hours) - ELIRT",link:"https://api.soundcloud.com/tracks/146823529/stream?client_id=587aa2d384f7333a886010d5f52f302a"},{name:"Relaxing Rain and Loud Thunder - R.J. Stefanski",link:"https://api.soundcloud.com/tracks/52301001/stream?client_id=587aa2d384f7333a886010d5f52f302a"},
{name:"Relaxing Rain and Thunder Sound , Sleep Meditation - Ibne Waheedi",link:"https://api.soundcloud.com/tracks/110697958/stream?client_id=587aa2d384f7333a886010d5f52f302a"},{name:"30 Minute Deep Sleep Music - T Mega",link:"https://api.soundcloud.com/tracks/237317520/stream?client_id=587aa2d384f7333a886010d5f52f302a"},{name:"RELAX \u2013 relaxdaily N\u00b0048 - relaxdaily",link:"https://api.soundcloud.com/tracks/49267945/stream?client_id=587aa2d384f7333a886010d5f52f302a"},{name:"Smooth jazz music - JWilborn",
link:"https://api.soundcloud.com/tracks/58735518/stream?client_id=587aa2d384f7333a886010d5f52f302a"},{name:"DEEP HOUSE SUMMER MIX 2 - AHMET KILIC - Ahmet Kilic",link:"https://api.soundcloud.com/tracks/143041228/stream?client_id=587aa2d384f7333a886010d5f52f302a"},{name:"As she passes - Levi Patel",link:"https://api.soundcloud.com/tracks/191576787/stream?client_id=587aa2d384f7333a886010d5f52f302a"},{name:"Maroon 5 - Girls Like You ft. Cardi B (Hiderway Remix)",link:"https://api.soundcloud.com/tracks/455069910/stream?client_id=587aa2d384f7333a886010d5f52f302a"},
{name:"TroyBoi - Afterhours (feat. Diplo & Nina Sky)",link:"https://api.soundcloud.com/tracks/224375276/stream?client_id=587aa2d384f7333a886010d5f52f302a"},{name:"DJ Snake ft. Justin Bieber - Let Me Love You (Koni Remix)",link:"https://api.soundcloud.com/tracks/276962559/stream?client_id=587aa2d384f7333a886010d5f52f302a"},{name:"Cartoon - Why We Lose (feat. Coleman Trapp)",link:"https://api.soundcloud.com/tracks/210195404/stream?client_id=587aa2d384f7333a886010d5f52f302a"},{name:"Electro-Light - Symbolism",
link:"https://api.soundcloud.com/tracks/178912631/stream?client_id=587aa2d384f7333a886010d5f52f302a"},{name:"Tobu - Infectious",link:"https://api.soundcloud.com/tracks/155512892/stream?client_id=587aa2d384f7333a886010d5f52f302a"},{name:"Nova - Ahrix",link:"https://api.soundcloud.com/tracks/81619639/stream?client_id=587aa2d384f7333a886010d5f52f302a"},{name:"Lensko - Cetus [NCS Release] - NCS",link:"https://api.soundcloud.com/tracks/162536037/stream?client_id=587aa2d384f7333a886010d5f52f302a"},{name:'"Sax On The Beach" Mixtape Part 1',
link:"https://api.soundcloud.com/tracks/105110459/stream?client_id=587aa2d384f7333a886010d5f52f302a"},{name:"Deep House Mix 2013 *Free Download* - Owen Royal",link:"https://api.soundcloud.com/tracks/75853154/stream?client_id=587aa2d384f7333a886010d5f52f302a"},{name:"Diamond Eyes - Flutter",link:"https://api.soundcloud.com/tracks/515672067/stream?client_id=587aa2d384f7333a886010d5f52f302a"},{name:"Last Heroes x TwoWorldsApart - Eclipse (feat. AERYN)",link:"https://api.soundcloud.com/tracks/512204838/stream?client_id=587aa2d384f7333a886010d5f52f302a"},
{name:"Robin Hustin x Tobimorrow - Light It Up (feat. Jex)",link:"https://api.soundcloud.com/tracks/484120113/stream?client_id=587aa2d384f7333a886010d5f52f302a"},{name:"Lost Sky - Dreams",link:"https://api.soundcloud.com/tracks/477898656/stream?client_id=587aa2d384f7333a886010d5f52f302a"},{name:"Unknown Brain - Perfect 10 (feat. Heather Sommer)",link:"https://api.soundcloud.com/tracks/470287734/stream?client_id=587aa2d384f7333a886010d5f52f302a"}]};
function Notification(a,b,c,d){this.textInside=a;this.size=b||20;this.col=c||[255,255,255,170];this.life=d;this.born=mil;this.run=function(){if(mil-this.born<this.life){var a=notifi.indexOf(this)*(this.size+10)+30;textAlign(CENTER);textSize(this.size);noStroke();fill(this.col[0],this.col[1],this.col[2],170);text(this.textInside,width/2,a)}else notifi.splice(notifi.indexOf(this),1)}}
var effects={force:function(a,b,c,d,e){var f=[],k=[],l=[];if(-1!=b.indexOf("bullet")){f=getBullets(c,d,e);for(var m=$jscomp.makeIterator(f),g=m.next();!g.done;g=m.next()){var h=g.value;p5.Vector.dist(h.pos,c)<h.info.radius+d&&(g="in"==a?p5.Vector.sub(c,h.pos):p5.Vector.sub(h.pos,c),h.vel.add(g.limit(h.info.speed)).limit(3*h.info.speed))}}if(-1!=b.indexOf("item"))for(k=getItems(c,d,e),m=$jscomp.makeIterator(k),g=m.next();!g.done;g=m.next())h=g.value,p5.Vector.dist(h.pos,c)<h.radius+d&&(g="in"==a?p5.Vector.sub(c,
h.pos):p5.Vector.sub(h.pos,c),h.vel.add(g.setMag(map(d+h.radius-g.mag(),0,d,1,10))));if(-1!=b.indexOf("player"))for(l=getPlayers(c,d,e),b=$jscomp.makeIterator(l),e=b.next();!e.done;e=b.next())e=e.value,p5.Vector.dist(e.pos,c)<e.radius+d&&(g="in"==a?p5.Vector.sub(c,e.pos):p5.Vector.sub(e.pos,c),e.vel.add(g.setMag(map(d+e.radius-g.mag(),0,d,1,e.vel.mag()))),e.nextPoint&&(e.nextPoint=null));return{bulls:f,items:k,players:l,all:l.concat(k).concat(f)}},explore:function(a,b,c,d){for(var e,f,k,l,m,g,h=0;h<
b;h++)f=random(5,10),g=25-f,e=v(random(-g,g),random(-g,g)),k=f/1.5,l=c||[random(255),random(255),random(255)],m=random(.1,.8),bArr.push(new Bullet(a,e,{name:"explore",damage:f,radius:k,speed:g,life:m,color:l},d))},smoke:function(a,b,c,d,e,f){f=f||50;for(var k=0;k<c;k++)sArr.push(new Smoke(a+random(-f,f),b+random(-f,f),d,e))},collision:function(a,b,c,d){c=c||p5.Vector.dist(a.pos,b.pos);if(c<a.radius+(b.radius||b.info.radius)){var e=.5*(c-a.radius-(b.radius||b.info.radius));b.pos.x+=e*(a.pos.x-b.pos.x)/
c;b.pos.y+=e*(a.pos.y-b.pos.y)/c;if(d){d=(b.pos.x-a.pos.x)/c;a=(b.pos.y-a.pos.y)/c;c=-a;e=b.vel.x*c+b.vel.y*d;var f=b.vel.mag();b.vel.x=c*e+d*f*.7;b.vel.y=d*e+a*f*.7}}}};function ExplorePoint(a,b,c,d,e,f){this.o=f;this.pos=v(a,b);this.num=c;this.col=d;this.timeCount=e;this.startTime=mil;this.radius=this.timeCount/10}
ExplorePoint.prototype.checkExplore=function(a){mil-this.startTime>=this.timeCount&&(effects.explore(this.pos,this.num,this.col,this.o),insideViewport(this)&&effects.force("out",["player","item"],this.pos,400),a.splice(a.indexOf(this),1))};ExplorePoint.prototype.show=function(){if(insideViewport(this)){var a=map(mil-this.startTime,0,this.timeCount,0,this.radius),b=map(a,0,this.radius,0,255);noStroke();fill(200,10,10,b);ellipse(this.pos.x,this.pos.y,this.radius-a)}};
function RedZone(a,b,c,d,e){this.o=e;this.pos=v(a,b);this.radius=c;this.ep=[];this.preDrop=mil;this.redRange=[120,255];this.redValue=random(120,255);this.grow=(this.redRange[1]-this.redRange[0])/50;this.born=mil;this.life=d}
RedZone.prototype.dropBoom=function(){if(mil-this.preDrop>1E5/this.radius){this.preDrop=mil;var a=v(random(-1,1),random(-1,1)).setMag(random(this.radius));a=p5.Vector.add(this.pos,a);this.ep.push(new ExplorePoint(a.x,a.y,random(10,20),[255,255,0],random(500,2E3),this.o));.5<random(1)?iArr.push(new Item(a.x,a.y)):.9<random(1)&&bArr.push(new Bullet(a,v(0,0),bulletTypes.Mine))}};
RedZone.prototype.show=function(){this.redValue+=this.grow;if(this.redValue<=this.redRange[0]||this.redValue>=this.redRange[1])this.grow*=-1;if(insideViewport(this)){noStroke();fill(this.redValue,10,10,35);ellipse(this.pos.x,this.pos.y,2*this.radius);for(var a=this.ep.length-1;0<=a;a--)this.ep[a].show()}for(a=this.ep.length-1;0<=a;a--)this.ep[a].checkExplore(this.ep);mil-this.born>this.life?redArr.splice(redArr.indexOf(this),1):this.dropBoom()};
function Portal(a,b,c,d,e,f,k){this.o=k;this.type=a;this.pos=v(b,c);this.radius=e||100;this.connectWith=d;this.life=f||10;this.born=mil;this.times=0;this.grow=[];this.grow[0]=this.radius;this.grow[1]=this.radius/2}
Portal.prototype.update=function(){if("in"==this.type&&this.connectWith){var a=effects.force("in",["player","item","bullet"],this.pos,this.radius,[]);if(this.connectWith){a=$jscomp.makeIterator(a.all);for(var b=a.next();!b.done;b=a.next())b=b.value,p5.Vector.dist(this.pos,b.pos)<(b.radius||b.info.radius)&&(b.pos=this.connectWith.pos.copy(),b.info||this.times++,b==p&&addSound("audio/punch_swing_01.mp3"))}}};Portal.prototype.run=function(){this.update();insideViewport(this)&&this.show();return this.end()};
Portal.prototype.end=function(){if((mil-this.born)/1E3>this.life||5<this.times)for(var a=0;a<pArr.length;a++){var b=pArr[a];if(this==b.inGate||this==b.outGate)return pArr.splice(a,1),!0}return!1};
Portal.prototype.show=function(){noStroke();"in"==this.type?fill(64,121,196,50):"out"==this.type&&fill(232,165,71,50);ellipse(this.pos.x,this.pos.y,1.5*this.radius,2*this.radius);for(var a=0;a<this.grow.length;a++)"in"==this.type&&this.connectWith?(this.grow[a]-=60/(fr+1)+random(-1,1),0>this.grow[a]&&(this.grow[a]=this.radius)):"out"==this.type&&(this.grow[a]+=60/(fr+1)+random(-1,1),this.grow[a]>this.radius&&(this.grow[a]=0));for(a=0;a<this.grow.length;a++)ellipse(this.pos.x,this.pos.y,1.5*this.grow[a],
2*this.grow[a])};function Smoke(a,b,c,d){this.pos=v(a,b);this.vel=v(0,0);this.radius=d||floor(random(10,50));this.born=mil;this.life=c}
Smoke.prototype.show=function(){if(insideViewport(this)){this.vel.add(random(-1,1),random(-1,1));this.pos.add(this.vel);this.vel.mult(.9);100>this.radius&&(this.radius+=random(7)*(30/(fr+1)));var a=map(this.life-(mil-this.born),0,this.life,30,255);fill(a,2*a);noStroke();ellipse(this.pos.x,this.pos.y,2*this.radius)}mil-this.born>this.life&&sArr.splice(sArr.indexOf(this),1)};
function Bullet(a,b,c,d){this.info=c;this.pos=a.copy();this.vel=b;this.o=d;this.born=mil;this.col=this.info.color||[random(255),random(255),random(255)];this.info.whenfire&&this.info.whenfire(this)}Bullet.prototype.run=function(){this.update();insideViewport(this)&&this.show();this.info.working&&this.info.working(this);(mil-this.born)/1E3>this.info.life&&this.end()};Bullet.prototype.end=function(){this.info.finished&&this.info.finished(this);bArr.splice(bArr.indexOf(this),1)};
Bullet.prototype.update=function(){this.pos.add(this.vel.copy().mult(60/(fr+1)));collisionEdge(this,.99)};Bullet.prototype.show=function(){noStroke();fill(this.col[0],this.col[1],this.col[2],200);ellipse(this.pos.x,this.pos.y,2*this.info.radius)};function Gun(a,b){this.info=b;this.o=a;this.preShoot=0;this.bullsLeft=this.info.maxBulls}
Gun.prototype.fire=function(a){if(0<this.bullsLeft){if(!this.reloading&&mil-this.preShoot>=1E3*this.info.delay){for(var b=100-100*this.info.hitRatio,c,d,e=0;e<this.info.bullsPerTimes;e++)c=v(a.x-this.o.pos.x,a.y-this.o.pos.y).add(random(-b,b),random(-b,b)),d=c.copy().setMag(this.o.weapon.bullet.speed+(1<this.o.weapon.gun.info.bullsPerTimes?random(-2,2):0)),c=this.o.pos.copy().add(c.copy().setMag(this.o.radius+this.o.weapon.bullet.radius+5)),bArr.push(new Bullet(c,d,this.o.weapon.bullet,this.o));this.preShoot=
mil;this.bullsLeft--}}else this.reload(),this.o==viewport.target&&addSound("audio/empty_fire_01.mp3",!1,.7)};Gun.prototype.reload=function(){this.preShoot=mil+1E3*this.info.reloadTime;this.bullsLeft=this.info.maxBulls;this.reloading=!0};Gun.prototype.update=function(){this.reloading&&mil>this.preShoot&&(this.reloading=!1,this.preShoot=mil-1E3*this.info.delay)};
var gunTypes={Minigun:{maxBulls:60,delay:.1,reloadTime:2,bullsPerTimes:2,hitRatio:.7},AK:{maxBulls:30,delay:.125,reloadTime:1,bullsPerTimes:1,hitRatio:.9},Lazer:{maxBulls:35,delay:.2,reloadTime:1,bullsPerTimes:1,hitRatio:.85},Mine:{maxBulls:5,delay:.5,reloadTime:2,bullsPerTimes:1,hitRatio:1},Bazoka:{maxBulls:2,delay:1,reloadTime:2,bullsPerTimes:1,hitRatio:.9},Shotgun:{maxBulls:5,delay:.7,reloadTime:1.25,bullsPerTimes:4,hitRatio:.3},Portalgun:{maxBulls:2,delay:1,reloadTime:2,bullsPerTimes:1,hitRatio:1}},
bulletTypes={AK:{name:"AK",damage:3,radius:4,speed:20,life:1.5,color:[255,255,0]},Shotgun:{name:"Shotgun",damage:4,radius:5,speed:20,life:1,color:[200,255,10]},Minigun:{name:"Mini",damage:1,radius:3,speed:22,life:1,color:[255,255,0]},Bazoka:{name:"Bazoka",damage:1,radius:15,speed:14,life:4,color:[200,10,10],finished:function(a){effects.explore(a.pos,15,[255,255,0],a.o);effects.force("out",["player","item"],a.pos,400,[]);effects.smoke(a.pos.x,a.pos.y,3,600)},working:function(a){30<mil-(a.smoked||1)&&
(effects.smoke(a.pos.x,a.pos.y,1,200,random(10,30),15),a.smoked=mil)}},Mine:{name:"Mini",damage:5,radius:10,speed:.1,life:30,color:null,finished:function(a){epArr.push(new ExplorePoint(a.pos.x,a.pos.y,30,[255,100,50],400,a.o));setTimeout(function(){effects.smoke(a.pos.x,a.pos.y,4,1E3)},400)}},PortalBullet:{name:"PortalBullet",damage:0,radius:7,speed:12,life:4,color:[232,165,71],whenfire:function(a){a.forceType=random(["in","out"])},working:function(a){noStroke();effects.force(a.forceType,["player",
"item","bullet"],a.pos,100,[a,a.o]);"in"==a.forceType?fill(200,10,10,random(0,30)):fill(10,200,10,random(0,30));ellipse(a.pos.x,a.pos.y,150,150)},finished:function(a){for(var b=!1,c=pArr.length-1;0<=c;c--){var d=pArr[c];if(d.inGate.o==a.o&&!d.outGate){b=d;d.outGate=new Portal("out",a.pos.x,a.pos.y,null,null,10,a.o);d.inGate.connectWith=d.outGate;d.inGate.born=mil;effects.smoke(a.pos.x,a.pos.y,5,1500);break}}b||(a={inGate:new Portal("in",a.pos.x,a.pos.y,null,null,10,a.o),outGate:null},pArr.push(a))}},
RedzoneBullet:{name:"RedzoneBullet",damage:10,radius:15,speed:8,life:4,color:[255,150,30],working:function(a){effects.force("in",["player","item","bullet"],a.pos,(mil-a.born)/20,[a.o,a]);noStroke();fill(40,168,102,random(0,10));ellipse(a.pos.x,a.pos.y,(mil-a.born)/10,(mil-a.born)/10)},finished:function(a){effects.explore(a.pos,10,[200,200,0],a.o);redArr.push(new RedZone(a.pos.x,a.pos.y,(mil-a.born)/10,5E3,a.o));effects.smoke(a.pos.x,a.pos.y,3,600)}},Lazer:{name:"Lazer",damage:4.5,radius:3.5,speed:30,
life:1,color:[255,30,30],working:function(a){strokeWeight(7);stroke(255,30,30);beginShape();for(var b=0;3>b;b++)vertex(a.pos.x+a.vel.x*b,a.pos.y+a.vel.y*b);endShape(CLOSE)},finished:function(a){effects.smoke(a.pos.x,a.pos.y,1,200,5,!0)}},Bomb:{name:"Bomb",damage:0,radius:0,speed:50,life:1,color:null,whenfire:function(a){var b=a.o==p?fakeToReal(mouseX,mouseY):a.o.target;var c=p5.Vector.sub(b,a.o.pos);c.limit(a.o.radius+500);b=c.add(a.o.pos);epArr.push(new ExplorePoint(b.x,b.y,20,[200,200,0],700,a.o));
setTimeout(function(){effects.smoke(b.x,b.y,3,800);effects.force("out",["player","item"],b,400,[])},700)},working:function(a){noFill();stroke(150,30);strokeWeight(3);var b=a.o.pos;ellipse(b.x,b.y,2*(a.o.radius+500))}},Rocket:{name:"Rocket",damage:5,radius:10,speed:15,life:4,color:[200,10,10],whenfire:function(a){a.collapseTimes=1},working:function(a){if(a.target)4>a.collapseTimes&&(a.vel=p5.Vector.lerp(a.vel,p5.Vector.sub(a.target.pos,a.pos).setMag(a.info.speed),.05),noFill(),strokeWeight(1),stroke(200,
10,10,100),ellipse(a.target.pos.x,a.target.pos.y,2*a.target.radius+10),line(a.pos.x,a.pos.y,a.target.pos.x,a.target.pos.y),a.target.hide&&(a.target=null));else{var b=getPlayers(a.pos,100,[a.o]);if(b.length){var c=null,d=100+maxSizeNow;b=$jscomp.makeIterator(b);for(var e=b.next();!e.done;e=b.next())if(e=e.value,!e.hide&&a.o.idTeam&&a.o.idTeam!=e.idTeam){var f=p5.Vector.dist(e.pos,a.pos);f<d&&f<e.radius+100&&(d=f,c=e)}a.target=c}noFill();strokeWeight(3);stroke(100,random(100));ellipse(a.pos.x,a.pos.y,
200)}30<mil-(a.smoked||1)&&(effects.smoke(a.pos.x,a.pos.y,1,200,random(10,30),15),a.smoked=mil)},finished:function(a){effects.explore(a.pos,15,[255,255,0],a.o);effects.force("out",["player","item"],a.pos,400,[]);effects.smoke(a.pos.x,a.pos.y,3,600)}},Turret:{name:"Turret",damage:10,radius:20,speed:1,life:10,color:[20,20,20],whenfire:function(a){a.preShoot=mil;a.shootCount=0;a.dir=0},working:function(a){var b=getPlayers(a.pos,300,[a.o]);if(b.length){var c=null,d=300+maxSizeNow;b=$jscomp.makeIterator(b);
for(var e=b.next();!e.done;e=b.next())if(e=e.value,!e.hide&&a.o.idTeam&&a.o.idTeam!=e.idTeam){var f=p5.Vector.dist(e.pos,a.pos);f<d&&f<e.radius+300&&(d=f,c=e)}a.target=c}else a.target=null;drawPlayerWithShape({pos:a.pos,vel:a.vel,radius:30,col:a.o.col},"Pentagon",a.dir);if(a.target){if(noFill(),strokeWeight(1),stroke(200,10,10,100),ellipse(a.target.pos.x,a.target.pos.y,2*a.target.radius+10),line(a.pos.x,a.pos.y,a.target.pos.x,a.target.pos.y),250<mil-a.preShoot){a.preShoot=mil;switch(a.shootCount){case 2:c=
bulletTypes.SuperSnow;break;case 6:c=bulletTypes.Bazoka;break;case 8:c=bulletTypes.Rocket;break;default:c=bulletTypes.Lazer}d=p5.Vector.sub(a.target.pos.copy().add(2*a.target.vel.x,2*a.target.vel.y),a.pos);b=d.copy().setMag(c.speed);bArr.push(new Bullet(a.pos,b,c,a.o));a.dir=d.heading();a.shootCount+=8<=a.shootCount?-8:1}}else noFill(),stroke(100,random(100)),strokeWeight(2),ellipse(a.pos.x,a.pos.y,600)},finished:function(a){epArr.push(new ExplorePoint(a.pos.x,a.pos.y,20,[200,200,0],250,a.o));setTimeout(function(){effects.smoke(a.pos.x,
a.pos.y,3,1E3);effects.force("out",["player","item"],a.pos,400,[])},250)}},SnowBall:{name:"SnowBall",damage:3.5,radius:10,speed:20,life:1.5,color:[150,200,255],finished:function(a){effects.smoke(a.pos.x,a.pos.y,1,200,5,!0)},effectToTarget:function(a){a.setFric(.5,200)}},SuperSnow:{name:"SuperSnow",damage:1,radius:20,speed:15,life:4,color:[150,200,255],finished:function(a){effects.smoke(a.pos.x,a.pos.y,3,500,15,1);for(var b=0;7>b;b++){var c=v(random(-1,1),random(-1,1)).setMag(random(15));bArr.push(new Bullet(a.pos,
c,bulletTypes.SnowBall,a.o))}},effectToTarget:function(a){a.setFric(.1,1500)}}},weapons={AK:{name:"AK",gun:gunTypes.AK,bullet:bulletTypes.AK,color:[255,255,255],sound:"audio/mp5_01.mp3"},Shotgun:{name:"Shotgun",gun:gunTypes.Shotgun,bullet:bulletTypes.Shotgun,color:[255,255,255],sound:"audio/sv98_01.mp3"},Minigun:{name:"Minigun",gun:gunTypes.Minigun,bullet:bulletTypes.Minigun,color:[77,155,111],sound:""},Mine:{name:"Mine",gun:gunTypes.Mine,bullet:bulletTypes.Mine,color:[77,155,111],sound:""},Bazoka:{name:"Bazoka",
gun:gunTypes.Bazoka,bullet:bulletTypes.Bazoka,color:[74,91,173],sound:"audio/mosin_01.mp3"},DropBomb:{name:"DropBomb",gun:gunTypes.Bazoka,bullet:bulletTypes.Bomb,color:[74,91,173],sound:""},Lazer:{name:"Lazer",gun:gunTypes.Lazer,bullet:bulletTypes.Lazer,color:[183,96,86],sound:""},SnowBall:{name:"SnowBall",gun:gunTypes.Lazer,bullet:bulletTypes.SnowBall,color:[183,96,86],sound:""},SuperSnow:{name:"SuperSnow",gun:gunTypes.Bazoka,bullet:bulletTypes.SuperSnow,color:[176,87,186],sound:""},PortalGun:{name:"PortalGun",
gun:gunTypes.Portalgun,bullet:bulletTypes.PortalBullet,color:[183,96,86],sound:""},Redzone:{name:"Redzone",gun:gunTypes.Bazoka,bullet:bulletTypes.RedzoneBullet,color:[183,96,86],sound:""},Rocket:{name:"Rocket",gun:gunTypes.Bazoka,bullet:bulletTypes.Rocket,color:[176,87,186],sound:""},Turret:{name:"Turret",gun:gunTypes.Bazoka,bullet:bulletTypes.Turret,color:[176,87,186],sound:""}};
function InfoWeapon(){this.pos=v(0,height-10-25);this.size=v(100,50);this.show=function(){this.pos.x=width-this.size.x/2-5;this.pos.y=height-gmap.minimapSize-10-this.size.y;strokeWeight(2);for(var a=3;0<=a;a--){if(viewport.target.weaponBox[a]==viewport.target.weapon){stroke(150);var b=255}else b=70,noStroke();fill(120,50);rect(this.pos.x,this.pos.y-.25*this.size.y,this.size.x,.5*this.size.y);fill(0,50);rect(this.pos.x,this.pos.y+.25*this.size.y,this.size.x,.5*this.size.y);if(viewport.target.weaponBox[a]){noStroke();
textAlign(CENTER);var c=viewport.target.weaponBox[a].color;fill(c[0],c[1],c[2],b);text(viewport.target.weaponBox[a].name,this.pos.x,this.pos.y-.15*this.size.y);viewport.target.weaponBox[a].gun.reloading?(fill(255,150,20,b),text("...",this.pos.x,this.pos.y+this.size.y/3)):(fill(255,b),text(viewport.target.weaponBox[a].gun.bullsLeft,this.pos.x,this.pos.y+.3*this.size.y))}this.pos.y-=this.size.y+20}}}var teams={};
function addPlayerToTeam(a,b){teams[b]?teams[b].teamate.push(a):teams[b]={id:b,teamate:[a],leader:0};changeLeader(b)}function changeLeader(a){if(0<teams[a].teamate.length){for(var b=0,c=0;c<teams[a].teamate.length;c++){var d=teams[a].teamate[c];if(d==p)return p;d.health>b&&(b=d.health,teams[a].leader=c)}return getLeader(a)}return!1}function getLeader(a){return teams[a].teamate[teams[a].leader]}
function Character(a,b,c,d,e,f){this.radius=30;this.name=a||RandomName[floor(random(RandomName.length))];this.pos=v(b,c);this.vel=v(0,0);this.col=d||[random(255),random(255),random(255)];this.idTeam=f;this.health=e||random(100,300);this.score=10;this.killed=0;this.maxSpeed=4;this.healthShield=50;this.weaponBox=[];this.friction=.95;this.updateSize()}
Character.prototype.run=function(){this.weapon.gun.update();this.update();this.eat();insideViewport(this)&&this.show(this==p?fakeToReal(mouseX,mouseY):this.target);collisionBullets(this)};Character.prototype.update=function(){this.pos.add(this.vel.copy().mult(60/(fr+1)));this.vel.mult(this.friction);this.vel.limit(this.maxSpeed);this.collidePlayer();this.updateFric();this.shield&&this.makeShield();50>this.healthShield&&(this.healthShield+=30/(fr+1)*.1)};
Character.prototype.show=function(a){noStroke();fill(this.col[0],this.col[1],this.col[2]);a?drawPlayerWithShape(this,this.shield?"Circle":"Pentagon",p5.Vector.sub(a,this.pos).heading()):drawPlayerWithShape(this,this.shield?"Circle":"Pentagon",this.vel.heading());this.hide?fill(70):fill(200);textAlign(CENTER);text(floor(this.health)+(this.shield?" +"+floor(this.healthShield):""),this.pos.x,this.pos.y-this.radius-10);fill(90);text(this.name,this.pos.x,this.pos.y-this.radius-30)};
Character.prototype.setFric=function(a,b){a<=this.friction&&(this.friction=a,this.fricTime=mil+b)};Character.prototype.updateFric=function(){this.fricTime&&this.fricTime<mil&&(this.friction=.95,this.fricTime=0)};Character.prototype.collidePlayer=function(){var a=getPlayers(this.pos,this.radius+maxSizeNow,[this]);if(a.length){a=$jscomp.makeIterator(a);for(var b=a.next();!b.done;b=a.next())effects.collision(this,b.value)}};
Character.prototype.eat=function(){var a=new Circle(this.pos.x,this.pos.y,this.radius+100);a=quadItems.query(a);a=$jscomp.makeIterator(a);for(var b=a.next();!b.done;b=a.next())b.value.eatBy(this)};
Character.prototype.makeShield=function(){var a=30+this.healthShield/2,b={pos:this.pos,radius:a},c=getBullets(this.pos,a);if(c.length){c=$jscomp.makeIterator(c);for(var d=c.next();!d.done;d=c.next())d=d.value,this.healthShield>=d.info.damage?(this.healthShield-=d.info.damage,effects.collision(b,d,!1,!0)):this.healthShield=0,d.collapseTimes&&d.collapseTimes++}strokeWeight(1);stroke(70);fill(this.col[0],this.col[1],this.col[2],random(30,50));ellipse(this.pos.x,this.pos.y,2*a,2*a)};
Character.prototype.updateSize=function(){var a=.3*this.health;20<a&&300>a?this.radius=a:20>=a?this.radius=20:300<=a&&(this.radius=300)};Character.prototype.changeWeapon=function(a){a=this.weaponBox.indexOf(this.weapon)+a;a=0>a?this.weaponBox.length-1:a%this.weaponBox.length;this.changeWeaponTo(a)};Character.prototype.changeWeaponTo=function(a){a%=this.weaponBox.length;this.weapon=this.weaponBox[a]};
Character.prototype.addWeapon=function(a){var b=!1;if(this.weaponBox.length)for(var c=$jscomp.makeIterator(this.weaponBox),d=c.next();!d.done;d=c.next())if(d=d.value,a==d.name){b=!0;break}if(b)for(b=$jscomp.makeIterator(this.weaponBox),d=b.next();!d.done;d=b.next()){if(d=d.value,d.name==a){d.gun.bullsLeft=d.gun.info.maxBulls;break}}else a=clone(weapons[a]),a.gun=new Gun(this,a.gun),4>this.weaponBox.length?(this.weaponBox.push(a),this.changeWeaponTo(this.weaponBox.length-1)):(b=this.weaponBox[this.weaponBox.indexOf(this.weapon)].name,
c=this.weaponBox.indexOf(this.weapon),this.weaponBox[c]=a,this.weapon=this.weaponBox[c],a=new Item(this.pos.x,this.pos.y,null,this.col,b),a.vel=v(random(-1,1),random(-1,1)).setMag(5),iArr.push(a))};
function drawPlayerWithShape(a,b,c){switch(b){case "Circle":push();translate(a.pos.x,a.pos.y);rotate(c);fill(a.col);ellipse(0,0,2*a.radius,2*a.radius);fill(0);ellipse(a.radius/2,0,a.radius,a.radius/1.5*2);pop();break;case "Pentagon":push(),translate(a.pos.x,a.pos.y),b=a.vel.heading(),strokeWeight(1),rotate(b),stroke(255,180),fill(a.col),polygon(0,0,a.radius,5),stroke(30),strokeWeight(a.radius/2),point(a.radius/3*2,0),fill(0,200),stroke(150),strokeWeight(2),rotate(c-b),rect(a.radius/2,0,a.radius/1.5*
2,.4*a.radius),fill(0),ellipse(0,0,a.radius/3*2,a.radius/3*2),pop()}}function AICharacter(a,b,c,d,e,f){Character.call(this,a,b,c,d,e,f);this.weaponBox=[];for(a=0;4>a;a++)b=getObjectLength(weapons),this.addWeapon(getValueAtIndex(weapons,floor(random(b))));this.changeWeaponTo(floor(random(this.weaponBox.length)))}AICharacter.prototype=Object.create(Character.prototype);AICharacter.prototype.constructor=AICharacter;
AICharacter.prototype.update=function(){Character.prototype.update.call(this);collisionEdge(this,.6);1<team&&this.idTeam==viewport.target.idTeam&&(this!=viewport.target&&(stroke(0,255,0),strokeWeight(3),noFill(),ellipse(this.pos.x,this.pos.y,2*this.radius+30)),stroke(150,30),strokeWeight(2),line(this.pos.x,this.pos.y,viewport.target.pos.x,viewport.target.pos.y))};
AICharacter.prototype.eat=function(a){a=new Circle(this.pos.x,this.pos.y,this.radius+100);a=quadItems.query(a);a=$jscomp.makeIterator(a);for(var b=a.next();!b.done;b=a.next())b=b.value,b.eatBy(this),b.namGun&&60>p5.Vector.dist(this.pos,b.pos)&&(iArr.splice(iArr.indexOf(b),1),this.addWeapon(b.nameGun))};
AICharacter.prototype.move=function(){1<team&&this.followLeader();if(!this.nextPoint||p5.Vector.dist(this.pos,this.nextPoint)<this.radius||!isInside(this.nextPoint,v(gmap.size.x/2,gmap.size.y/2),v(gmap.size.x-3*this.radius,gmap.size.y-3*this.radius))){var a=getItems(this.pos,this.radius+height/2,!1,[],!0);if(0<a.length)this.nextPoint=a[floor(random(a.length))].pos;else{a=this.pos.x+random(-500,500);var b=this.pos.y+random(-500,500);this.nextPoint=v(a,b)}}else this.vel.mag()<this.maxSpeed/1.2&&this.vel.add((this.nextPoint.x-
this.pos.x)/4,(this.nextPoint.y-this.pos.y)/4).limit(this.maxSpeed),this.vel.mult(this.friction)};AICharacter.prototype.fireTo=function(a){this.shield||(0==this.weapon.gun.bullsLeft&&.3<random(1)&&this.changeWeapon(1),this.weapon.gun.fire(a))};
AICharacter.prototype.fire=function(){this.target=null;if(!this.hide){var a=min(this.radius+width/2,this.radius+height/2),b=getPlayers(this.pos,a+maxSizeNow,[this]);b=$jscomp.makeIterator(b);for(var c=b.next();!c.done;c=b.next())if(c=c.value,!c.hide&&this.idTeam&&c.idTeam!=this.idTeam){var d=p5.Vector.dist(this.pos,c.pos);if(d<a+c.radius&&(!e||d<e)){var e=d;var f=c}}f?(this.health>f.health?(a=f.radius+this.radius+150,e=p5.Vector.sub(this.pos,f.pos),this.nextPoint=f.pos.copy().add(e.setMag(a)),this.shield=
!1):(25>this.health&&(this.shield=!0),this.nextPoint||(this.nextPoint=f.pos.copy().add(random(-500,500),random(-500,500)))),this.target=f.pos,this.fireTo(f.pos.copy())):this.shield=25>this.health?!0:!1}};
AICharacter.prototype.die=function(a){var b=!1;a&&a.o&&(a.o.idTeam!=this.idTeam&&a.o.killed++,a.o.nextPoint=this.pos.copy(),b=a.o==this?!1:a.o);b?addMessage(b.name+" has killed "+this.name+".","",!0):addMessage(this.name+" was died.","",!0);this==viewport.target&&setTimeout(function(){p||viewport.changeTarget(b)},1500);p&&this.idTeam==p.idTeam&&addAlertBox('"'+this.name+'" in your Team was died.',"#f55","#fff");1<team&&this==getLeader(this.idTeam)&&(teams[this.idTeam].teamate.splice(teams[this.idTeam].leader,
1),changeLeader(this.idTeam));eArr.splice(eArr.indexOf(this),1);for(a=0;2>a;a++){var c=floor(random(this.weaponBox.length));iArr.push(new Item(this.pos.x,this.pos.y,null,this.col,this.weaponBox[c].name))}for(a=0;a<random(this.score/2,this.score);a++)c=v(random(-1,1),random(-1,1)).setMag(random(1.5*this.score)),c=p5.Vector.add(this.pos,c),iArr.push(new Item(c.x,c.y,null,this.col));p?eArr.length||(addAlertBox("Congratulations .You Won this match","#5f5","#000"),a=hexToRgb(document.getElementById("pickColor").value),
addMessage(pname+" Win","Server",!0,color(a.r,a.g,a.b)),menuWhenDie("open")):1==eArr.length&&(a=eArr[0].col,addAlertBox(eArr[0].name+" Won this match","#5f5","#000"),addMessage(eArr[0].name+" Win","Server",!0,color(a[0],a[1],a[2])))};AICharacter.prototype.followLeader=function(){var a=getLeader(this.idTeam);2E3<p5.Vector.dist(this.pos,a.pos)&&(this.nextPoint=a.pos.copy().add(random(-500,500),random(-500,500)))};
function Player(a,b,c,d,e,f){Character.call(this,a,b,c,d,e,f);this.weaponBox=[];for(a=0;2>a;a++)this.addWeapon(getValueAtIndex(weapons,a),!0);this.changeWeaponTo(0)}Player.prototype=Object.create(Character.prototype);Player.prototype.constructor=Player;Player.prototype.update=function(){Character.prototype.update.call(this);150<(this.sLen||151)&&(this.sLen=1,addSound("audio/footstep_sand_01.mp3"));this.sLen+=this.vel.copy().mult(60/(fr+1)).mag()};
Player.prototype.show=function(a){Character.prototype.show.call(this,a);10<=this.killed?this.pos.x<this.radius/2||this.pos.y<this.radius/2||this.pos.x>gmap.size.x-this.radius/2||this.pos.y>gmap.size.y-this.radius/2?(this.maxSpeed=25,hiding_info(),noStroke(),a=this.vel.mag(),a>.75*this.maxSpeed?(.7<random()&&(effects.smoke(this.pos.x,this.pos.y,2,500,this.radius/3,random(-this.radius,this.radius)),this.shield&&2<this.healthShield?this.healthShield-=2:(this.health-=.5,0>=this.health&&(collisionEdge(this,
0),this.die()),this.updateSize())),fill(255,50,0,150),text("Warning !! Too fast. Losing health.",this.pos.x,this.pos.y+this.radius+50)):(fill(255,255,0,150),text("This's not a Bug, This is the Future.",this.pos.x,this.pos.y+this.radius+50),fill(255,200,0,70),text("There is something out here, Find it.",this.pos.x,this.pos.y+this.radius+75),text("Press B to come back.",this.pos.x,this.pos.y+this.radius+100)),fill(150,10,10,map(a,0,this.maxSpeed,0,150)),ellipse(this.pos.x,this.pos.y,2*this.radius+random(10,
30),2*this.radius+random(10,30)),this.pos.x>1.5*gmap.size.x?(createWorld(),addAICharacter(),this.pos.x=.5*-gmap.size.x):this.pos.x<.5*-gmap.size.x&&(createWorld(),addAICharacter(),this.pos.x=1.5*gmap.size.x),this.pos.y>1.5*gmap.size.y?(createWorld(),addAICharacter(),this.pos.y=.5*-gmap.size.y):this.pos.y<.5*-gmap.size.y&&(createWorld(),addAICharacter(),this.pos.y=1.5*gmap.size.y),viewport.follow&&viewport.target==this&&(viewport.pos=this.pos.copy())):this.maxSpeed=5:collisionEdge(this,.6)};
Player.prototype.move=function(){keyIsDown(87)&&this.vel.add(0,-1);keyIsDown(83)&&this.vel.add(0,1);keyIsDown(65)&&this.vel.add(-1,0);keyIsDown(68)&&this.vel.add(1,0);keyIsDown(38)&&this.vel.add(0,-1);keyIsDown(40)&&this.vel.add(0,1);keyIsDown(37)&&this.vel.add(-1,0);keyIsDown(39)&&this.vel.add(1,0)};
Player.prototype.eat=function(){var a=new Circle(this.pos.x,this.pos.y,this.radius+100),b=quadItems.query(a);this.nearGun=null;a=!1;var c=this.radius+50;b=$jscomp.makeIterator(b);for(var d=b.next();!d.done;d=b.next())d=d.value,d.eatBy(this),d.nameGun&&p5.Vector.dist(this.pos,d.pos)<c&&(c=p5.Vector.dist(this.pos,d.pos),this.nearGun=d,a=!0);a&&(noStroke(),fill(150),text("F : "+this.nearGun.nameGun,this.pos.x,this.pos.y+this.radius+30),fill(150,30),stroke(this.nearGun.col[0],this.nearGun.col[1],this.nearGun.col[2]),
ellipse(this.nearGun.pos.x,this.nearGun.pos.y,40))};Player.prototype.fireTo=function(a){this.shield||this.weapon.gun.fire(a)};Player.prototype.pickWeapon=function(){this.nearGun&&(iArr.splice(iArr.indexOf(this.nearGun),1),this.addWeapon(this.nearGun.nameGun))};Player.prototype.changeWeapon=function(a){Character.prototype.changeWeapon.call(this,a);addSound("audio/gun_switch_01.mp3",!1,.7)};Player.prototype.addWeapon=function(a,b){Character.prototype.addWeapon.call(this,a);b||addSound("audio/chest_pickup_01.mp3")};
Player.prototype.die=function(a){var b=!1;a&&a.o&&(a.o.idTeam!=this.idTeam&&a.o.killed++,a.o.nextPoint=this.pos.copy(),b=a.o==this?!1:a.o);addAlertBox("You was killed "+(b?"by "+b.name:"yourself"),"#f55","#fff");b?addMessage(b.name+" has killed "+this.name+".","",!0):addMessage(this.name+" was died.","",!0);addMessage("You was killed "+(b?"by "+b.name:"yourself"),"",!0,color(255,255,0));p=null;setTimeout(function(){p||(viewport.changeTarget(b),menuWhenDie("open"))},1500);1<team&&this==getLeader(this.idTeam)&&
(teams[this.idTeam].teamate.splice(teams[this.idTeam].leader,1),changeLeader(this.idTeam));for(a=0;2>a;a++){var c=floor(random(this.weaponBox.length));iArr.push(new Item(this.pos.x,this.pos.y,null,this.col,this.weaponBox[c].name))}for(a=0;a<random(this.score/2,this.score);a++)c=v(random(-1,1),random(-1,1)).setMag(random(1.5*this.score)),c=p5.Vector.add(this.pos,c),iArr.push(new Item(c.x,c.y,null,this.col))};
function Boss(a,b,c,d,e,f){AICharacter.call(this,a,b,c,d,e,f);this.isBoss=!0;this.maxSpeed=10}Boss.prototype=Object.create(AICharacter.prototype);Boss.prototype.constructor=Boss;Boss.prototype.fireTo=function(a){this.shield||(0==this.weapon.gun.bullsLeft&&this.changeWeapon(1),this.weapon.gun.fire(a))};Boss.prototype.fire=function(){this.target&&this.fireTo(this.target)};
Boss.prototype.move=function(){var a=getPlayers(this.pos,this.radius+width/2,[this],!0);a.length?(this.nextPoint=a[0].pos.copy().add(random(500)),this.target=a[0].pos):!this.nextPoint||p5.Vector.dist(this.pos,this.nextPoint)<this.radius?p&&.5<random(1)?(this.nextPoint=p.pos.copy().add(random(500)),this.target=p.pos):(a=floor(random(eArr.length)),this.nextPoint=eArr[a].pos.copy().add(random(500)),this.target=eArr[a].pos):(this.vel.mag()<this.maxSpeed/1.2&&this.vel.add((this.nextPoint.x-this.pos.x)/
4,(this.nextPoint.y-this.pos.y)/4).limit(this.maxSpeed),this.vel.mult(this.friction))};
function addAICharacter(){eArr=[];for(var a=1;a<floor(maxE/team+1);a++){for(var b=v(random(gmap.size.x),random(gmap.size.y)),c=0;c<team;c++){var d=new AICharacter(null,b.x+random(-500,500),b.y+random(-500,500),null,null,a+1);addPlayerToTeam(d,a+1);eArr.push(d)}changeLeader(a+1)}for(c=1;c<team;c++)d=new AICharacter(null,p.pos.x+random(-500,500),p.pos.y+random(-500,500),null,null,1),addPlayerToTeam(d,1),eArr.push(d)}
function addPlayer(){var a=hexToRgb(document.getElementById("pickColor").value);a=[a.r,a.g,a.b];p=new Player(pname,random(gmap.size.x),random(gmap.size.y),a,100,1);addPlayerToTeam(p,1);effects.smoke(p.pos.x,p.pos.y,5,700,30);addSound("audio/punch_swing_01.mp3")}
function createWorld(){bArr=[];iArr=[];pArr=[];redArr=[];epArr=[];wArr=[];rArr=[];tArr=[];for(var a=0;a<world.maxRock;a++)rArr.push(new Rock(random(gmap.size.x),random(gmap.size.y),random(world.SizeRock[0],world.SizeRock[1])));for(a=0;a<world.maxBarrel;a++)rArr.push(new Barrel(random(gmap.size.x),random(gmap.size.y),random(world.SizeBarrel[0],world.SizeBarrel[1])));for(a=0;a<world.maxTree;a++)tArr.push(new Tree(random(gmap.size.x),random(gmap.size.y),random(world.SizeTree[0],world.SizeTree[1])));
for(a=0;a<world.maxWater;a++)wArr.push(new Water(random(gmap.size.x),random(gmap.size.y),random(world.SizeWater[0],world.SizeWater[1])));gmap.createMinimap()}function reset(){eArr=[];sArr=[];notifi=[];teams={};addPlayer();addAICharacter();viewport=new Viewport(p);createWorld()}function realToFake(a,b){return v(width/2+a-viewport.pos.x,height/2+b-viewport.pos.y)}function fakeToReal(a,b){return v(a-width/2+viewport.pos.x,b-height/2+viewport.pos.y)}
function collisionBullets(a){var b=new Circle(a.pos.x,a.pos.y,a.radius+50),c=quadBulls.query(b);b=!1;if(c.length){c=$jscomp.makeIterator(c);for(var d=c.next();!d.done;d=c.next())if(d=d.value,p5.Vector.dist(a.pos,d.pos)<a.radius+d.info.radius){d.info.effectToTarget&&d.info.effectToTarget(a);a.health-=d.info.damage;a.updateSize();b=!0;var e=d;d.end()}b&&(a.nextPoint=null,b=2*a.radius+30,fill(255,0,0,120),ellipse(a.pos.x,a.pos.y,b,b));0>=a.health&&a.die(e)}}
function collisionEdge(a,b){var c=a.radius||a.info.radius,d=gmap.size.y-c,e=gmap.size.x-c;a.pos.y<c?(a.vel.y*=-b,a.pos.y=c):a.pos.y>d&&(a.vel.y*=-b,a.pos.y=d);a.pos.x<c?(a.vel.x*=-b,a.pos.x=c):a.pos.x>e&&(a.vel.x*=-b,a.pos.x=e)}function isInside(a,b,c){return a.x>b.x-c.x/2&&a.x<b.x+c.x/2&&a.y>b.y-c.y/2&&a.y<b.y+c.y/2}function insideViewport(a){var b=2*(a.radius||a.info.radius);return isInside(a.pos,viewport.pos,v(width+b,height+b))}
function polygon(a,b,c,d){d=TWO_PI/d;beginShape();for(var e=0;e<TWO_PI;e+=d){var f=a+cos(e)*c,k=b+sin(e)*c;vertex(f,k)}endShape(CLOSE)}function prettyTime(a){a=a||0;var b=a%60|0,c=a/60%60|0;return(a=a/3600|0)?a+":"+("0"+c).substr(-2)+":"+("0"+b).substr(-2):c+":"+("0"+b).substr(-2)}function v(a,b){return createVector(a,b)}function randHex(){return"#000000".replace(/0/g,function(){return(~~(16*Math.random())).toString(16)})}
function hexToRgb(a){return(a=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(a))?{r:parseInt(a[1],16),g:parseInt(a[2],16),b:parseInt(a[3],16)}:null}function hexToRgb2(a){a=a.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(a,c,d,e){return c+c+d+d+e+e});return(a=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(a))?{r:parseInt(a[1],16),g:parseInt(a[2],16),b:parseInt(a[3],16)}:null}function rgbToHex(a,b,c){return"#"+(16777216+(a<<16)+(b<<8)+c).toString(16).slice(1)}
function createNewAudio(a){null==myAudio?(myAudio=createAudio(a),myAudio.elt.controls=!0,myAudio.elt.volume=.5,myAudio.autoplay(!0),myAudio.onended(function(a){changeSong(1)}),myAudio.elt.onloadeddata=function(){myAudio.elt.currentTime=random(myAudio.elt.duration)},myAudio.connect(p5.soundOut)):myAudio.src=a}
function changeSong(a){songNow+=a;songNow>=musics.SongList.length?songNow=0:0>songNow&&(songNow=musics.SongList.length-1);notifi.push(new Notification("Song: "+musics.SongList[songNow].name,20,null,5E3));createNewAudio(musics.SongList[songNow].link)}
function addSound(a,b,c){if(dataSound[a]){var d=dataSound[a];d.setVolume(c||1);b&&(d._onended=function(){this.play()});d.play()}else b?loadSound(a,function(b){dataSound[a]=b;dataSound[a]._onended=function(){this.play()};dataSound[a].play()}):loadSound(a,function(b){dataSound[a]=b;dataSound[a].play()})}function addAlertBox(a,b,c){var d=document.getElementById("alert");d.childNodes[0].nodeValue=a;d.style.backgroundColor=b;d.style.opacity=.7;d.style.zIndex=2;c&&(d.style.color=c)}
function addMessage(a,b,c,d,e){var f=document.createElement("p");d&&(f.style.backgroundColor="rgba("+d.levels[0]+","+d.levels[1]+","+d.levels[2]+",0.3)");c&&(d=document.createElement("span"),d.textContent=c?prettyTime(mil/1E3)+" ":"",f.appendChild(d));b&&(c=document.createElement("span"),c.style.fontWeight="bold",c.textContent=b?b+": ":"",f.appendChild(c));a&&(a=document.createTextNode(a),f.appendChild(a));e&&(f.addEventListener("mouseover",function(){f.style.cursor="pointer";f.style.borderWidth=
"1px 0 1px 0";f.style.borderColor="white";f.style.borderStyle="dashed"}),f.addEventListener("mouseout",function(){f.style.border="none"}),f.addEventListener("click",e));document.getElementById("conversation").appendChild(f);f.scrollIntoView()}
function help(){addMessage(" - - - - - Gun Game 2 - - - - - ","",!1,color(255),function(){window.open("https://hoangtran0410.github.io/GunGame2/index.html")});addMessage("Eat And Fight to Survive","",!1,color(150));addMessage("W A S D / ArrowKey: Move.");addMessage("LEFT-Mouse : Shoot.");addMessage("SCROLL-Mouse, 1->9 : Change weapon.");addMessage("R : Reload.");addMessage("F : Pickup weapon.");addMessage("E : Shield (can't shoot).");addMessage("Q (Hold): look around (minimap).");addMessage("M: Open/close minimap.");
addMessage("N: Change music.");addMessage("ENTER : Chat.");addMessage("C : Show/Hide Chat box.");addMessage("V : FreeCam Mode (on/off).");addMessage("Type '/help' for more option","",!1,color(200));addMessage("--------------------------------")}
function showChat(a){a?(document.getElementById("showHideChat").value="Hide",document.getElementById("conversation").style.width="100%",document.getElementById("chatBox").style.left="0px"):(document.getElementById("showHideChat").value="Show",document.getElementById("conversation").style.width="25%",document.getElementById("chatBox").style.left="-240px")}function isTyping(){return document.getElementById("inputMes")===document.activeElement}
function clearChat(){for(var a=document.getElementById("conversation");a.firstChild;)a.removeChild(a.firstChild)}function getPlayers(a,b,c,d){c=c||[];a=new Circle(a.x,a.y,b);d=d?quadPlayers.query(a,[],!0):quadPlayers.query(a);if(d.length&&c.length)for(c=$jscomp.makeIterator(c),a=c.next();!a.done;a=c.next())a=d.indexOf(a.value),-1!=a&&d.splice(a,1);return d}
function getItems(a,b,c,d){c=c||[];a=new Circle(a.x,a.y,b);d=d?quadItems.query(a,[],!0):quadItems.query(a);if(d.length&&c.length)for(c=$jscomp.makeIterator(c),a=c.next();!a.done;a=c.next())a=d.indexOf(a.value),-1!=a&&d.splice(a,1);return d}function getBullets(a,b,c,d){c=c||[];a=new Circle(a.x,a.y,b);d=d?quadBulls.query(a,[],!0):quadBulls.query(a);if(d.length&&c.length)for(c=$jscomp.makeIterator(c),a=c.next();!a.done;a=c.next())a=d.indexOf(a.value),-1!=a&&d.splice(a,1);return d}
function clone(a){if(null==a||"object"!=typeof a)return a;var b=a.constructor(),c;for(c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function clone2(a){return JSON.parse(JSON.stringify(a))}function getObjectIndex(a,b){var c=Object.keys(a).indexOf(b);-1==c&&(c=null);return c}function getValueAtIndex(a,b){return Object.keys(a)[b]}function getObjectLength(a){return Object.keys(a).length}
window.onload=function(){document.addEventListener("contextmenu",function(a){return a.preventDefault()});document.getElementById("pickColor").value=randHex();var a=document.getElementById("pickColor"),b=document.getElementById("color-picker-wrapper");a.onchange=function(){b.style.backgroundColor=a.value};b.style.backgroundColor=a.value;document.getElementById("newGame").addEventListener("click",function(a){menuWhenDie("close");reset();runGame=!0});document.getElementById("solo").addEventListener("click",
function(a){team=1;clearChat();closeNav();start()});document.getElementById("duo").addEventListener("click",function(a){team=2;clearChat();closeNav();start()});document.getElementById("squad").addEventListener("click",function(a){team=4;clearChat();closeNav();start()});document.getElementById("backToStartMenu").addEventListener("click",function(a){runGame=!1;showChat(!1);menuWhenDie("close");openNav()});document.getElementById("closebtn").addEventListener("mouseover",function(a){a.target.parentElement.style.opacity=
0;a.target.parentElement.style.zIndex=0});document.getElementById("showHideChat").addEventListener("mouseover",function(a){"Hide"==a.target.value?showChat(!1):showChat(!0)});document.getElementById("cachchoi").addEventListener("click",function(a){var b=document.getElementsByClassName("guide")[0];""==b.style.display?(b.style.display="block",document.getElementById("cachchoi").scrollIntoView({behavior:"smooth",block:"start"})):(document.getElementById("ip-name").scrollIntoView({behavior:"smooth",block:"end"}),
setTimeout(function(){b.style.display=""},200))});var c=localStorage.getItem("pname");document.getElementById("ip-name").value=c;openNav()};function autoAddPortals(a,b,c){setInterval(function(){if(runGame&&focused)for(var b=0;b<a;b++){var e=new Portal("out",random(gmap.size.x),random(gmap.size.y),null,null,c),f=new Portal("in",random(gmap.size.x),random(gmap.size.y),e,null,c);pArr.push({inGate:f,outGate:e})}},1E3*b)}
function autoAddRedzones(a){setInterval(function(){runGame&&focused&&redArr.push(new RedZone(random(gmap.size.x),random(gmap.size.y),random(150,gmap.size.x/8),random(15E3,6E4)))},1E3*a)}
function autoAddItems(a){setInterval(function(){if(runGame&&focused){if(iArr.length>world.maxItem)for(var a=0;a<iArr.length-world.maxItem;a++)iArr.shift();else if(iArr.length<world.maxItem/2)for(a=iArr.length;a<world.maxItem/2;a++)iArr.push(new Item(random(gmap.size.x),random(gmap.size.y)));for(a=0;5>a;a++)iArr.push(new Item(random(gmap.size.x),random(gmap.size.y)));a=getValueAtIndex(weapons,floor(random(getObjectLength(weapons))));iArr.push(new Item(random(gmap.size.x),random(gmap.size.y),null,null,
a))}},1E3*a)}function autoAddPlayers(a){setInterval(function(){if(runGame&&eArr.length<maxE){var a=new AICharacter(null,random(gmap.size.x),random(gmap.size.y));eArr.push(a)}},1E3*a)}function getMaxSizeNow(a){setInterval(function(){if(runGame){for(var a=p?p.radius:eArr.length?eArr[0].radius:0,c=$jscomp.makeIterator(eArr),d=c.next();!d.done;d=c.next())d=d.value,d.radius>a&&(a=d.radius);maxSizeNow=a}},1E3*a)}
function openFullscreen(){var a=document.documentElement;a.requestFullscreen?a.requestFullscreen():a.mozRequestFullScreen?a.mozRequestFullScreen():a.webkitRequestFullscreen?a.webkitRequestFullscreen():a.msRequestFullscreen&&a.msRequestFullscreen()}
function closeFullscreen(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen()}function openNav(){document.getElementsByClassName("overlay")[0].style.height="100%"}function closeNav(){document.getElementsByClassName("overlay")[0].style.height="0%"}
function menuWhenDie(a){document.getElementById("menuWhenDie").style.display="open"==a?"block":"none";"close"==a&&(document.getElementById("alert").style.opacity=0,document.getElementById("alert").style.zIndex=0)}
function hiding_info(){var a=.5*gmap.size.x,b=-1E3;insideViewport({pos:{x:a,y:b},radius:500})&&(noStroke(),fill(200),text("Author: Hoang Tran.",a,b+=30),text("Start Day: July 2018.",a,b+=30),text("From: Viet Nam.",a,b+=30),text("",a,b+=30),text("Github: HoangTran0410.",a,b+=30),text("Facebook: Hoang Tran.",a,b+=30),text("Type '/contact' to chat box for more info.",a,b+=30),text("",a,b+=30),text("Thank For Playing.",a,b+30))}
var myAudio,songNow,ampData,ampLevel,dataSound={},viewport,gmap,p,eArr=[],bArr=[],iArr=[],rArr=[],tArr=[],pArr=[],redArr=[],epArr=[],sArr=[],wArr=[],notifi=[],pname,team=1,maxE=15,world,quadPlayers,quadItems,quadBulls,boundMap,fr,mil=0,_gameTime=0,gameTime="",maxSizeNow=100,weaponInfo,runGame=!1;function preload(){dataSound["audio/ambient_stream_01.mp3"]=loadSound("audio/ambient_stream_01.mp3")}
function setup(){createCanvas(windowWidth,windowHeight).position(0,0);noSmooth();rectMode(CENTER);textAlign(LEFT);textFont("Consolas");cursor(CROSS);ampData=new p5.Amplitude;songNow=floor(random(musics.SongList.length));setInterval(function(){runGame&&(_gameTime++,gameTime=prettyTime(_gameTime))},1E3);setInterval(function(){runGame&&gmap&&gmap.createMinimap()},1E4);autoAddItems(5);autoAddRedzones(30);getMaxSizeNow(2);autoAddPortals(3,15,14)}
function start(){gmap=new GameMap(1E4,1E4,300);var a=document.getElementById("worlds-select").value;world=worlds[a||getValueAtIndex(worlds,floor(random(getObjectLength(worlds))))];_gameTime=0;pname=document.getElementById("ip-name").value||RandomName[floor(random(RandomName.length))];reset();weaponInfo=new InfoWeapon;boundMap=new Rectangle(gmap.size.x/2,gmap.size.y/2,gmap.size.x,gmap.size.y);quadItems=new QuadTree(boundMap,5);quadBulls=new QuadTree(boundMap,5);quadPlayers=new QuadTree(boundMap,1);
help(10);runGame=!0;document.getElementById("chatBox").style.display="block";myAudio||changeSong(1);addSound("audio/ambient_stream_01.mp3",!0);addAlertBox("Please read the Rules in chat box.","#f55","#fff")}
function draw(){if(runGame){background(world.bg);if(world.bg[3])for(var a=0;2>a;a++)stroke(random(200,255),100),strokeWeight(random(7,20)),point(random(width),random(height));fr=frameRate();mil=millis();ampLevel=ampData.getLevel();viewport.run();push();translate(-viewport.pos.x+width/2,-viewport.pos.y+height/2);gmap.run();quadItems.clear();var b=$jscomp.makeIterator(iArr);for(a=b.next();!a.done;a=b.next())a=a.value,quadItems.insert(a);quadBulls.clear();b=$jscomp.makeIterator(bArr);for(a=b.next();!a.done;a=
b.next())quadBulls.insert(a.value);quadPlayers.clear();p&&quadPlayers.insert(p);a=$jscomp.makeIterator(eArr);for(b=a.next();!b.done;b=a.next())b=b.value,quadPlayers.insert(b);b=$jscomp.makeIterator(wArr);for(a=b.next();!a.done;a=b.next())a.value.run();for(a=bArr.length-1;0<=a;a--)bArr[a].run();for(a=rArr.length-1;0<=a;a--)rArr[a].run();for(a=iArr.length-1;0<=a;a--)iArr[a].run();p&&(p.move(),p.run());a=$jscomp.makeIterator(eArr);for(b=a.next();!b.done;b=a.next())(b=b.value)?(b.fire(),b.move(),b.run()):
console.log(b);p&&(p.hide=!1);a=$jscomp.makeIterator(eArr);for(b=a.next();!b.done;b=a.next())b=b.value,b.hide=!1;p&&mouseIsPressed&&"left"==mouseButton&&p.fireTo(fakeToReal(mouseX,mouseY));keyIsDown(32)&&(viewport.pos=viewport.target.pos.copy());for(a=pArr.length-1;0<=a;a--)!pArr[a].inGate.run()&&pArr[a].outGate&&pArr[a].outGate.run();for(a=tArr.length-1;0<=a;a--)tArr[a].run();for(a=sArr.length-1;0<=a;a--)sArr[a].show();for(a=redArr.length-1;0<=a;a--)redArr[a].show();for(a=epArr.length-1;0<=a;a--)epArr[a].show(),
epArr[a].checkExplore(epArr);pop();b=$jscomp.makeIterator(notifi);for(a=b.next();!a.done;a=b.next())a.value.run();gmap.showMinimap();weaponInfo.show();textSize(20);textAlign(LEFT);noStroke();fill(255,150);text("Fps: "+floor(frameRate()),5,20);text("Time: "+gameTime,5,45);text("Players: "+((p?1:0)+eArr.length),5,70);text("Killed: "+viewport.target.killed,5,95);textAlign(CENTER);text(floor(viewport.pos.x)+" "+floor(viewport.pos.y),width/2,height-25)}}
function keyPressed(){27==keyCode&&("block"==document.getElementById("menuWhenDie").style.display?(runGame=!0,menuWhenDie("close")):(p&&(runGame=!1),menuWhenDie("open")));if(runGame&&!isTyping())if(86==keyCode)viewport.follow=!viewport.follow;else if(77==keyCode)gmap.hiddenMinimap=!gmap.hiddenMinimap;else if(69==keyCode)p&&(p.shield=!p.shield);else if(70==keyCode)p&&p.pickWeapon();else if(66==keyCode)p&&collisionEdge(p,.6);else if(49<=keyCode&&57>=keyCode){if(p&&keyCode-49<p.weaponBox.length){var a=
p.weaponBox.indexOf(p.weapon);p.changeWeapon(keyCode-49-a)}}else 82==keyCode?p&&p.weapon.gun.reload():67==keyCode?"Show"==document.getElementById("showHideChat").value?showChat(!0):showChat(!1):78==keyCode?changeSong(1):72==keyCode?help(5):13==keyCode&&(showChat(!0),document.getElementById("inputMes").focus());else if(13==keyCode){a=document.getElementById("inputMes");switch(a.value){case "":break;case "/help":addMessage("/howtoplay, /showplayers, /clear, /more, /contact","Server");break;case "/howtoplay":help();
break;case "/showplayers":for(var b="",c=$jscomp.makeIterator(eArr),d=c.next();!d.done;d=c.next())b+=d.value.name+", ";addMessage(b,"Server",!1,color(0));break;case "/clear":clearChat();break;case "/more":addMessage("click here \u2665","Visualize music",!1,color(255,0,0),function(){window.open("https://github.com/HoangTran0410/Visualyze-design-your-own-")});addMessage("click here \u2665","Giphy Api",!1,color(255,100,0),function(){window.open("https://hoangtran0410.github.io/giphyApi/")});addMessage("click here \u2665",
"Sort Simulate",!1,color(255,255,0),function(){window.open("https://hoangtran0410.github.io/Sort-Simulate/")});addMessage("click here \u2665","Write Point",!1,color(0,255,0),function(){window.open("https://hoangtran0410.github.io/Write-Points/")});addMessage("click here \u2665","Maze Pacman",!1,color(0,0,255),function(){window.open("https://hoangtran0410.github.io/Maze-generate/")});addMessage("click here \u2665","Simple Paint",!1,color(70,60,90),function(){window.open("https://hoangtran0410.github.io/Paint-P5/")});
addMessage("click here \u2665","Box2D Testing",!1,color(255,0,255),function(){window.open("https://hoangtran0410.github.io/box2D-2/")});addMessage("click here \u2665","Lsystem Simulate",!1,color(255,0,0),function(){window.open("https://hoangtran0410.github.io/L-system-dat.gui/")});addMessage("click here \u2665","Simple Firework",!1,color(255,100,0),function(){window.open("https://hoangtran0410.github.io/Fire-work/")});break;case "/contact":addMessage("click here \u2665","My Github",!1,color(100),
function(){window.open("https://github.com/HoangTran0410")});addMessage("click here \u2665","My Facebook",!1,color(0,0,255),function(){window.open("https://www.facebook.com/people/Hoang-Tran/100004848287494")});break;default:b=hexToRgb(document.getElementById("pickColor").value),addMessage(event.target.value,pname,!0,color(b.r,b.g,b.b))}a.blur();a.value=""}}
function mousePressed(a){!p&&eArr.length&&a.target.matches("canvas")&&(a=eArr[(eArr.indexOf(viewport.target)+1)%eArr.length],viewport.target=a)}function mouseWheel(a){runGame&&p&&(a.target.matches("canvas")||"Show"==document.getElementById("showHideChat").value)&&(p.shield||p.changeWeapon(0<a.delta?1:-1))}function windowResized(){resizeCanvas(windowWidth,windowHeight,!0);runGame&&(gmap.offSetX=width-gmap.minimapSize-10,weaponInfo=new InfoWeapon)};
</script>
<!-- <script src="min/min.js"></script> -->
</head>
<body>
<!-- ============== Alert Box ============= -->
<div id="alert">
<span id="closebtn">⊗</span>
</div>
<!-- ============== Chat Box ============= -->
<div id="chatBox">
<div id="conversation">
</div>
<div id="typing">
<input id="inputMes" type="text" placeholder="press Enter to add message...">
<input id="showHideChat" type="submit" name="Hide" value="Hide">
</div>
</div>
<!-- ============= Reset button ============ -->
<div id="menuWhenDie">
<input id="newGame" type="submit" value="New Game">
<input id="backToStartMenu" type="submit" value="Menu">
</div>
<!-- ============ Curtain Menu =========== -->
<!-- The overlay -->
<div class="overlay">
<div class="menu">
<input type="text" id="ip-name" placeholder="Enter your name...">
<div id="color-picker-wrapper">
<input type="color" value="#ff0000" id="pickColor">
</div>
<!--Server options-->
<select id="worlds-select">
<option value="">Random world</option>
<option value="flat">Flat (fastest)</option>
<option value="normal">Normal</option>
<option value="beach">Beach</option>
<option value="jungle">Jungle</option>
<option value="winter">Winter</option>
<option value="mountain">Mountain</option>
<option value="barrel">Barrel</option>
</select>
<!--Play options-->
<button id="solo" class="btn-play green">Play Solo</button>
<div class="gr-btn">
<button id="duo" class="btn-play item green">Play Duo</button>
<button id="squad" class="btn-play item green">Play Squad</button>
<button class="btn-play item blue">Join Team</button>
<button class="btn-play item blue">Create Team</button>
</div>
<button id="cachchoi" class="btn-play gray">How to Play</button>
<div class="guide">
<p><b><i>Move, Collect, Get Kill, Upgrade, Survive</i></b></p>
<p>========================</p>
<p><b>MOVE </b>: ASDW / arrow key</p>
<p><b>Weapons </b>: 1-9 / mouse rotate</p>
<p><b>Shoot </b>: left mouse</p>
<p><b>Shield </b>: E (cannot shoot)</p>
<p><b>Pickup </b>: F</p>
<p><b>Reload </b>: R</p>
<p>========================</p>
<p><b>Hide/Open Chat</b>: C</p>
<p><b>Add message</b>: ENTER</p>
<p><b>Change Music</b>: N</p>
<p><b>Help</b>: H</p>
<p><b>Pause / Continue<b>: ESC</p>
<p>========================</p>
<p><b>Hide/Open minimap</b>: M</p>
<p><b>Change view</b>: V (camara do not track player)</p>
<p><b>Switch player want to track</b> (after you death): Click</p>
<p><b>View minimap</b>: Q (Hold mouse, move to position you want to see on the minimap)</p>
<p></p>
</div>
</div>
</div>
</div>
</body>
</html>