xxxxxxxxxx
angleMode = 'degrees';
void setup() {
size(600,600,1);
noStroke();
rectMode(CENTER);
textAlign(CENTER,CENTER);
textSize(20);
};
var rotate1=function(a){
rotate(a*(PI/180));
};
var atan3=function(a,b){
return atan2(a,b)/PI*180;
};
var cos1=function(a){
return Math.cos(a/180*Math.PI);
};
var sin1=function(a){
return Math.sin(a/180*Math.PI);
};
var tan1=function(a){
return Math.tab(a/180*Math.PI);
};
// choose the color of the player
var sightColor = color(0, 0, 0),
sightColor2 = color(255, 255, 255);
var playerColor = color(255, 255, 255);
var HaveSound=false;
var GSAVE={
gunG:'0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;',
wave:0,
upG:[0,0,0,0,0,0],
s:0,
};
// put save code here /\
{
var shake=0;
var PowerEquip=3;
var gunbou=0;//guns biy
var waveSpeed=20;
var FIX_SHOP_BUG=false; //set this to true ifshop crashes game
var splat_Spawn=12; //set to 0 to turn of splat (BLOOD)marks
var REMOVELAG=true; //set true to decrease lag
var Max_effects=999; //max number of effect
var itemLife=1000000; //how long dropped item last
//*********************************************
// SETTINGS
//*********************************************
var scene=-0; //set to 1 to skip menu
var waveTimer=1; //time between waves
var damageMULT=100.00; //how much more damage you do (1.00=base)
var damageMULTbase=1;
var HpRegen=0.00; // how fast your HP regens
var Zombie_Dect_timer=9; //how often the game test s the zombies
var Zombie_Spawn_thes=1; //# zombies needed for next wave
var MAP_W=800;
var MAP_H=800;
/**pick class here*/
var player_model_E=0; //what class you choose 0-13
var AREA_MAP=2;
var Game_mode=1;
var Zombie_di_mult=1.2;
var DiedHow="none";
var shooting=false; //is player shooting
var IsReloading=false; // are you reloading
var ReloadTimer=0; //reload timer
var pause=false; // ifgame is paused
var angle=0; //players angle angle
var time=0;
var shotFired=0; // how many rounds you have fired
var wave=0; //what wave your on
var zombiespawnT=0; // zombie spawn timer
var Zkills=0; // number of zombies killed
var Pspeed=4; //player speed
var money=0; //money
var Parmor=0;
var ParmorMax=50;
var Gems=0;
var AnC;
var PowerTimer=0; //Timer for powerUp
var PowerDelay=120;//powerUp delay
var PowerCount=3;//powerup count
//past mouse X and Y
var PmouseX=0,
PmouseY=0;
// player sprintmax player sprint
var PS=100,
PSmax=100;
// player health points and max player health points
var Php=100,
PhpMax=100;
//player X and Y cord
var PX=300,
PY=100;
//cam X and Y
var CamX=0,
CamY=0;
var GunSGOT=0;
var GunSGOTE=0;
var Time=0;
var Pnoise=100; //player noise
var stor=[]; //stores effects
var gameTime=0; //
var FPStimer=millis(); //
var FPSCount=0; //
var FPSCountT=0; //
var handColor=color(255,255,255);
var RTx=0;
var RTy=0;
var BAcc=0,// gun acc
BAccM=0,
BAccAdd=0,
BAccR=0;
var BperS=0; // bullets per shot
var BSpeed=0; // bullet speed
var BDelay=0; // shot delay
var Bdam=0; // bullet damage
var ammo=0; // gun ammo
var ammoMax=0; // gun ammo max
//var ammoR=GUN[GUNE].ammoBank; // ammo res
var Reload=0; // how fast is the reload
var gunT=0; // the type
var BhpL=0; // the bullets live
var ClassE=0; {
//*********************************************
// Classes
//*********************************************
var Classes=[{
E1: 5,
E2: 5,
name: "normal",
HC: color(playerColor),
show: function(x,y,a){
fill(playerColor);
ellipse(0,0,20,20);
fill(0,0,0);
rect(-3,-5,2,6);
rect(3,-5,2,6);
}
},{
E1: 13,
E2: 6,
name: "Dooms day preper",
HC: color(playerColor),
show: function(x,y,a){
fill(179,149,0);
rect(0,0+12,20,12,6);
fill(71,58,0);
rect(0-5,0+12,3,12,6);
rect(0+5,0+12,3,12,6);
fill(playerColor);
ellipse(0,0,20,20);
fill(0,0,0);
rect(-3,-5,2,6);
rect(3,-5,2,6);
}
},{
E1: 21,
E2: 6,
name: "Bandit",
HC: color(playerColor),
show: function(x,y,a){
fill(playerColor);
ellipse(0,0,20,20);
fill(230,39,71);
triangle(8,-6,0,-12,-8,-6);
fill(playerColor);
ellipse(0,-6,10,3);
fill(0,0,0);
rect(-3,-5,2,4);
rect(3,-5,2,4);
}
},{
E1: 9,
E2: 6,
name: "marksman",
HC: color(playerColor),
show: function(x,y,a){
fill(playerColor);
ellipse(0,0,20,20);
fill(0,0,0);
rect(-3,-5,2,6);
rect(3,-5,2,6);
fill(107,107,107);
rect(0,2,20,3);
fill(61,61,61);
rect(10,2,5,8,3);
rect(-10,2,5,8,3);
}
},{
E1: 22,
E2: 8,
name: "cop",
HC: color(playerColor),
show: function(x,y,a){
fill(playerColor);
ellipse(0,0,20,20);
fill(0,0,0);
rect(-3,-5,2,6);
rect(3,-5,2,6);
fill(94,115,199);
rect(0,4,12,10,3);
fill(20,39,110);
ellipse(0,8,20,10);
fill(199,167,40);
ellipse(0,8,3,3);
}
},{
E1: 10,
E2: 8,
name: "Park ranger",
HC: color(playerColor),
show: function(x,y,a){
fill(playerColor);
ellipse(0,0,20,20);
fill(0,0,0);
rect(-3,-5,2,6);
rect(3,-5,2,6);
fill(71,163,41);
ellipse(0,6,18,15);
fill(66,66,66);
ellipse(0,8,12,13);
fill(102,204,47);
ellipse(0,8,10,12);
fill(76,153,29);
ellipse(0,8,4,10);
}
},{
E1: 23,
E2: 5,
name: "CDC agent",
HC: color(255,175,15),
show: function(x,y,a){
fill(255,175,15);
ellipse(0,0,20,20);
fill(54,53,54);
arc(0,0,20,20,180*(PI/180),360*(PI/180));
fill(138,135,138);
rect(0,0+5,3,10);
fill(114,224,215);
rect(0,0-6,8,3);
pushMatrix();
resetMatrix();
if(x===0.01){
translate(600,600);
translate(-300-(PmouseX-0-width/2)/ 2,-300 -
(PmouseY-0-height/2)/ 2);
}
else {
translate(x,y);
}
rotate1(a+40);
fill(82,82,82);
rect(0,0-14,7,5);
rect(0,0-12,3,5);
popMatrix();
}
},{
E1: 18,
E2: 15,
name: "SWAT",
HC: color(playerColor),
show: function(x,y,a){
fill(playerColor);
ellipse(0,0,20,20);
fill(0,0,0);
rect(-3,-5,2,6);
rect(3,-5,2,6);
fill(60,64,143);
ellipse(0,7,19,14);
rect(9,3,5,8,4);
rect(-9.5,3,5,8,4);
}
},{
E1: 2,
E2: 19,
name: "army",
HC: color(playerColor),
show: function(x,y,a){
fill(38,135,0);
rect(0,0+12,20,8,6);
fill(82,204,0);
rect(0-5,0+12,3,8,6);
rect(0+5,0+12,3,8,6);
fill(43,102,0);
rect(0,0+16,10,3,6);
fill(playerColor);
ellipse(0,0,20,20);
fill(0,0,0);
rect(-3,-5,2,6);
rect(3,-5,2,6);
fill(30,87,15);
ellipse(0,4,20,15);
}
},{
E1: 11,
E2: 7,
name: "Sniper",
HC: color(playerColor),
show: function(x,y,a){
fill(playerColor);
ellipse(0,0,20,20);
fill(0,0,0);
rect(-3,-5,2,6);
rect(3,-5,2,6);
fill(116,130,116);
rect(0,2,20,3);
rect(-10,2,5,8,4);
rect(10,2,5,8,4);
fill(43,92,13);
rect(0,6,15,13,6);
}
},{
E1: 20,
E2: 16,
name: "Spec Ops",
HC: color(138,138,138),
show: function(x,y,a){
fill(97,96,97);
ellipse(0,0,20,20);
fill(48,48,48);
arc(0,0,20,20,180*(PI/180),360*(PI/180));
fill(56,52,56);
rect(0,0+5,3,10);
fill(26,25,26);
rect(0-5,0-8,5,6);
fill(26,25,26);
rect(0+5,0-8,5,6);
fill(94,255,0);
ellipse(0+5,0-9.5,5,3);
ellipse(0-5,0-9.5,5,3);
ellipse(0,0-5.5,5,3);
}
},{
E1: 3,
E2: 15,
name: "Heavy wep spec",
HC: color(playerColor),
show: function(x,y,a){
fill(97,97,97);
rect(0,12,20,12,6);
fill(36,36,36);
rect(-5,12,3,12,6);
rect(5,12,3,12,6);
fill(36,36,36);
rect(-10,11,4,9,4);
rect(10,11,4,9,4);
rect(0,19,10,4,4);
fill(playerColor);
ellipse(0,0,20,20);
fill(0,0,0);
rect(-3,-5,2,6);
rect(3,-5,2,6);
fill(122,122,122);
rect(0,0,20,3);
fill(59,59,59);
rect(-11,0,5,8);
rect(11,0,5,8);
fill(59,59,59);
rect(10,-4,2,12);
}
},{
E1: 12,
E2: 24,
name: "spec ops sniper",
HC: color(playerColor),
show: function(x,y,a){
fill(115,114,110);
rect(0,0+12,20,8,6);
fill(0,0,0);
rect(0-5,0+12,3,8,6);
rect(0+5,0+12,3,8,6);
fill(playerColor);
ellipse(0,0,20,20);
fill(54,53,54);
arc(0,0,20,20,180*(PI/180),360*(PI/180));
fill(138,135,138);
rect(0,0+5,3,10);
fill(107,107,107);
ellipse(0-3,0-5,4,4);
ellipse(0+3,0-5,4,4);
fill(114,224,215);
ellipse(0-3,0-5,2,5);
ellipse(0+3,0-5,2,5);
pushMatrix();
resetMatrix();
if(x===0.01){
translate(600,600);
translate(-300-(PmouseX-0-width/2)/ 2,-300 -
(PmouseY-0-height/2)/ 2);
}
else {
translate(x,y);
}
rotate1(a+40);
fill(82,82,82);
rect(0,0-14,7,5);
rect(0,0-12,3,5);
popMatrix();
pushMatrix();
resetMatrix();
if(x===0.01){
translate(600,600);
translate(-300-(PmouseX-0-width/2)/ 2,-300 -
(PmouseY-0-height/2)/ 2);
}
else {
translate(x,y);
}
rotate1(a-40);
fill(82,82,82);
rect(0,0-14,7,5);
rect(0,0-12,3,5);
popMatrix();
}
},{
E1: 28,
E2: 29,
name: "unit BR-90 Elite",
HC: color(138,138,138),
show: function(x,y,a){
fill(97,97,97);
rect(0,10,20,12,3);
fill(36,36,36);
rect(-5,10,3,12,2);
rect(5,10,3,12,6);
fill(36,36,36);
rect(0,17,10,4,4);
fill(138,138,138);
ellipse(0,0,20,20);
fill(28,28,28);
arc(0,0,20,20,180*(PI/180),360*(PI/180));
fill(56,54,56);
rect(0,0+5,3,10);
fill(33,255,33);
ellipse(0-4,0-6,5,3);
ellipse(0+4,0-6,5,3);
ellipse(0,-3,5,2);
pushMatrix();
resetMatrix();
if(x===0.01){
translate(600,600);
translate(-300-(PmouseX-0-width/2)/ 2,-300 -
(PmouseY-0-height/2)/ 2);
}
else {
translate(x,y);
}
rotate1(a+40);
fill(82,82,82);
rect(0,0-14,7,5);
rect(0,0-12,3,5);
popMatrix();
pushMatrix();
resetMatrix();
if(x===0.01){
translate(600,600);
translate(-300-(PmouseX-0-width/2)/ 2,-300 -
(PmouseY-0-height/2)/ 2);
}
else {
translate(x,y);
}
rotate1(a-40);
fill(82,82,82);
rect(0,0-14,7,5);
rect(0,0-12,3,5);
popMatrix();
}
},];
var GUNUU=[
Classes[player_model_E].E1,
Classes[player_model_E].E2,
27
]; //what items you use
var GUNE;
var GUN=[{
acc: 1,// the base accuracy of gun 1 good-5 bad
AccA: 0.1,// gun recoil
AccS: 0.05,// how fast you recover for recoil
BPS: 1,//bullets per shot
speed: 40,//speed of the bullet
delay: 5,//delay between shots
damage: 1000,//damage
ammo: 1000,//guns ammo
ammoMax: 1000,// the guns ammo max
ammoBank: 1000,//how much ammo you have for the gun
reload: 1,//how fast it reloads
Type: 4,//does not matter yet
Blife: 0.1,//how meny zombies it go though(0.1 per zomb
name: "DEVGUN",//the name
FireMode:"auto",AT: 1,//what ammo it uses
BType: 1,//ifthe bullets are normal-0 or high velocity-1
Weight: 0,//how much the gun slows you down
noise: 10,
show: function(){
fill(176,91,0);
rect(-6,-20,4,10);
fill(handColor);
ellipse(-3,-18,5,5);
ellipse(-7,-13,5,5);
}
},{
acc: 1,
AccA: 0.3,
AccS: 0.03,
BPS: 4,//bullets per shot
speed: 30,//bullet speed
delay: 5,//shot delay
damage: 3,//damage
ammo: 100,
ammoMax: 100,
ammoBank: 200,//ammo-ammomax-ammo bank
reload: 200,//reload speed
Type: 5,//gun type
Blife: 0.1,//bullets life
name: "Fang",//the name
FireMode:"auto",AT: 0,
BType: 0,
Weight: 3,
noise: 50,
show: function(){
fill(11,92,11);
rect(-10,-15,30,6);
fill(71,71,71);
rect(-6,-20,3,24);
fill(176,91,0);
rect(-6,-20,5,10);
fill(handColor);
ellipse(-3,-22,5,5);
ellipse(-7,-13,5,5);
}
},{
acc: 8,
AccA: 0.25,
AccS: 0.03,
BPS: 1,//bullets per shot
speed: 30,//bullet speed
delay: 7,//shot delay
damage: 25,//damage
ammo: 100,
ammoMax: 100,
ammoBank: 200,//ammo-ammomax-ammo bank
reload: 200,//reload speed
Type: 5,//gun type
Blife: 0.1,//bullets life
name: "P23-lion",//the name
FireMode:"auto",AT: 0,
BType: 0,
Weight: 3,
noise: 50,
show: function(){
fill(0,0,0);
rect(-8,-20,12,6);
fill(46,46,46);
rect(-6,-20,3,24);
fill(99,98,99);
rect(-6,-20,5,10);
fill(handColor);
ellipse(-3,-22,5,5);
ellipse(-7,-13,5,5);
}
},{
acc: 6,
AccA: -0.1,
AccS: 0.05,
BPS: 1,//bullets per shot
speed: 30,//bullet speed
delay: 3,//shot delay
damage: 19,//damage
ammo: 250,
ammoMax: 250,
ammoBank: 500,//ammo-ammomax-ammo bank
reload: 250,//reload speed
Type: 6,//gun type
Blife: 0.1,//bullets life
name: "chain gun",//the name
FireMode:"auto",AT: 0,
BType: 0,
Weight: 3,
noise: 50,
show: function(){
if(!pause){BAcc+=0.01;}
fill(71,71,71);
rect(-6,-28,2,14);
rect(-9,-28,2,14);
fill(18,18,18);
rect(-8,-20,10,8);
rect(-8,-34,7,4);
fill(18,18,18);
rect(-6,-20,5,10);
fill(handColor);
ellipse(-3,-22,5,5);
ellipse(-7,-13,5,5);
}
},{
acc: 6,
AccA: -0.1,
AccS: 0.05,
BPS: 1,//bullets per shot
speed: 30,//bullet speed
delay: 2,//shot delay
damage: 18,//damage
ammo: 500,
ammoMax: 500,
ammoBank: 500,//ammo-ammomax-ammo bank
reload: 250,//reload speed
Type: 6,//gun type
Blife: 0.1,//bullets life
name: "The hydra",//the name
FireMode:"auto",AT: 0,
BType: 0,
Weight: 3.5,
noise: 40,
show: function(){
if(!pause){BAcc+=0.01;}
fill(97,97,97);
rect(-6,-28,2,12);
rect(-9,-28,2,14);
fill(61,61,61);
rect(-8,-20,10,8);
rect(-8,-34,7,4);
fill(18,18,18);
rect(-6,-20,5,18);
fill(handColor);
ellipse(-3,-22,5,5);
ellipse(-7,-13,5,5);
}
},{
acc: 3,
AccA: 0.8,
AccS: 0.03,
BPS: 1,//bullets per shot
speed: 30,//bullet speed
delay: 20,//shot delay
damage: 20,//damage
ammo: 7,
ammoMax: 7,
ammoBank: 60,//ammo-ammomax-ammo bank
reload: 20,//reload speed
Type: 1,//gun type
Blife: 0.1,//bullets life
name: "colt",//the name
FireMode:"simi",AT: 1,
BType: 1,
Weight: 0.7,
noise: 60,
show: function(){
fill(87,86,87);
rect(0,-20,3,10);
fill(handColor);
ellipse(0,-15,5,5);
ellipse(3,-15,5,5);
}
},{
acc: 3,
AccA: 0.5,
AccS: 0.03,
BPS: 1,//bullets per shot
speed: 30,//bullet speed
delay: 20,//shot delay
damage: 25,//damage
ammo: 10,
ammoMax: 10,
ammoBank: 60,//ammo-ammomax-ammo bank
reload: 20,//reload speed
Type: 1,//gun type
Blife: 0.1,//bullets life
name: "defender",//the name
FireMode:"auto",AT: 1,
BType: 1,
Weight: 0.6,
noise: 60,
show: function(){
fill(0,0,0);
rect(0,-20,3,10);
fill(handColor);
ellipse(0,-15,5,5);
ellipse(3,-15,5,5);
}
},{
acc: 3,
AccA: 2.9,
AccS: 0.03,
BPS: 1,//bullets per shot
speed: 30,//bullet speed
delay: 50,//shot delay
damage: 100,//damage
ammo: 3,
ammoMax: 3,
ammoBank: 60,//ammo-ammomax-ammo bank
reload: 160,//reload speed
Type: 1,//gun type
Blife: 0.2,//bullets life
name: "Hand cannon",//the name
FireMode:"auto",AT: 1,
BType: 1,
Weight: 1.8,
noise: 200,
show: function(){
fill(77,77,77);
rect(0,-23,4,15);
fill(handColor);
ellipse(0,-15,5,5);
ellipse(3,-15,5,5);
}
},{
acc: 4,
AccA: 0.6,
AccS: 0.03,
BPS: 1,//bullets per shot
speed: 30,//bullet speed
delay: 15,//shot delay
damage: 15,//damage
ammo: 20,
ammoMax: 20,
ammoBank: 200,//ammo-ammomax-ammo bank
reload: 20,//reload speed
Type: 1,//gun type
Blife: 0.1,//bullets life
name: "The Basilisk",//the name
FireMode:"auto",AT: 1,
BType: 1,
Weight: 0,
noise: 60,
show: function(){
fill(0,0,0);
rect(0,-20,3,10);
fill(handColor);
ellipse(0,-15,5,5);
ellipse(3,-15,5,5);
}
},{
acc: 1,
AccA: 2,
AccS: 0.03,
BPS: 1,//bullets per shot
speed: 35,//bullet speed
delay: 60,//shot delay
damage: 150,//damage
ammo: 3,
ammoMax: 3,
ammoBank: 50,//ammo-ammomax-ammo bank
reload: 100,//reload speed
Type: 3,//gun type
Blife: 1.1,//bullets life
name: "hunting rifle",//the name
FireMode:"simi",AT: 2,
BType: 1,
Weight: 3,
noise: 100,
show: function(){
fill(77,76,77);
rect(-6,-20,3,34);
fill(122,65,15);
rect(-6,-20,5,10);
fill(handColor);
ellipse(-3,-18,5,5);
ellipse(-7,-13,5,5);
}
},{
acc: 1,
AccA: 3,
AccS: 0.03,
BPS: 1,//bullets per shot
speed: 35,//bullet speed
delay: 50,//shot delay
damage: 150,//damage
ammo: 5,
ammoMax: 5,
ammoBank: 50,//ammo-ammomax-ammo bank
reload: 150,//reload speed
Type: 3,//gun type
Blife: 1.1,//bullets life
name: "Falcon",//the name
FireMode:"simi",AT: 2,
BType: 1,
Weight: 3,
noise: 100,
show: function(){
fill(64,63,64);
rect(-6,-20,3,34);
fill(87,86,87);
rect(-6,-20,5,10);
fill(handColor);
ellipse(-3,-18,5,5);
ellipse(-7,-13,5,5);
}
},{
acc: 1,
AccA: 3,
AccS: 0.03,
BPS: 1,//bullets per shot
speed: 35,//bullet speed
delay: 50,//shot delay
damage: 165,//damage
ammo: 7,
ammoMax: 7,
ammoBank: 50,//ammo-ammomax-ammo bank
reload: 100,//reload speed
Type: 3,//gun type
Blife: 1.1,//bullets life
name: "ranger",//the name
FireMode:"simi",AT: 2,
BType: 1,
Weight: 3,
noise: 100,
show: function(){
fill(0,0,0);
rect(-6,-20,3,34);
fill(128,128,128);
rect(-6,-20,5,10);
rect(-6,-38,5,3);
fill(handColor);
ellipse(-3,-18,5,5);
ellipse(-7,-13,5,5);
}
},{
acc: 0,
AccA: 0,
AccS: 0.03,
BPS: 10,//bullets per shot
speed: 30,//bullet speed
delay: 10,//shot delay
damage: 9000,//damage
ammo: 6,
ammoMax: 6,
ammoBank: 60,//ammo-ammomax-ammo bank
reload: 30,//reload speed
Type: 3,//gun type
Blife: 1.1,//bullets life
name: "Mk1O3",//the name
FireMode:"auto",AT: 2,
BType: 1,
Weight: 3,
noise: 30,
show: function(){
fill(255,0,0);
rect(-6,-1000,0.5,2000);
fill(38,38,38);
rect(-6,-34,3,68);
fill(168,108,5);
rect(-6,-20,5,10);
fill(handColor);
ellipse(-3,-18,5,5);
ellipse(-7,-13,5,5);
}
},{
acc: 8,
AccA: 0.9,
AccS: 0.03,
BPS: 50,//bullets per shot
speed: 30,//bullet speed
delay: 5,//shot delay
damage: 5,//damage
ammo: 50,
ammoMax: 50,
ammoBank: 20,//ammo-ammomax-ammo bank
reload: 100,//reload speed
Type: 4,//gun typ
Blife: 0.1,//bullets life
name: "Pump shotgun",//the name
FireMode:"auto",AT: 3,
BType: 0,
Weight: 2,
noise: 100,
show: function(){
fill(71,71,71);
rect(-6,-20,3,24);
//rect(-2,-20,3,24);
fill(176,91,0);
rect(-4,-18,6,10);
fill(handColor);
ellipse(-0,-22,5,5);
ellipse(-7,-13,5,5);
}
},{
acc: 15,
AccA: 0.9,
AccS: 0.03,
BPS: 13,//bullets per shot
speed: 30,//bullet speed
delay: 50,//shot delay
damage: 20,//damage
ammo: 2,
ammoMax: 2,
ammoBank: 200,//ammo-ammomax-ammo bank
reload: 20,//reload speed
Type: 4,//gun type
Blife: 0.1,//bullets life
name: "DoB shotgun",//the name
FireMode:"simi",AT: 3,
BType: 0,
Weight: 2,
noise: 100,
show: function(){
fill(71,71,71);
rect(-6,-40,3,34);
rect(-2,-40,3,34);
fill(176,91,0);
rect(-4,-18,6,10);
fill(handColor);
ellipse(-0,-22,5,5);
ellipse(-7,-13,5,5);
}
},{
acc: 8,
AccA: 0.9,
AccS: 0.03,
BPS: 30,//bullets per shot
speed: 30,//bullet speed
delay: 5,//shot delay
damage: 5,//damage
ammo: 100,
ammoMax: 100,
ammoBank: 20,//ammo-ammomax-ammo bank
reload: 80,//reload speed
Type: 4,//gun type
Blife: 0.1,//bullets life
name: "R90-rhino",//the name
FireMode:"auto",AT: 3,
BType: 0,
Weight: 2,
noise: 100,
show: function(){
fill(71,71,71);
rect(-6,-20,3,24);
//rect(-2,-20,3,24);
fill(82,82,82);
rect(-4,-18,6,10);
fill(handColor);
ellipse(-0,-22,5,5);
ellipse(-7,-13,5,5);
}
},{
acc: 8,
AccA: 0.9,
AccS: 0.03,
BPS: 5,//bullets per shot
speed: 30,//bullet speed
delay: 50,//shot delay
damage: 20,//damage
ammo: 8,
ammoMax: 8,
ammoBank: 20,//ammo-ammomax-ammo bank
reload: 120,//reload speed
Type: 4,//gun type
Blife: 0.1,//bullets life
name: "The Suger",//the name
FireMode:"simi",AT: 3,
BType: 0,
Weight: 2,
noise: 100,
show: function(){
fill(71,71,71);
rect(-6,-20,3,24);
fill(0,0,0);
rect(-4,-18,6,10);
fill(handColor);
ellipse(-0,-22,5,5);
ellipse(-7,-13,5,5);
}
},{
acc: 3,
AccA: 0.5,
AccS: 0.03,
BPS: 1,//bullets per shot
speed: 30,//bullet speed
delay: 23,//shot delay
damage: 10,//damage
ammo: 45,
ammoMax: 45,
ammoBank: 120,//ammo-ammomax-ammo bank
reload: 20,//reload speed
Type: 4,//gun type
Blife: 0.2,//bullets life
name: "Rifle",//the name
FireMode:"auto",AT: 4,
BType: 0,
Weight: 2,
noise: 50,
show: function(){
fill(255,0,0);
rect(-6,-1000,0.5,2000);
fill(77,77,77);
rect(-6,-20,4,30);
fill(handColor);
ellipse(-3,-18,5,5);
ellipse(-7,-13,5,5);
}
},{
acc: 3,
AccA: 0.3,
AccS: 0.03,
BPS: 1,//bullets per shot
speed: 30,//bullet speed
delay: 12,//shot delay
damage: 35,//damage
ammo: 35,
ammoMax: 35,
ammoBank: 120,//ammo-ammomax-ammo bank
reload: 20,//reload speed
Type: 4,//gun type
Blife: 0.1,//bullets life
name: "Tactical Rifle",//the name
FireMode:"auto",AT: 4,
BType: 0,
Weight: 2,
noise: 50,
show: function(){
fill(255,0,0);
rect(-6,-1000,0.5,2000);
fill(41,41,41);
rect(-6,-20,2,24);
fill(36,36,36);
rect(-6,-20,4,10);
fill(handColor);
ellipse(-3,-18,5,5);
ellipse(-7,-13,5,5);
}
},{
acc: 1,
AccA: 0.3,
AccS: 0.03,
BPS: 1,//bullets per shot
speed: 30,//bullet speed
delay: 12,//shot delay
damage: 35,//damage
ammo: 35,
ammoMax: 35,
ammoBank: 120,//ammo-ammomax-ammo bank
reload: 20,//reload speed
Type: 4,//gun type
Blife: 0.1,//bullets life
name: "tactical rifle (with suppreser)",//the name
FireMode:"auto",AT: 4,
BType: 0,
Weight: 2,
noise: 8,
show: function(){
fill(41,41,41);
rect(-6,-40,4,15);
fill(255,0,0);
rect(-6,-1000,0.5,2000);
fill(41,41,41);
rect(-6,-20,2,24);
fill(36,36,36);
rect(-6,-20,4,10);
fill(handColor);
ellipse(-3,-18,5,5);
ellipse(-7,-13,5,5);
}
},{
acc: 3,
AccA: 0.3,
AccS: 0.03,
BPS: 1,//bullets per shot
speed: 30,//bullet speed
delay: 0.01,//shot delay
damage: 100,//damage
ammo: 85,
ammoMax: 85,
ammoBank: 10020,//ammo-ammomax-ammo bank
reload: 12,//reload speed
Type: 3,//gun type
Blife: 0.2,//bullets life
name: "Tactical rifle (supreme)",//the name
FireMode:"auto",AT: 4,
BType: 0,
Weight: 1,
noise: 10,
show: function(){
fill(0,0,0);
rect(-6,-20,6,10);
fill(0,255,255);
rect(-6,-20,2,24);
fill(0,255,255,100);
rect(-6,-20,4,26,2);
fill(0,238,255,50);
rect(-6,-20,4,33,5);
fill(133,116,116);
rect(-6,-25,5,3,5);
fill(handColor);
ellipse(-3,-18,5,5);
ellipse(-7,-13,5,5);
}
},{
acc: 4,
AccM: 4,
AccA: 0.4,
AccS: 0.06,
BPS: 1,//bullets per shot
speed: 30,//bullet speed
delay: 5,//shot delay
damage: 7,//damage
ammo: 50,
ammoMax: 50,
ammoBank: 120,//ammo-ammomax-ammo bank
reload: 40,//reload speed
Type: 4,//gun type
Blife: 0.1,//bullets life
name: "Piranha",//the name
FireMode:"auto",AT: 5,
BType: 0,
Weight: 1.5,
noise: 30,
show: function(){
fill(71,71,71);
rect(-6,-15,2,24);
fill(122,122,122);
rect(-6,-20,4,8);
fill(handColor);
ellipse(-3,-18,5,5);
ellipse(-7,-13,5,5);
}
},{
acc: 4,
AccM: 4,
AccA: 0.3,
AccS: 0.06,
BPS: 1,//bullets per shot
speed: 30,//bullet speed
delay: 4,//shot delay
damage: 9,//damage
ammo: 60,
ammoMax: 30,
ammoBank: 120,//ammo-ammomax-ammo bank
reload: 40,//reload speed
Type: 4,//gun type
Blife: 0.1,//bullets life
name: "Barracuda",//the name
FireMode:"auto",AT: 5,
BType: 0,
Weight: 1.5,
noise: 30,
show: function(){
fill(31,31,31);
rect(-6,-15,2,24);
fill(0,0,0);
rect(-6,-20,4,8);
fill(handColor);
ellipse(-3,-18,5,5);
ellipse(-7,-13,5,5);
}
},{
acc: 4,
AccM: 4,
AccA: 0.5,
AccS: 0.06,
BPS: 1,//bullets per shot
speed: 30,//bullet speed
delay: 6,//shot delay
damage: 17,//damage
ammo: 25,
ammoMax: 25,
ammoBank: 120,//ammo-ammomax-ammo bank
reload: 40,//reload speed
Type: 5,//gun type
Blife: 0.1,//bullets life
name: "viper-30",//the name
FireMode:"auto",AT: 5,
BType: 0,
Weight: 1.5,
noise: 30,
show: function(){
fill(13,13,13);
rect(-6,-15,2,24);
fill(122,122,122);
rect(-6,-20,4,8);
fill(handColor);
ellipse(-3,-18,5,5);
ellipse(-7,-13,5,5);
}
},{
acc: 5,
AccM: 4,
AccA: 0.4,
AccS: 0.06,
BPS: 1,//bullets per shot
speed: 30,//bullet speed
delay: 5,//shot delay
damage: 15,//damage
ammo: 50,
ammoMax: 50,
ammoBank: 120,//ammo-ammomax-ammo bank
reload: 50,//reload speed
Type: 4,//gun type
Blife: 0.1,//bullets life
name: "The Griffin",//the name
FireMode:"auto",AT: 5,
BType: 0,
Weight: 1.5,
noise: 10,
show: function(){
fill(82,82,80);
rect(-6,-30,2,40);
fill(173,159,33);
rect(-6,-20,4,8);
fill(handColor);
ellipse(-3,-18,5,5);
ellipse(-7,-13,5,5);
}
},{
acc: 3,
AccA: 0.6,
AccS: 0.03,
BPS: 1,//bullets per shot
speed: 30,//bullet speed
delay: 30,//shot delay
damage: 30,//damage
ammo: 6,
ammoMax: 6,
ammoBank: 60,//ammo-ammomax-ammo bank
reload: 60,//reload speed
Type: 1,//gun type
Blife: 0.1,//bullets life
name: "Silenced pistol",//the name
BType: 1,
Weight: 2,
noise: 20,
show: function(){
fill(0,0,0);
rect(0,-20,3,10);
fill(94,94,94);
rect(0+0.7,-31,2,10);
fill(handColor);
ellipse(0,-15,5,5);
ellipse(3,-15,5,5);
}
},{
acc: 3,
AccA: 0.3,
AccS: 0.03,
BPS: 1,//bullets per shot
speed: 30,//bullet speed
delay: 40,//shot delay
damage: 35,//damage
ammo: 20,
ammoMax: 20,
ammoBank: 120,//ammo-ammomax-ammo bank
reload: 100,//reload speed
Type: 4,//gun type
Blife: 0.2,//bullets life
name: "Silenced rifle",//the name
BType: 0,
Weight: 3,
noise: 30,
show: function(){
fill(71,71,71);
rect(-6,-20,2,24);
fill(31,30,31);
rect(-6,-35,3,10);
fill(112,112,112);
rect(-6,-20,4,10);
fill(handColor);
ellipse(-3,-18,5,5);
ellipse(-7,-13,5,5);
}
},{
acc: -0.1,
AccM: 4,
AccA: 0.4,
AccS: 0.06,
BPS: 0,//bullets per shot
speed: 30,//bullet speed
delay: 0,//shot delay
damage: 0,//damage
ammo: 0,
ammoMax: 0,
ammoBank: 0,//ammo-ammomax-ammo bank
reload: 0,//reload speed
Type: 4,//gun type
Blife: 0.1,//bullets life
name: "NONE",//the name
BType: 0,
Weight: 0,
show: function(){
fill(handColor);
fill(handColor);
//ellipse(7,-13,5,5);
//ellipse(-7,-13,5,5);
}
},{
acc: 1,
AccA: 0.2,
AccS: 0.03,
BPS: 1,//bullets per shot
speed: 30,//bullet speed
delay: 15,//shot delay
damage: 55,//damage
ammo: 30,
ammoMax: 30,
ammoBank: 120,//ammo-ammomax-ammo bank
reload: 60,//reload speed
Type: 4,//gun type
Blife: 0.1,//bullets life
name: "the prototype",//the name
FireMode:"auto",AT: 2,
BType: 2,
Weight: 1,
noise: 30,
show: function(){
fill(0,0,0);
rect(-6,-20,6,10);
fill(255,0,0);
rect(-6,-20,2,24);
fill(255,0,0,100);
rect(-6,-20,4,26,2);
fill(255,0,0,50);
rect(-6,-20,4,33,5);
fill(133,116,116);
rect(-6,-25,5,3,5);
fill(handColor);
ellipse(-3,-18,5,5);
ellipse(-7,-13,5,5);
}
},{
acc: 1,
AccA: 0.2,
AccS: 0.03,
BPS: 1,//bullets per shot
speed: 3,//bullet speed
delay: 105,//shot delay
damage: 8,//damage
ammo: 3,
ammoMax: 3,
ammoBank: 120,//ammo-ammomax-ammo bank
reload: 60,//reload speed
Type: 4,//gun type
Blife: 1.1,//bullets life
name: "the ZAPPER",//the name
FireMode:"auto",AT: 3,
BType: 3,
Weight: 1,
noise: 300,
show: function(){
fill(0,0,0);
rect(-6,-20,6,10);
fill(0,255,255);
rect(-6,-20,2,24);
fill(0,255,255,100);
rect(-6,-20,4,26,2);
fill(0,238,255,50);
rect(-6,-20,4,33,5);
fill(133,116,116);
rect(-6,-25,5,3,5);
fill(handColor);
ellipse(-3,-18,5,5);
ellipse(-7,-13,5,5);
}
},{
acc: 0,
AccA: 0,
AccS: 0.03,
BPS: 1,//bullets per shot
speed: 45,//bullet speed
delay: 60,//shot delay
damage: 200,//damage
ammo: 2,
ammoMax: 2,
ammoBank: 50,//ammo-ammomax-ammo bank
reload: 100,//reload speed
Type: 3,//gun type
Blife: 1.1,//bullets life
name: "light carbine",//the name
FireMode:"auto",AT: 2,
BType: 4,
Weight: 3,
noise: 100,
show: function(){
fill(0,0,0);
rect(-6,-20,5,10);
fill(201,201,201);
rect(-6,-20,3,34);
fill(handColor);
ellipse(-3,-18,5,5);
ellipse(-7,-13,5,5);
}
},{
acc: 3,
AccA: 2.9,
AccS: 0.03,
BPS: 3,//bullets per shot
speed: 30,//bullet speed
delay: 20,//shot delay
damage: 100,//damage
ammo: 5,
ammoMax: 5,
ammoBank: 60,//ammo-ammomax-ammo bank
reload: 80,//reload speed
Type: 1,//gun type
Blife: 0.3,//bullets life
name: "THE SKLURG",//the name
FireMode:"simi",AT: 1,
BType: 1,
Weight: 1,
noise: 100,
show: function(){
fill(217,13,50);
rect(0,-23,4,15);
fill(handColor);
ellipse(0,-15,5,5);
ellipse(3,-15,5,5);
}
},{
acc: 4,
AccM: 4,
AccA: 0.5,
AccS: 0.06,
BPS: 3,//bullets per shot
speed: 30,//bullet speed
delay: 8,//shot delay
damage: 25,//damage
ammo: 25,
ammoMax: 25,
ammoBank: 120,//ammo-ammomax-ammo bank
reload: 40,//reload speed
Type: 5,//gun type
Blife: 0.1,//bullets life
name: "Ghost rider",//the name
FireMode:"auto",AT: 5,
BType: 3,
Weight: 1,
noise: 30,
show: function(){
fill(13,13,13);
rect(-6,-15,2,24);
fill(5,247,231);
rect(-6,-20,4,8);
fill(handColor);
ellipse(-3,-18,5,5);
ellipse(-7,-13,5,5);
}
},{
acc: 3,
AccA: -0.03,
AccS: 0.05,
BPS: 1,//bullets per shot
speed: 30,//bullet speed
delay: 150,//shot delay
damage: 10,//damage
ammo: 500,
ammoMax: 500,
ammoBank: 500,//ammo-ammomax-ammo bank
reload: 250,//reload speed
Type: 6,//gun type
Blife: 0.1,//bullets life
name: "DOOMBRINGER",//the name
FireMode:"auto",AT: 0,
BType: 2,
Weight: 3,
noise: 50,
show: function(){
if(!pause){BAcc+=0.01;}
if(!pause&&GUNE===33){ammo=constrain(ammo,0,ammoMax);BDelay=constrain(BDelay,0,20);BDelay+=0.03;}
if(!pause&&GUNE===33&&shooting){BDelay-=0.9;}
fill(227,25,55);
rect(-6,-28,2,14);
rect(-9,-28,2,14);
fill(18,18,18);
rect(-8,-20,10,8);
rect(-8,-34,7,4);
fill(18,18,18);
rect(-6,-20,5,10);
fill(handColor);
ellipse(-3,-22,5,5);
ellipse(-7,-13,5,5);
}
},{
acc: 4,
AccM: 4,
AccA: 0.5,
AccS: 0.06,
BPS: 1,//bullets per shot
speed: 30,//bullet speed
delay: 3,//shot delay
damage: 6,//damage
ammo: 100,
ammoMax: 100,
ammoBank: 120,//ammo-ammomax-ammo bank
reload: 30,//reload speed
Type: 4,//gun type
Blife: 0.1,//bullets life
name: "TOM-9",//the name
FireMode:"auto",AT: 5,
BType: 0,
Weight: 1.5,
noise: 30,
show: function(){
fill(89,87,83);
rect(-6,-18,9,3);
fill(77,75,77);
rect(-6,-15,2,24);
fill(212,123,21);
rect(-6,-20,4,8);
fill(handColor);
ellipse(-3,-18,5,5);
ellipse(-7,-13,5,5);
}
},//smg
{
acc: 2,
AccM: 4,
AccA: 0.65,
AccS: 0.06,
BPS: 1,//bullets per shot
speed: 30,//bullet speed
delay: 7,//shot delay
damage: 10,//damage
ammo: 20,
ammoMax: 20,
ammoBank: 120,//ammo-ammomax-ammo bank
reload: 50,//reload speed
Type: 5,//gun type
Blife: 0.3,//bullets life
name: "R16- ocelot",//the name
FireMode:"auto",AT: 5,
BType: 0,
Weight: 1.5,
noise: 30,
show: function(){
fill(110,100,110);
rect(-6,-15,2,24);
fill(175,227,143);
rect(-6,-20,4,8);
fill(handColor);
ellipse(-3,-18,5,5);
ellipse(-7,-13,5,5);
}
},{
acc: 4,
AccM: 4,
AccA: 0.5,
AccS: 0.06,
BPS: 1,//bullets per shot
speed: 30,//bullet speed
delay: 6,//shot delay
damage: 15,//damage
ammo: 25,
ammoMax: 25,
ammoBank: 120,//ammo-ammomax-ammo bank
reload: 40,//reload speed
Type: 5,//gun type
Blife: 0.1,//bullets life
name: "SMGplace2",//the name
FireMode:"auto",AT: 5,
BType: 0,
Weight: 1.5,
noise: 30,
show: function(){
fill(13,13,13);
rect(-6,-15,2,24);
fill(122,122,122);
rect(-6,-20,4,8);
fill(handColor);
ellipse(-3,-18,5,5);
ellipse(-7,-13,5,5);
}
},{
acc: 8,
AccA: -0.25,
AccS: 0.03,
BPS: 5,//bullets per shot
speed: 30,//bullet speed
delay: 0,//shot delay
damage: 25,//damage
ammo: 100,
ammoMax: 100,
ammoBank: 200,//ammo-ammomax-ammo bank
reload: 200,//reload speed
Type: 6,//gun type
Blife: 0.1,//bullets life
name: "6̶̡̠͍͔̩̞̦̐̀̈̾̋̈́͘7̶̡̢̧͚̻͈͇̋̂̇̃̓̕̚",//the name
FireMode:"auto",AT: 0,
BType: 2,
Weight: 3.5,
noise: 50,
show: function(){
if(!pause){
BAcc+=0.01;
Php-=0.01;
DiedHow="c̵͇̥̖͍̜̘̟͋̾̈́͂̌̍͘ǫ̴̡͇̖̬̺̮̓̊̄̅̉̀̍ǹ̶̯̤̞̝̠͍͕̈́̂̐̎̾͝s̵̝͓̩͖̙̀̇̅͑̚͘͜͝ͅu̸̧̱͎̻͕̰̲͌̒̂̄͋̀͝m̴̨͉̰̯̱̱̯̎͆̈́̿̓͛͝e̶̡͈̜̜̯̩̬͂̇͆̇̐̚͝ḑ̷̤̣̞͕͙̱͋͐̓̏̈́́͘";
}
fill(0,0,0);
rect(-8,-20,12,10);
fill(46,46,46);
rect(-6,-20,7,44);
fill(204, 198, 204);
rect(-6,-20,5,10);
fill(handColor);
ellipse(-3,-22,5,5);
ellipse(-7,-13,5,5);
}
},//mec
{
acc: 8,
AccA: 0.25,
AccS: 0.03,
BPS: 1,//bullets per shot
speed: 30,//bullet speed
delay: 7,//shot delay
damage: 25,//damage
ammo: 100,
ammoMax: 100,
ammoBank: 200,//ammo-ammomax-ammo bank
reload: 200,//reload speed
Type: 5,//gun type
Blife: 0.1,//bullets life
name: "mec2",//the name
FireMode:"auto",AT: 0,
BType: 0,
Weight: 3.5,
noise: 50,
show: function(){
fill(0,0,0);
rect(-8,-20,12,6);
fill(46,46,46);
rect(-6,-20,3,24);
fill(99,98,99);
rect(-6,-20,5,10);
fill(handColor);
ellipse(-3,-22,5,5);
ellipse(-7,-13,5,5);
}
},{
acc: 8,
AccA: 0.25,
AccS: 0.03,
BPS: 1,//bullets per shot
speed: 30,//bullet speed
delay: 7,//shot delay
damage: 25,//damage
ammo: 100,
ammoMax: 100,
ammoBank: 200,//ammo-ammomax-ammo bank
reload: 200,//reload speed
Type: 5,//gun type
Blife: 0.1,//bullets life
name: "mec3",//the name
FireMode:"auto",AT: 0,
BType: 0,
Weight: 3.5,
noise: 50,
show: function(){
fill(0,0,0);
rect(-8,-20,12,6);
fill(46,46,46);
rect(-6,-20,3,24);
fill(99,98,99);
rect(-6,-20,5,10);
fill(handColor);
ellipse(-3,-22,5,5);
ellipse(-7,-13,5,5);
}
},{
acc: 3,
AccA: 0.5,
AccS: 0.03,
BPS: 1,//bullets per shot
speed: 30,//bullet speed
delay: 20,//shot delay
damage: 35,//damage
ammo: 7,
ammoMax: 7,
ammoBank: 60,//ammo-ammomax-ammo bank
reload: 20,//reload speed
Type: 1,//gun type
Blife: 0.1,//bullets life
name: "JB007",//the name
FireMode:"auto",AT: 1,
BType: 1,
Weight: 0.6,
noise: 60,
show: function(){
fill(0,0,0);
rect(0,-20,3,10);
fill(105,101,105);
rect(0,-30,3,10);
fill(handColor);
ellipse(0,-15,5,5);
ellipse(3,-15,5,5);
}
},//p
{
acc: 3,
AccA: 0.8,
AccS: 0.03,
BPS: 1,//bullets per shot
speed: 30,//bullet speed
delay: 0,//shot delay
damage: 40,//damage
ammo: 7,
ammoMax: 7,
ammoBank: 60,//ammo-ammomax-ammo bank
reload: 50,//reload speed
Type: 1,//gun type
Blife: 0.1,//bullets life
name: "OWL",//the name
FireMode:"simi",AT: 1,
BType: 1,
Weight: 0.8,
noise: 200,
show: function(){
fill(125,124,125);
rect(0,-20,4,10);
fill(handColor);
ellipse(0,-15,5,5);
ellipse(3,-15,5,5);
}
},{
acc: 3,
AccA: 0.5,
AccS: 0.03,
BPS: 1,//bullets per shot
speed: 30,//bullet speed
delay: 20,//shot delay
damage: 25,//damage
ammo: 10,
ammoMax: 10,
ammoBank: 60,//ammo-ammomax-ammo bank
reload: 20,//reload speed
Type: 1,//gun type
Blife: 0.1,//bullets life
name: "p1",//the name
FireMode:"auto",AT: 1,
BType: 1,
Weight: 0.6,
noise: 60,
show: function(){
fill(0,0,0);
rect(0,-20,3,10);
fill(handColor);
ellipse(0,-15,5,5);
ellipse(3,-15,5,5);
}
},{
acc: 2,
AccA: 1.5,
AccS: 0.03,
BPS: 1,//bullets per shot
speed: 40,//bullet speed
delay: 30,//shot delay
damage: 50,//damage
ammo: 5,
ammoMax: 5,
ammoBank: 50,//ammo-ammomax-ammo bank
reload: 100,//reload speed
Type: 3,//gun type
Blife: 0.3,//bullets life
name: "mosK10",//the name
FireMode:"auto",AT: 2,
BType: 1,
Weight: 3,
noise: 100,
show: function(){
fill(64,63,64);
rect(-6,-20,2,34);
fill(191,85,10);
rect(-6,-20,3,10);
fill(handColor);
ellipse(-3,-18,5,5);
ellipse(-7,-13,5,5);
}
},//snp
{
acc: 2,
AccA: 3,
AccS: 0.08,
BPS: 1,//bullets per shot
speed: 40,//bullet speed
delay: 60,//shot delay
damage: 60,//damage
ammo: 7,
ammoMax: 7,
ammoBank: 50,//ammo-ammomax-ammo bank
reload: 100,//reload speed
Type: 3,//gun type
Blife: 0.3,//bullets life
name: "Lever action",//the name
FireMode:"simi",AT: 2,
BType: 1,
Weight: 3,
noise: 100,
show: function(){
fill(64,63,64);
rect(-6,-20,4,24);
fill(87,86,87);
rect(-6,-20,5,10);
fill(handColor);
ellipse(-3,-18,5,5);
ellipse(-7,-13,5,5);
}
},{
acc: 1,
AccA: 5,
AccS: 0.03,
BPS: 1,//bullets per shot
speed: 40,//bullet speed
delay: 50,//shot delay
damage: 100,//damage
ammo: 5,
ammoMax: 5,
ammoBank: 50,//ammo-ammomax-ammo bank
reload: 100,//reload speed
Type: 3,//gun type
Blife: 1.1,//bullets life
name: "snp3",//the name
FireMode:"auto",AT: 2,
BType: 1,
Weight: 3,
noise: 100,
show: function(){
fill(64,63,64);
rect(-6,-20,3,34);
fill(87,86,87);
rect(-6,-20,5,10);
fill(handColor);
ellipse(-3,-18,5,5);
ellipse(-7,-13,5,5);
}
},{
acc: 5,
AccA: 0.9,
AccS: 0.03,
BPS: 10,//bullets per shot
speed: 30,//bullet speed
delay: 40,//shot delay
damage: 16,//damage
ammo: 1,
ammoMax: 1,
ammoBank: 20,//ammo-ammomax-ammo bank
reload: 40,//reload speed
Type: 4,//gun typ
Blife: 0.1,//bullets life
name: "The beagle",//the name
FireMode:"simi",AT: 3,
BType: 0,
Weight: 2,
noise: 100,
show: function(){
fill(71,71,71);
rect(-6,-20,2,24);
//rect(-2,-20,3,24);
fill(176,91,0);
rect(-7,-18,4,10);
fill(handColor);
ellipse(-3,-22,5,5);
ellipse(-5,-13,5,5);
}
},//sg
{
acc: 12,
AccA: 1.1,
AccS: 0.03,
BPS: 8,//bullets per shot
speed: 30,//bullet speed
delay: 20,//shot delay
damage: 25,//damage
ammo: 2,
ammoMax: 2,
ammoBank: 20,//ammo-ammomax-ammo bank
reload: 80,//reload speed
Type: 4,//gun type
Blife: 0.1,//bullets life
name: "SawOff",//the name
FireMode:"simi",AT: 3,
BType: 0,
Weight: 2,
noise: 100,
show: function(){
fill(71,71,71);
rect(-6,-20,3,16);
rect(-2,-20,3,16);
fill(176,91,0);
rect(-4,-18,6,10);
fill(handColor);
ellipse(-0,-22,5,5);
ellipse(-7,-13,5,5);
}
},{
acc: 8,
AccA: 0.9,
AccS: 0.03,
BPS: 5,//bullets per shot
speed: 30,//bullet speed
delay: 40,//shot delay
damage: 15,//damage
ammo: 5,
ammoMax: 5,
ammoBank: 20,//ammo-ammomax-ammo bank
reload: 100,//reload speed
Type: 4,//gun typ
Blife: 0.1,//bullets life
name: "SG3",//the name
FireMode:"auto",AT: 3,
BType: 0,
Weight: 2,
noise: 100,
show: function(){
fill(71,71,71);
rect(-6,-20,3,24);
//rect(-2,-20,3,24);
fill(176,91,0);
rect(-4,-18,6,10);
fill(handColor);
ellipse(-0,-22,5,5);
ellipse(-7,-13,5,5);
}
},{
acc: 2,
AccA: 0.3,
AccS: 0.03,
BPS: 1,//bullets per shot
speed: 30,//bullet speed
delay: 5,//shot delay
damage: 15,//damage
ammo: 30,
ammoMax: 30,
ammoBank: 120,//ammo-ammomax-ammo bank
reload: 60,//reload speed
Type: 4,//gun type
Blife: 0.2,//bullets life
name: "US-15",//the name
FireMode:"simi",AT: 4,
BType: 0,
Weight: 3,
noise: 80,
show: function(){
fill(71,71,71);
rect(-6,-20,2,24);
fill(79, 63, 63);
rect(-6,-20,4,10);
fill(handColor);
ellipse(-3,-18,5,5);
ellipse(-7,-13,5,5);
}
},//r
{
acc: 2,
AccA: 0.3,
AccS: 0.03,
BPS: 1,//bullets per shot
speed: 30,//bullet speed
delay: 8,//shot delay
damage: 15,//damage
ammo: 40,
ammoMax: 40,
ammoBank: 120,//ammo-ammomax-ammo bank
reload: 60,//reload speed
Type: 4,//gun type
Blife: 0.2,//bullets life
name: "R2",//the name
FireMode:"auto",AT: 4,
BType: 0,
Weight: 3,
noise: 80,
show: function(){
fill(71,71,71);
rect(-6,-20,2,24);
fill(97,96,96);
rect(-6,-20,4,10);
fill(handColor);
ellipse(-3,-18,5,5);
ellipse(-7,-13,5,5);
}
},{
acc: 2,
AccA: 0.3,
AccS: 0.03,
BPS: 1,//bullets per shot
speed: 30,//bullet speed
delay: 8,//shot delay
damage: 15,//damage
ammo: 40,
ammoMax: 40,
ammoBank: 120,//ammo-ammomax-ammo bank
reload: 60,//reload speed
Type: 4,//gun type
Blife: 0.2,//bullets life
name: "R3",//the name
FireMode:"auto",AT: 4,
BType: 0,
Weight: 3,
noise: 80,
show: function(){
fill(71,71,71);
rect(-6,-20,2,24);
fill(97,96,96);
rect(-6,-20,4,10);
fill(handColor);
ellipse(-3,-18,5,5);
ellipse(-7,-13,5,5);
}
},
];
var AmmoBANK=[
10000,//500 mec gun
10000,//480 pistol
10000,//100 sniper
10000,//120 shot gun
10000,//700 rifle
10000,//800 smg
];
var Bhp=[];
var BhpM=0.1;
var Bpow=[];
var BOldX=[];
var BOldY=[];
var BNewX=[];
var BNewY=[];
var BHeading=[]; //bullet heading
var BRot=[]; // bullet rotation
var bulletDisplay=[
function(){
fill(238,255,0);
rect(0,0,5,30,5);
},
function(){
fill(255,255,0);
rect(0,0-35,5,10);
fill(255,255,255,80);
rect(0,0-30,5,30);
},
function(){
fill(255,0,0,150);
rect(0,0,5,30);
fill(255,0,0,100);
rect(0,0,5,35,4);
fill(255,0,0,50);
rect(0,0,10,35,4);
fill(255,0,0,10);
rect(0,0,10,35,4);
},
function(){
fill(0,255,255,150);
ellipse(0,0,10,10);
fill(0,238,255,100);
ellipse(0,0,15,15);
fill(0,255,242,50);
ellipse(0,0,20,20);
fill(0,238,255,10);
ellipse(0,0,25,25);
},
function(){
fill(255,255,255,150);
rect(0,0,5,200);
fill(255,255,255,100);
rect(0,0,8,205,4);
fill(255,255,255,50);
rect(0,0,10,205,4);
fill(255,255,255,10);
rect(0,0,10,205,4);
}
];
var showHint=0;
var hints=["You have a knife press ‘v’ to use it",
"Try to destroy the crates,\n they have useful things inside",
"Don’t forget to reload (press ‘r’)",
"Keep moving\n ifyou stop you might get hit",
"Don't forget to buy upgrades (press ‘q’)",
"Don't forget to buy upgrades (press ‘q’)",
"Having trouble in mission mode? \n try training in endless",
"Being swarmed \n used the boom barrels to destroy them",
"Don't forget to save (press ‘o’)",
"Don't forget to save (press ‘o’)","There is a boss on wave 25",
"Don’t get contaminated","Armor is like health but 2x tougher",
"Remember to pick up money",
"Get past wave 30 \nto unlock something amazing",
"Stay away from the purple zombies",
"Some zombies spit ,don’t get hit",
"Some zombies spit ,don’t get hit"
];
var meleeE = 0;
var meleeWep = [
{
delay:100,
damage:999,
speed:6,
range:30,
display:function(L){
rotate1(angle-L);
fill(179,179,179);
rect(-7,-12+L/10,3,10);
fill(255,255,255);
ellipse(-7,-9+L/10,5,5);
}
},
{
delay:200,
damage:999,
speed:4,
range:35,
display:function(L){
rotate1(angle+40);
fill(179,179,179);
rect(-12,-8+L/10,20,5);
fill(222, 115, 27);
rect(-7,-8+L/10,10,5);
fill(255,255,255);
ellipse(-7,-9+L/10,5,5);
ellipse(-5,-7+L/10,5,5);
}
}
];
}
//**********************************************************
// zombie assests
//**********************************************************
var Zombies=[{
hp: 5*Zombie_di_mult,
speed: 1,
Dect: 2000000,
moneyD: 999,
show: function(){
fill(58,112,49);
ellipse(0,0,20,20);
ellipse(7,-13,5,5);
ellipse(-7,-13,5,5);
fill(255,0,0);
rect(-3,-5,2,6);
rect(3,-5,2,6);
}
},{
hp: 450*Zombie_di_mult,
speed: 0.6,
Dect: 25,
moneyD: 1000,
show: function(){
fill(49,255,13);
ellipse(0,0,25,25);
ellipse(9,-14,6,6);
ellipse(-9,-14,6,6);
fill(255,0,0);
rect(-4,-6,2,7);
rect(4,-6,2,7);
}
},{
hp: 200*Zombie_di_mult,
speed: 0.3,
Dect: 30,
moneyD: 12000,
show: function(){
fill(41,56,36);
ellipse(0,0,30,30);
ellipse(12,-18,6,6);
ellipse(-12,-18,6,6);
fill(255,0,0);
rect(-5,-6,2,7);
rect(5,-6,2,7);
}
},{
hp: 20,
speed: 1.0,
Dect: 15,
moneyD: 0,
show: function(){
fill(101,209,65);
ellipse(0,0,15,15);
ellipse(8,-14,6,6);
ellipse(-8,-14,6,6);
fill(255,0,0);
rect(-3,-3,2,4);
rect(3,-3,2,4);
}
},{
hp: 50*Zombie_di_mult,
speed: 0.8,
Dect: 20,
moneyD: 1,
show: function(){
fill(153,79,22);
ellipse(0,0,20,20);
ellipse(7,-13,5,5);
ellipse(-7,-13,5,5);
fill(255,0,0);
rect(-3,-5,2,6);
rect(3,-5,2,6);
}
},{
hp: 40*Zombie_di_mult,
speed: 0.9,
Dect: 200,
moneyD: 10,
show: function(){
fill(153,23,81);
ellipse(0,0,20,20);
ellipse(7,-13,5,5);
ellipse(-7,-13,5,5);
fill(255,0,0);
rect(-3,-5,2,6);
rect(3,-5,2,6);
}
},{
hp: 1500*Zombie_di_mult,
speed: 0.5,
Dect: 50,
moneyD: 2000000,
show: function(){
fill(38,255,157);
ellipse(0,0,50,50);
ellipse(15,-34,10,10);
ellipse(-15,-34,10,10);
fill(255,0,0);
rect(-6,-10,5,15);
rect(6,-10,5,15);
}
},{
hp: 30*Zombie_di_mult,
speed: 0.8,
Dect: 20,
moneyD: 20,
show: function(){
fill(0,153,48);
ellipse(0,0,20,20);
ellipse(7,-13,5,5);
ellipse(-7,-13,5,5);
fill(255,0,0);
rect(-3,-5,2,6);
rect(3,-5,2,6);
}
},{
hp: 6000*Zombie_di_mult,
speed: 1.2,
Dect: 30,
moneyD: 1000000,
show: function(){
fill(102,232,102);
ellipse(0,0,30,30);
ellipse(12,-18,6,6);
ellipse(-12,-18,6,6);
fill(255,0,0);
rect(-5,-6,2,7);
rect(5,-6,2,7);
}
},{
hp: 95*Zombie_di_mult,
speed: 2,
Dect: 30,
moneyD: 100000,
show: function(){
fill(16,77,4);
ellipse(0,0,20,20);
ellipse(7,-13,5,5);
ellipse(-7,-13,5,5);
fill(255,0,0);
rect(-3,-5,2,6);
rect(3,-5,2,6);
}
},];
var ZOldX=[],
ZOldY=[]; // zombies old X and Y
var ZNewX=[],
ZNewY=[]; // zombies new X and Y
var Zhp=[]; // zombie hp
var ZHeading=[]; // where the zombies heading
var ZHeadingTemp=[]; // where zombies is pushed
var ZRot=[]; // it rot
var ZSpeed=[]; // zombies speed
var ZSpeedMAX=[]; // zombies speed Max
var ZSpeedAtktimer=[]; // zombie attack timer
var ZT=[]; // zombies type
var ZTi=[]; // zombie dect timer
var GUNU=GUNUU; //what items you use
GUNE=GUNU[0];
var itemE=0;
}
//finds key input
var img=0;
var keys=[];
var forcePause=false;
void mouseOut(){
keys=[];
if(!pause){
//forcePause=true;
}
};
void keyPressed(){
keys[keyCode]=true;
};
void keyReleased(){
keys[keyCode]=false;
};
var CLICKED=false;
void mouseReleased(){
CLICKED=true;
};
noStroke();
var stor2=[];
var Nlogo = function(){
pushMatrix();
translate(-80,460);
stroke(255, 255, 255,150);
scale(0.6,0.6);
rectMode(CENTER);
strokeWeight(3);
noFill();
rect(200,172,71,78,3);
pushMatrix();
translate(170,200);
scale(0.05,-0.05);
noStroke();
fill(255,255,255,150);
beginShape();
vertex(-67,1158);
vertex(-64,985);
vertex(14,933);
bezierVertex(58,904,102,880,113,880);
bezierVertex(138,880,168,951,180,1042);
bezierVertex(188,1096,213,1260,220,1298);
bezierVertex(220,1299,230,1294,243,1286);
bezierVertex(255,1279,277,1270,291,1266);
bezierVertex(318,1260,340,1241,414,1162);
bezierVertex(459,1114,495,1109,505,1149);
bezierVertex(510,1168,513,1171,520,1160);
bezierVertex(525,1152,532,1149,536,1153);
bezierVertex(540,1157,551,1153,561,1144);
bezierVertex(577,1130,581,1129,594,1142);
bezierVertex(605,1153,620,1155,655,1150);
bezierVertex(680,1146,703,1147,706,1152);
bezierVertex(709,1157,717,1157,723,1152);
bezierVertex(730,1147,743,1144,752,1145);
bezierVertex(761,1147,778,1139,789,1129);
bezierVertex(800,1118,812,1110,815,1110);
bezierVertex(836,1111,840,1108,840,1095);
bezierVertex(840,1076,847,1076,867,1095);
bezierVertex(879,1108,885,1108,898,1098);
bezierVertex(910,1087,914,1087,918,1098);
bezierVertex(921,1108,925,1107,935,1094);
bezierVertex(947,1077,949,1077,973,1093);
bezierVertex(1007,1115,1017,1115,998,1093);
bezierVertex(972,1062,969,1042,991,1047);
bezierVertex(1002,1050,1013,1056,1016,1061);
bezierVertex(1025,1077,1040,1070,1033,1053);
bezierVertex(1029,1042,1030,1039,1038,1044);
bezierVertex(1045,1048,1050,1058,1050,1066);
bezierVertex(1050,1076,1056,1079,1068,1076);
bezierVertex(1077,1073,1096,1080,1109,1091);
bezierVertex(1128,1107,1133,1120,1133,1165);
bezierVertex(1132,1211,1137,1227,1161,1256);
bezierVertex(1183,1284,1187,1296,1180,1311);
bezierVertex(1170,1329,1143,1329,550,1330);
vertex(-69,1330);
vertex(-67,1158);
endShape();
beginShape();
vertex(1219,1052);
bezierVertex(1210,1048,1183,1027,1159,1006);
bezierVertex(1135,985,1121,971,1129,975);
bezierVertex(1138,980,1141,979,1136,972);
bezierVertex(1132,966,1123,963,1115,966);
bezierVertex(1107,969,1091,965,1078,956);
bezierVertex(1066,947,1060,940,1065,939);
bezierVertex(1094,937,1135,928,1140,924);
bezierVertex(1143,921,1138,913,1128,906);
bezierVertex(1109,892,1104,872,1115,847);
bezierVertex(1119,838,1120,821,1117,810);
bezierVertex(1114,797,1119,785,1133,775);
bezierVertex(1150,763,1151,758,1140,745);
bezierVertex(1121,722,1134,727,1175,760);
bezierVertex(1195,776,1216,788,1220,785);
bezierVertex(1230,779,1254,855,1246,868);
bezierVertex(1243,874,1244,881,1249,884);
bezierVertex(1258,890,1258,896,1263,985);
bezierVertex(1264,1023,1262,1035,1250,1035);
bezierVertex(1242,1036,1236,1041,1238,1048);
bezierVertex(1239,1055,1239,1060,1238,1059);
bezierVertex(1236,1059,1228,1056,1219,1052);
endShape();
beginShape();
vertex(-69,440);
vertex(-69,-70);
vertex(22,-70);
vertex(115,-70);
vertex(88,-45);
bezierVertex(70,-28,61,-12,64,3);
bezierVertex(66,15,63,31,57,38);
bezierVertex(51,46,45,59,44,68);
bezierVertex(43,78,37,112,31,144);
bezierVertex(25,176,23,206,25,211);
bezierVertex(28,215,24,220,18,223);
bezierVertex(8,226,10,232,23,247);
bezierVertex(33,258,40,271,39,276);
bezierVertex(38,281,39,288,40,293);
bezierVertex(41,297,43,303,44,308);
bezierVertex(51,337,63,360,71,360);
bezierVertex(85,360,82,387,67,393);
bezierVertex(60,396,55,415,56,441);
bezierVertex(57,465,53,490,48,497);
bezierVertex(42,504,43,511,51,515);
bezierVertex(59,521,58,525,49,531);
bezierVertex(37,539,38,542,50,550);
bezierVertex(59,556,61,563,55,568);
bezierVertex(50,572,45,584,45,595);
bezierVertex(45,606,39,621,30,628);
bezierVertex(17,640,17,641,33,636);
bezierVertex(61,627,53,655,23,670);
bezierVertex(-3,683,-3,684,18,688);
bezierVertex(31,690,40,698,40,710);
bezierVertex(40,720,45,732,50,735);
bezierVertex(55,738,60,750,60,760);
bezierVertex(60,770,64,780,69,782);
bezierVertex(74,784,80,792,82,800);
bezierVertex(84,808,89,818,94,821);
bezierVertex(106,830,68,864,-6,911);
vertex(-69,950);
vertex(-69,440);
endShape();
beginShape();
vertex(590,917);
bezierVertex(565,904,562,884,575,824);
bezierVertex(585,778,677,765,714,805);
bezierVertex(727,819,748,830,763,830);
vertex(789,830);
vertex(769,864);
bezierVertex(735,922,649,947,590,917);
endShape();
beginShape();
vertex(465,830);
bezierVertex(462,825,446,820,431,820);
bezierVertex(416,820,389,809,370,795);
bezierVertex(347,778,342,770,353,770);
bezierVertex(364,770,370,762,370,749);
bezierVertex(370,695,420,669,485,690);
bezierVertex(518,701,520,704,520,746);
bezierVertex(520,770,524,790,530,790);
bezierVertex(547,790,529,817,504,829);
bezierVertex(474,842,473,842,465,830);
endShape();
beginShape();
vertex(762,770);
bezierVertex(758,767,753,752,752,736);
bezierVertex(751,720,745,701,739,694);
bezierVertex(731,684,735,673,758,651);
bezierVertex(808,600,880,597,902,645);
bezierVertex(911,665,918,668,943,663);
bezierVertex(970,657,972,658,961,679);
bezierVertex(954,690,945,700,939,700);
bezierVertex(933,700,932,705,935,710);
bezierVertex(938,716,932,720,921,720);
bezierVertex(909,720,900,725,900,730);
bezierVertex(900,736,894,740,887,740);
bezierVertex(880,740,867,749,857,760);
bezierVertex(845,775,830,780,805,778);
bezierVertex(785,777,766,773,762,770);
endShape();
beginShape();
vertex(547,622);
bezierVertex(530,619,531,616,550,585);
vertex(571,551);
vertex(525,544);
bezierVertex(495,540,476,531,469,518);
bezierVertex(463,508,453,501,447,503);
bezierVertex(440,505,427,503,418,498);
bezierVertex(407,493,400,493,400,499);
bezierVertex(400,504,406,511,413,514);
bezierVertex(419,518,411,518,394,516);
bezierVertex(377,513,359,515,354,520);
bezierVertex(349,525,325,530,300,533);
bezierVertex(262,536,265,537,320,539);
bezierVertex(356,540,379,544,372,547);
bezierVertex(355,554,367,570,389,570);
bezierVertex(416,570,437,597,421,613);
bezierVertex(413,621,407,621,402,615);
bezierVertex(395,606,333,580,316,580);
bezierVertex(312,580,312,585,315,590);
bezierVertex(319,597,301,600,263,599);
bezierVertex(221,598,200,592,187,579);
bezierVertex(177,568,174,560,180,560);
bezierVertex(200,560,190,543,163,531);
vertex(135,518);
vertex(157,503);
bezierVertex(170,494,180,482,180,474);
bezierVertex(180,459,145,446,130,455);
bezierVertex(124,458,123,455,126,446);
bezierVertex(129,438,141,428,153,424);
bezierVertex(173,418,173,417,155,404);
bezierVertex(140,393,139,386,147,367);
bezierVertex(153,354,156,313,154,275);
bezierVertex(150,220,153,203,167,188);
bezierVertex(184,169,184,168,165,154);
bezierVertex(149,142,149,140,162,140);
bezierVertex(171,140,182,135,186,128);
bezierVertex(190,121,189,120,182,124);
bezierVertex(175,128,170,126,170,121);
bezierVertex(170,115,177,110,185,110);
bezierVertex(206,110,204,83,183,71);
bezierVertex(173,66,165,51,165,38);
bezierVertex(165,22,158,14,143,12);
bezierVertex(120,9,112,-14,130,-25);
bezierVertex(137,-29,137,-38,130,-51);
bezierVertex(119,-64,127,-70,584,-70);
bezierVertex(1013,-70,1050,-69,1059,-53);
bezierVertex(1066,-40,1063,-31,1048,-18);
bezierVertex(1036,-8,1021,0,1013,0);
bezierVertex(1006,0,1000,5,1000,10);
bezierVertex(1000,22,1043,40,1068,40);
bezierVertex(1084,39,1084,38,1068,26);
bezierVertex(1044,8,1045,0,1071,5);
bezierVertex(1101,11,1129,38,1127,61);
bezierVertex(1126,83,1110,86,1092,68);
bezierVertex(1078,54,1076,68,1089,88);
bezierVertex(1094,96,1108,99,1126,96);
vertex(1155,90);
vertex(1128,101);
bezierVertex(1097,113,1091,130,1116,130);
bezierVertex(1126,130,1130,136,1126,145);
bezierVertex(1120,161,1129,164,1154,154);
bezierVertex(1163,151,1167,143,1163,136);
bezierVertex(1159,130,1164,131,1173,139);
bezierVertex(1196,157,1194,173,1170,165);
bezierVertex(1148,158,1147,160,1156,184);
bezierVertex(1159,193,1169,200,1177,200);
bezierVertex(1187,200,1189,206,1185,220);
bezierVertex(1182,231,1182,245,1187,252);
bezierVertex(1198,270,1200,290,1190,290);
bezierVertex(1185,290,1174,293,1164,297);
bezierVertex(1153,301,1149,299,1153,293);
bezierVertex(1157,287,1146,283,1127,282);
bezierVertex(1098,282,1097,283,1118,291);
bezierVertex(1131,296,1138,304,1135,310);
bezierVertex(1132,315,1134,320,1139,320);
bezierVertex(1145,320,1150,325,1150,331);
bezierVertex(1150,336,1146,339,1141,335);
bezierVertex(1135,332,1132,338,1133,349);
bezierVertex(1134,363,1138,366,1146,359);
bezierVertex(1154,352,1156,357,1152,375);
bezierVertex(1149,392,1152,400,1161,400);
bezierVertex(1169,401,1162,407,1145,414);
bezierVertex(1113,428,1086,424,1097,407);
bezierVertex(1101,400,1097,399,1086,403);
bezierVertex(1076,407,1066,410,1064,410);
bezierVertex(1062,410,1060,417,1060,426);
bezierVertex(1060,448,1022,480,1004,473);
bezierVertex(996,470,990,472,990,477);
bezierVertex(990,488,875,514,862,506);
bezierVertex(856,503,839,507,824,515);
bezierVertex(808,523,786,530,775,530);
bezierVertex(758,530,758,528,780,513);
bezierVertex(828,480,834,470,808,469);
bezierVertex(795,468,775,466,763,465);
bezierVertex(750,464,740,467,740,471);
bezierVertex(740,476,735,480,729,480);
bezierVertex(723,480,705,491,689,504);
bezierVertex(674,517,655,530,648,533);
bezierVertex(639,536,645,546,665,563);
bezierVertex(695,588,695,589,675,604);
bezierVertex(664,612,646,620,635,620);
bezierVertex(624,621,604,622,590,623);
bezierVertex(576,625,557,624,547,622);
endShape();
popMatrix();
textAlign(CENTER,CENTER);
fill(255, 255, 255,150);
rect(201,210,74,15,3);
fill(0, 0, 0,150);
textSize(15);textFont(createFont("Arial Bold"));
text("TAZAL",203,211);
popMatrix();
};
//**********************************************************
// Item assests
//**********************************************************
var ITEMS=[{
//food
onPickupText: "+15 HP",
SHOW: function(){
noStroke();
fill(255,0,0);
rect(0,0,8,8);
fill(255,255,255);
rect(0,0,4,2);
rect(0,0,2,4);
},
onPickUp: function(){
Php+=15;
}
},{
onPickupText: "",
SHOW: function(){
noStroke();
fill(26,153,20);
rect(0,0,5,8);
fill(161,255,156);
rect(0,0,5,4);
},
onPickUp: function(){
money+=1;
}
},{
onPickupText: "+100 mec gun ammo",
SHOW: function(){
fill(255,166,0);
rect(0,0,8,8);
fill(153,143,8);
rect(0,0-2,4,1);
rect(0,0+2,4,1);
rect(0,0,4,1);
},
onPickUp: function(){
AmmoBANK[0]+=100;
}
},{
onPickupText: "+12 pistol ammo",
SHOW: function(){
fill(255,255,255);
rect(0,0,8,8);
fill(255,245,61);
rect(0,0-2,4,1);
rect(0,0+2,4,1);
rect(0,0,4,1);
},
onPickUp: function(){
AmmoBANK[1]+=12;
}
},{
onPickupText: "+5 sniper ammo",
SHOW: function(){
fill(173,129,75);
rect(0,0,8,8);
fill(255,245,61);
rect(0,0-2,4,1);
rect(0,0+2,4,1);
rect(0,0,4,1);
},
onPickUp: function(){
AmmoBANK[2]+=5;
}
},{
onPickupText: "+4 shot gun ammo",
SHOW: function(){
fill(255,255,255);
rect(0,0,8,8);
fill(255,61,61);
rect(0,0-2,4,1);
rect(0,0+2,4,1);
rect(0,0,4,1);
},
onPickUp: function(){
AmmoBANK[3]+=4;
}
},{
onPickupText: "+30 rifle ammo",
SHOW: function(){
fill(15,130,9);
rect(0,0,8,8);
fill(217,201,26);
rect(0,0-2,4,1);
rect(0,0+2,4,1);
rect(0,0,4,1);
},
onPickUp: function(){
AmmoBANK[4]+=30;
}
},{
onPickupText: "+50 smg ammo",
SHOW: function(){
fill(0,0,0);
rect(0,0,8,8);
fill(217,201,26);
rect(0,0-2,4,1);
rect(0,0+2,4,1);
rect(0,0,4,1);
},
onPickUp: function(){
AmmoBANK[5]+=50;
}
},{
onPickupText: "+15 armor",
SHOW: function(){
fill(0,0,0);
beginShape();
vertex(-7,4);
vertex(-7,-7);
vertex(7,-7);
vertex(7,4);
vertex(0,9);
endShape();
fill(69,69,69);
beginShape();
vertex(-5,2);
vertex(-5,-5);
vertex(5,-5);
vertex(5,2);
vertex(0,6);
endShape();
},
onPickUp: function(){
Parmor+=15;
if(HaveSound){playSound(getSound("rpg/step-heavy"));}
}
},{
onPickupText: "+1 GEM",
SHOW: function(){
fill(54, 135, 130);
beginShape();
vertex(-8,0);
vertex(-3,-4);
vertex(3,-4);
vertex(8,0);
vertex(0,8);
endShape();
fill(16, 227, 213);
beginShape();
vertex(-6,0);
vertex(-2,-3);
vertex(2,-3);
vertex(6,0);
vertex(0,6);
endShape();
},
onPickUp: function(){
Gems+=1;
}
},{
onPickupText: "+20 sprint",
SHOW: function(){
fill(129, 255, 110);
rect(0,0,8,8);
fill(255,255,255);
rect(0,0,4,2);
rect(0,0,2,4);
},
onPickUp: function(){
PS+=20;
}
},{
onPickupText: "+1 grenade",
SHOW: function(){
fill(9, 38, 4);
rect(0,-7,5,7);
fill(15, 69, 20);
ellipse(0,0,12,12);
},
onPickUp: function(){
PowerCount+=1;
}
},];
//**********************************************************
// fade effects for the menu
//**********************************************************
var FADE=function(position,t){
this.LiveT=250.0;
FADE.prototype.run=function(){
noStroke();
if(scene===1){
this.LiveT-=1;
}
else {
this.LiveT-=5;
}
fill(255,255,255,this.LiveT);
rect(width/2,height/2,width,height);
if(scene===1){
this.LiveT=0;
}
};
FADE.prototype.isDead=function(){
if(this.LiveT<0){
return true;
}
else {
return false;
}
};
};
//**********************************************************
// draw key
//**********************************************************
var keyDraw=function(x,y,K){
noFill();
stroke(8,8,8);
strokeWeight(3);
rect(x,y,50,50,10);
fill(3,3,3);
textSize(31);
text(K,x,y+3);
fill(255,255,255);
textSize(30);
text(K,x,y);
};
//**********************************************************
// menu buttons function
//**********************************************************
var button=function(x,y,w,h,txt,txtS,goto){
fill(219,219,219,50);
strokeWeight(5);
stroke(0,0,0);
if(mouseX>x-(w/2)&& mouseX<x+(w/2)&& mouseY>y-(h/2)&&
mouseY<y+(h/2)){
fill(173,173,173,200);
cursor("pointer");
if(CLICKED){
// if(mouseClicked){
stor2.push(new FADE(0,0,3));
scene=goto;
if(HaveSound){playSound(getSound("rpg/metal-clink"));}
//println(goto);
// }
} //}
}
rect(x,y,w,h);
strokeWeight(2);
stroke(140,140,140);
noFill();
rect(x,y,w-5,h-5);
fill(0,0,0);
textSize(txtS);
if(mouseX>x-(w/2)&& mouseX<x+(w/2)&& mouseY>y-(h/2)&&
mouseY<y+(h/2)){
noFill();
fill(0,0,0);
text(txt,x,(y+txtS/8)+ (h/25));
fill(255,255,255);
textSize(txtS);
text(txt,x,y+(h/25));
}
else {
fill(0,0,0);
text(txt,x,y+txtS/8);
fill(255,255,255);
textSize(txtS);
text(txt,x,y);
}
noStroke();
};
//**********************************************************
// sdsd
//**********************************************************
var Zshot2=function(position,pos2x,pos2y,rot){
this.acceleration=new PVector(0.00,0.00);
this.position=position.get();
this.LiveT=255.0;
this.OldX=this.position.x+random(-10,10);
this.OldY=this.position.y+random(-10,10);
this.NewX=0;
this.NewY=0;
this.Heading=rot;
if(splat_Spawn===1){this.LiveT=-1;}
Zshot2.prototype.run=function(){
this.NewX=this.OldX+(1.5*cos1(this.Heading)); //
this.NewY=this.OldY+(1.5*sin1(this.Heading));
this.OldX=this.NewX;
this.OldY=this.NewY;
pushMatrix();
translate(300-CamX,300-CamY);
translate(this.OldX,this.OldY);
noStroke();
fill(74,204,51,this.LiveT);
ellipse(0,0,5,5);
this.LiveT-=8;
popMatrix();
};
Zshot2.prototype.isDead=function(){
if(this.LiveT<0){
return true;
}
else {
return false;
}
};
};
//**********************************************************
// splat marks
//**********************************************************
var spt=function(position){
this.position=position.get();
this.LiveT=355.0;
this.size=random(5,10);
if(REMOVELAG){
this.LiveT=155.0;
}
if(FIX_SHOP_BUG){this.LiveT=100;}
if(stor.length>Max_effects){
this.LiveT=50;
}
};
spt.prototype.run=function(){
this.LiveT-=1;
//pushMatrix();
fill(103,355,0,this.LiveT);
//translate(this.position.x,this.position.y);
ellipse(this.position.x,this.position.y,this.size,this.size);
//popMatrix();
};
spt.prototype.isDead=function(){
if(this.LiveT<0){
return true;
}
else {
return false;
}
};
//**********************************************************
// expolsion particle
//**********************************************************
var BOOM=function(position){
this.position=position.get();
this.LiveT=250;
this.starCenterX=0; //this.position.x+(300-CamX);
this.starCenterY=0; //this.position.y+(300-CamY);
this.starRad=150;
this.pointX=0;
this.pointY=0;
this.angle=random(0,180);
noStroke();
BOOM.prototype.run=function(){
this.LiveT-=20;
pushMatrix();
translate(this.position.x,this.position.y);
beginShape();
fill(255,234,0,this.LiveT);
for (var count=0; count<7; count++){
this.pointX=this.starCenterX+this.starRad*sin1(this.angle);
this.pointY=this.starCenterY+this.starRad*cos1(this.angle);
vertex(this.pointX,this.pointY);
this.angle+=360/7*4;
}
endShape(CLOSE);
fill(355-this.LiveT,0,21,this.LiveT);
beginShape();
for (var count=0; count<7; count++){
this.pointX=this.starCenterX+60*sin1(this.angle);
this.pointY=this.starCenterY+60*cos1(this.angle);
vertex(this.pointX,this.pointY);
this.angle+=360/7*4;
}
endShape(CLOSE);
if(dist(this.position.x,this.position.y,PX,PY)< 100){
if(Parmor <=0){
DiedHow="blown up";
Php-=2;
}
else {
DiedHow="blown up";
Parmor-=1;
}
}
popMatrix();
};
BOOM.prototype.isDead=function(){
if(this.LiveT<0){
return true;
}
else {
return false;
}
};
};
var Gnad = function(position) {
this.LiveT = 255.0;
this.TX = mouseX-(300-CamX);
this.TY = mouseY-(300-CamY);
this.X = position.x;
this.Y = position.y;
this.Rot=random(0,360);
Gnad.prototype.run = function() {
this.X += (this.TX - this.X) * 0.03;
this.Y += (this.TY - this.Y) * 0.03;
pushMatrix();
translate(this.X,this.Y);
rotate1(this.Rot);
fill(9, 38, 4);
rect(0,-7,5,7);
fill(15, 69, 20);
ellipse(0,0,12,12);
this.LiveT-=5;
popMatrix();
};
Gnad.prototype.isDead = function() {
if (this.LiveT < 0) {
Pnoise+=300;
if(HaveSound){playSound(getSound("retro/rumble"));}
for (var j=0; j<ZOldX.length; j++){
if(dist(ZOldX[j],ZOldY[j],this.X,this.Y)<
100){
Zhp[j]-=150-dist(ZOldX[j],ZOldY[j],this.X,
this.Y);
for (var w=0; w <=splat_Spawn*4; w++){
stor.push(new spt(new PVector(ZOldX[j]+random(-20,20),
ZOldY[j]+random(-20,20))));
}
}
}
stor.push(new BOOM(new PVector(this.X,this.Y)));return true;} else {return false;}
};};
var AirStk = function(position) {
this.LiveT = 300.0;
this.TX = mouseX-(300-CamX);
this.TY = mouseY-(300-CamY);
this.X = position.x;
this.Y = position.y;
this.RX=0;
this.RY=0;
this.Rot=random(0,360);
AirStk.prototype.run = function() {
this.X = this.TX;
this.Y = this.TY;
pushMatrix();
translate(this.X,this.Y);
rotate1(this.Rot);
fill(217, 44, 35,150);
ellipse(0,0,20,20);
this.LiveT-=1;
popMatrix();
if(this.LiveT<=100){
if(this.LiveT%10===0){
this.RX=this.X+random(-150,150);
this.RY=this.Y+random(-150,150);
for (var j=0; j<ZOldX.length; j++){
if(dist(ZOldX[j],ZOldY[j],this.RX,this.RY)<100){
Zhp[j]-=150;
for (var w=0; w <=splat_Spawn*4; w++){
stor.push(new spt(new PVector(ZOldX[j]+random(-20,20),
ZOldY[j]+random(-20,20))));
}
}
}
stor.push(new BOOM(new PVector(this.RX,this.RY)));
}}
};
AirStk.prototype.isDead = function() {
if (this.LiveT < 0) {
Pnoise+=300;
return true;} else {return false;}
};};
var Adrine=function(){
// this.position=position.get();
this.LiveT=255.0;
Adrine.prototype.run=function(){
this.LiveT-=0.5;
Php+=Php/100;
PS+=PS/100;
damageMULTbase=3;
fill(117, 9, 9,this.LiveT);
rect(300,300,700,700);
};
Adrine.prototype.isDead=function(){
if(this.LiveT<0){
damageMULTbase=1;
return true;
}
else {
return false;
}
};
};
//**********************************************************
// Splat marks that cover the screen
//**********************************************************
var BigSplat=function(position){
this.position=position.get();
this.LiveT=555.0;
this.A=0;
this.size=random(50,150);
BigSplat.prototype.run=function(){
if(scene===1){this.LiveT-=0.5;}
this.A+=0.2;
noStroke();
fill(0,255,0,this.LiveT);
ellipse(this.position.x,this.position.y+this.A,this.size,this.size +
this.A);
if(scene===0){this.LiveT=0;}
};
BigSplat.prototype.isDead=function(){
if(this.LiveT<0){
return true;
}
else {
return false;
}
};
};
//**********************************************************
// spitter zombies spit
//**********************************************************
var Zshot=function(position,rot){
this.acceleration=new PVector(0.00,0.00);
this.position=position.get();
this.LiveT=255.0;
this.OldX=this.position.x;
this.OldY=this.position.y;
this.NewX=0;
this.NewY=0;
// println(rot);
this.Heading=rot; //atan3(PY-this.OldY,PX-this.OldX);
};
Zshot.prototype.run=function(){
this.NewX=this.OldX+(4*cos1(this.Heading)); //
this.NewY=this.OldY+(4*sin1(this.Heading));
this.OldX=this.NewX;
this.OldY=this.NewY;
pushMatrix();
translate(this.OldX,this.OldY);
noStroke();
fill(51,237,19,200);
ellipse(0,0,12,12);
fill(38,179,16,200);
ellipse(0,0,10,10);
if(dist(this.OldX,this.OldY,PX,PY)< 20){
if(Parmor <=0){
DiedHow="hit by\n a goo ball";
Php-=20+Zombie_di_mult;
}
else {
DiedHow="hit by\n a goo ball";
Parmor-=20+Zombie_di_mult;
}
this.LiveT=-1;
for (var w=0; w <=splat_Spawn*4; w++){
stor.push(new spt(new PVector(PX+random(-20,20),
PY+random(-20,20))));
}
for (var t=0; t<2; t++){
stor2.push(new BigSplat(new PVector(random(0,width),random(
0,width))));
}
}
this.LiveT-=1;
popMatrix();
//if(frameCount%2=e==1){stor2.push(new Zshot2(new PVector(this.OldX,this.OldY),0,0,this.Heading));}
};
Zshot.prototype.isDead=function(){
if(this.LiveT<0){
return true;
}
else {
return false;
}
};
//**********************************************************
// gun change function
//**********************************************************
var gunchange=function(){
BAcc=GUN[GUNE].acc; // gun acc
BAccM=GUN[GUNE].acc;
BAccAdd=GUN[GUNE].AccA;
BAccR=GUN[GUNE].AccS;
BperS=GUN[GUNE].BPS; // bullets per shot
BSpeed=GUN[GUNE].speed; // bullet speed
BDelay=GUN[GUNE].delay; // shot delay
Bdam=GUN[GUNE].damage; // bullet damage
ammo=GUN[GUNE].ammo; // gun ammo
ammoMax=GUN[GUNE].ammoMax; // gun ammo max
//ammoR=GUN[GUNE].ammoBank; // ammo res
Reload=GUN[GUNE].reload; // how fast is the reload
gunT=GUN[GUNE].Type; // the type
BhpL=GUN[GUNE].Blife; // the bullets live
};
//**********************************************************
// Big text particles
//**********************************************************
var ParticleTxt2=function(position,AMT){
this.acceleration=new PVector(0.00,0.00);
this.velocity=new PVector(random(-0,0),random(0,-0));
this.position=position.get();
this.LiveT=250.0;
this.txt=AMT;
ParticleTxt2.prototype.run=function(){
this.velocity.add(this.acceleration);
this.position.add(this.velocity);
this.LiveT-=1;
pushMatrix();
translate(this.position.x,this.position.y);
noStroke();
fill(255,255,255,this.LiveT);
textSize(65);
text(this.txt,0,0);
textSize(12);
popMatrix();
};
ParticleTxt2.prototype.isDead=function(){
if(this.LiveT<0){
return true;
}
else {
return false;
}
};
};
//**********************************************************
// text particles
//**********************************************************
var ParticleTxt=function(position,AMT){
this.acceleration=new PVector(0.00,-0.01);
this.velocity=new PVector(random(-0,0),random(0,-0));
this.position=position.get();
this.LiveT=250.0;
this.txt=AMT;
ParticleTxt.prototype.run=function(){
this.velocity.add(this.acceleration);
this.position.add(this.velocity);
this.LiveT-=3;
pushMatrix();
translate(this.position.x,this.position.y);
noStroke();
fill(255,255,255,this.LiveT);
textSize(20);
text(this.txt,0,0);
textSize(12);
popMatrix();
};
ParticleTxt.prototype.isDead=function(){
if(this.LiveT<0){
return true;
}
else {
return false;
}
};
};
//**********************************************************
// ITEM DROP
//**********************************************************
var ITEM=function(position,t){
this.position=position.get();
this.LiveT=5555.0;
this.Rot=random(0,360);
this.T=t;
ITEM.prototype.run=function(){
pushMatrix();
translate(this.position.x,this.position.y);
rotate1(this.Rot);
this.LiveT-=6;
ITEMS[this.T].SHOW();
popMatrix();
if(dist(this.position.x,this.position.y,PX,PY)<=30){
this.LiveT=-1;
}
};
ITEM.prototype.isDead=function(){
if(this.LiveT <=0){
stor2.push(new ParticleTxt(new PVector(300,500),ITEMS[this.T].onPickupText));
ITEMS[this.T].onPickUp();
return true;
}
else {
return false;
}
};
};
//**********************************************************
// gun shells particles
//**********************************************************
var shell=function(position){
this.position=position.get();
this.LiveT=555.0;
this.R=angle;
this.B=0;
this.A=0;
this.BA=random(1.4,1.8);
if(FIX_SHOP_BUG){this.LiveT=0;}
shell.prototype.run=function(){
this.LiveT-=6;
pushMatrix();
noStroke();
fill(180,180,0,this.LiveT);
translate(this.position.x,this.position.y);
rotate1(this.R);
this.R+=random(-this.BA,this.BA);
rect(this.B,-20+(this.A/3),3,8);
this.B+=this.BA;
this.A+=random(-this.BA,this.BA);
this.BA-=0.05;
popMatrix();
this.BA=constrain(this.BA,0,1.8);
};
shell.prototype.isDead=function(){
if(this.LiveT<0){
return true;
}
else {
return false;
}
};
};
//**********************************************************
// Crate wood marks
//**********************************************************
var Cratespt=function(position){
this.position=position.get();
this.LiveT=255.0;
this.rot=random(0,360);
this.size=random(8,20);
if(FIX_SHOP_BUG){this.LiveT=0;}
Cratespt.prototype.run=function(){
if(REMOVELAG){
this.LiveT=-1;
}
this.LiveT-=1;
pushMatrix();
translate(this.position.x,this.position.y);
rotate1(this.rot);
fill(176,106,0,this.LiveT);
rect(0,0,this.size,5);
popMatrix();
};
Cratespt.prototype.isDead=function(){
if(this.LiveT<0){
return true;
}
else {
return false;
}
};
};
//**********************************************************
// drop items
//**********************************************************
var Additem=function(X,Y){
var randomDropitem=floor(random(0,20));
if(randomDropitem>15){
// stor.push(new ITEM(new PVector(X,Y),round(random(2,7))));
}
if(randomDropitem===15&&Php<50){
stor.push(new ITEM(new PVector(X,Y),0));
}
if(randomDropitem===1){
stor.push(new ITEM(new PVector(X,Y),8));
}
if(randomDropitem===10&&wave >=10){
stor.push(new ITEM(new PVector(X,Y),9));
}
if(randomDropitem===18&&PS!==PSmax){
stor.push(new ITEM(new PVector(X,Y),10));
}
};
//**********************************************************
// kills the bullet
//**********************************************************
var Bkill=function(X){
BOldX.splice(X,1);
BOldY.splice(X,1);
BNewX.splice(X,1);
BNewY.splice(X,1);
BRot.splice(X,1);
BHeading.splice(X,1);
Bhp.splice(X,1);
Bpow.splice(X,1);
};
//**********************************************************
// add zombie
//**********************************************************
var AddZombie=function(T,num,x,y){
for (var V=0; V<num; V++){
ZT.push(T);
if(x !==0){
ZOldX.push(x+random(-10,10));
ZOldY.push(y+random(-10,10));
}
else {
ZOldX.push(random(-400,MAP_W+400)+ random(-10,10));
ZOldY.push(random(-400,MAP_W+400)+ random(-10,10));
}
ZNewX.push(0);
ZNewY.push(0);
ZRot.push(random(0,360));
Zhp.push(Zombies[T].hp*Zombie_di_mult);
ZHeading.push(random(0,360));
ZHeadingTemp.push(0);
ZSpeed.push(Zombies[T].speed);
ZSpeedMAX.push(Zombies[T].speed);
ZSpeedAtktimer.push(1000);
ZTi.push(Zombie_Dect_timer);
}
};
//**********************************************************
// kills the Zombie
//**********************************************************
var Zkill=function(X){
shake+=0.3;
Zkills+=1;
ZT.splice(X,1);
ZTi.splice(X,1);
ZNewX.splice(X,1);
ZNewY.splice(X,1);
ZOldX.splice(X,1);
ZOldY.splice(X,1);
ZRot.splice(X,1);
ZHeading.splice(X,1);
Zhp.splice(X,1);
ZHeadingTemp.splice(X,1);
ZSpeed.splice(X,1);
ZSpeedMAX.splice(X,1);
ZSpeedAtktimer.splice(X,1);
};
//**********************************************************
// akting
//**********************************************************
var AtkTimer=0;
var ArotX=0;
var ArotY=0;
var PrivE=0;
var AtkM=0;
var Atking=false;
var AktingShow=function(){
this.LiveT=80.0;
this.rot=random(0,360);
this.lastGun=GUNE;
this.lastE=itemE;
AktingShow.prototype.run=function(){
this.LiveT-=meleeWep[meleeE].speed;
pushMatrix();
translate(-300+CamX,-300+CamY);
translate(600,600);
translate(-303-(PmouseX-width/2)/2,-300-(PmouseY-
height/2)/2);
//shows the gun
meleeWep[meleeE].display(this.LiveT);
AtkTimer=meleeWep[meleeE].delay;
popMatrix();
for (var ii=0; ii <=ZOldX.length; ii++){
if(dist(ZOldX[ii],ZOldY[ii],PX+ArotX,PY+ArotY)<=meleeWep[meleeE].range){
ZHeading[ii]=atan3(PY-ZOldY[ii],PX-ZOldX[ii]);
Zhp[ii]-=meleeWep[meleeE].damage*(1+(AtkM/100));
ZSpeed[ii]=ZSpeedMAX[ii];
//makes splat marks
for (var i=0; i <=splat_Spawn; i++){
stor2.push(new spt(new PVector(ZOldX[ii]+random(-20,20),
ZOldY[ii]+random(-20,20))));
}
}
}
};
AktingShow.prototype.isDead=function(){
if(this.LiveT<-70){
Atking=false;
GUNE=this.lastGun;
gunchange();
itemE=this.lastE;
return true;
}
else {
return false;
}
};
};
var popText = function(pos) {
this.pos = pos.get();
this.value=0;
this.Ovalue=0;
this.Evalue=0;
this.chTimer=0;
this.LiveT=1;
popText.prototype.run = function() {
this.LiveT-=10;
if(this.value!==this.Ovalue){
this.Ovalue=this.value;
this.chTimer+=100;
this.LiveT+=255;
}
noStroke();
textAlign(CENTER,CENTER);
fill(255, 255, 255,this.LiveT);
pushMatrix();
translate(this.pos.x,this.pos.y);
rotate1(this.chTimer/3);
if(this.value-this.Evalue>=3){textSize(30+this.chTimer/5);
text(this.value-this.Evalue,0,0);
}
popMatrix();
this.value=Zkills;
this.chTimer-=10;
this.chTimer=constrain(this.chTimer,0,200);
this.LiveT=constrain(this.LiveT,0,600);
if(this.LiveT<=0){
this.Evalue=Zkills-1;
this.LiveT=1;
}
};
popText.prototype.isDead = function() {
//if(this.LiveT<=0){return true;}
};
};
//**********************************************************
// m atk
//**********************************************************
var MAtk=function(){
if(AtkTimer <=0){
var ArotX=sin1(angle-12)* 300/11.5;
var ArotY=-cos1(angle-12)* 300/11.5;
Atking=true;
AtkTimer=meleeWep[meleeE].delay;
stor.push(new AktingShow());
for (var ii=0; ii <=ZOldX.length; ii++){
if(dist(ZOldX[ii],ZOldY[ii],PX+ArotX,PY+ArotY)<=meleeWep[meleeE].range){
ZHeading[ii]=atan3(PY-ZOldY[ii],PX-ZOldX[ii]);
Zhp[ii]-=meleeWep[meleeE].damage*(1+(AtkM/100));
ZSpeed[ii]=ZSpeedMAX[ii];
//makes splat marks
for (var i=0; i <=splat_Spawn; i++){
stor.push(new spt(new PVector(ZOldX[ii]+random(-20,20),
ZOldY[ii]+random(-20,20))));
}
}
}
// GUNE=GUNU[1];gunchange();itemE=1;
}
};
//**********************************************************
// reload and fireing
//**********************************************************
var FireModeCheck = false;
var GunMATH=function(){
time++;
shooting=false;
if(time>BDelay&&ammo>0&&IsReloading===false){
if((keys[32] || mousePressed)){
if(!FireModeCheck){
for (var i=0; i<BperS; i++){
shotFired+=1;
var rotX=sin1(angle-12)* 300/11.5;
var rotY=-cos1(angle-12)* 300/11.5;
shooting=true;
Bhp.push(BhpL);
BOldX.push(PX+rotX);
BOldY.push(PY+rotY);
BRot.push(angle);
BHeading.push(angle-90-random(BAcc*-1,BAcc));
Bpow.push(Bdam);
}
stor.push(new shell(new PVector(PX,PY)));
Pnoise+=GUN[GUNE].noise;
if(HaveSound){playSound(getSound("retro/hit2"));}
// playSound(getSound("retro/hit1"));
BAcc+=BAccAdd;
BAcc=constrain(BAcc,0,9);
time=0;
ammo-=1;
if(GUN[GUNE].FireMode==="simi"){
FireModeCheck=true;
}
}
}else{
FireModeCheck=false;
}
}
else {
shooting=false;
}
if(shooting===false&&BAcc>GUN[GUNE].acc){
BAcc-=GUN[GUNE].AccS;
}
if(IsReloading===false&&ammo <=0&&shooting===true){
stor2.push(new ParticleTxt(new PVector(300,500),"out of ammo"));
}
if(IsReloading===true&&AmmoBANK[GUN[GUNE].AT]>0){
ReloadTimer++;
if(ReloadTimer >=Reload){
IsReloading=false;
if(AmmoBANK[GUN[GUNE].AT]<ammoMax){
ammo=AmmoBANK[GUN[GUNE].AT];
//ammoR-=ammoMax-ammo;
AmmoBANK[GUN[GUNE].AT]-=ammoMax-ammo;
AmmoBANK[GUN[GUNE].AT]=constrain(AmmoBANK[GUN[GUNE].AT],0,
100000);
}
else {
//ammoR-=ammoMax-ammo;
AmmoBANK[GUN[GUNE].AT]-=ammoMax-ammo;
ammo=ammoMax;
AmmoBANK[GUN[GUNE].AT]=constrain(AmmoBANK[GUN[GUNE].AT],0,
100000);
}
ReloadTimer=0;
BAcc=BAccM;
}
}
GUN[GUNE].ammoBank=AmmoBANK[GUN[GUNE].AT];
GUN[GUNE].ammo=ammo;
};
//**********************************************************
// Bullet Math
//**********************************************************
var BulletMATH=function(){
fill(255,255,0);
for (var i=0; i<BOldX.length; i++){
pushMatrix();
rectMode(CENTER);
translate(BOldX[i],BOldY[i]);
rotate1(BHeading[i]+90);
bulletDisplay[GUN[GUNE].BType]();
popMatrix();
BNewX[i]=BOldX[i]+(BSpeed*cos1(BHeading[i])); //
BNewY[i]=BOldY[i]+(BSpeed*sin1(BHeading[i]));
BOldX[i]=BNewX[i];
BOldY[i]=BNewY[i];
//kills bullet ifits hp is 0<
if(Bhp[i] <=0){
Bkill(i);
}
for (var ii=0; ii <=ZOldX.length; ii++){
if(dist(ZOldX[ii],ZOldY[ii],BOldX[i],BOldY[i])<=15){
ZHeading[ii]=atan3(PY-ZOldY[ii],PX-ZOldX[ii]);
Zhp[ii]-=Bdam*damageMULT;
if(HaveSound){playSound(getSound("rpg/hit-splat"));}
if(Game_mode===3){
Zhp[ii]-=Bdam*damageMULT;
}
ZSpeed[ii]=ZSpeedMAX[ii];
ZHeadingTemp[ii]=atan3(ZOldY[ii]-PY,ZOldX[ii]-PX);
for (var h=0; h <=10; h++){
ZNewX[ii]=ZOldX[ii]+(ZSpeed[ii]*cos1(ZHeadingTemp[ii])); //
ZNewY[ii]=ZOldY[ii]+(ZSpeed[ii]*sin1(ZHeadingTemp[ii]));
ZOldX[ii]=ZNewX[ii];
ZOldY[ii]=ZNewY[ii];
}
Bhp[i]-=0.1;
for (var h=0; h <=splat_Spawn; h++){
stor2.push(new Zshot2(new PVector(ZOldX[ii],ZOldY[ii]),
BOldX[i],BOldY[i],BHeading[i]));
//makes splat marks
}
for (var w=0; w <=splat_Spawn; w++){
stor.push(new spt(new PVector(ZOldX[ii]+random(-20,20),
ZOldY[ii]+random(-20,20))));
}
}
}
//kills bullet ifit is more then 600 away from player
if(dist(BOldX[i],BOldY[i],PX,PY)> 600){
Bkill(i);
}
}
};
//**********************************************************
// zombie Math and AI
//**********************************************************
var ZombieMATH=function(){
for (var i=0; i<ZOldX.length; i++){
pushMatrix();
rectMode(CENTER);
translate(ZOldX[i],ZOldY[i]);
if(ZOldX[i]===0&&ZOldY[i]===0){
Zkill(i);
}
rotate1(ZHeading[i]+90);
Zombies[ZT[i]].show();
popMatrix();
ZSpeedAtktimer[i]-=5;
if(ZSpeedAtktimer[i]<0){
if(dist(ZOldX[i],ZOldY[i],PX,PY)<=15){
if(Parmor <=0){
DiedHow="contaminated";
Php-=1*Zombie_di_mult;
}
else {
DiedHow="contaminated";
Parmor-=0.5*Zombie_di_mult;
}
ZSpeedAtktimer[i]=20;
}
//---------------------------------------
if(ZT[i]===1&&dist(ZOldX[i],ZOldY[i],PX,PY)<=Pnoise){
stor.push(new Zshot(new PVector(ZOldX[i],ZOldY[i]),atan3(PY -
ZOldY[i],PX-ZOldX[i])));
ZSpeedAtktimer[i]=1000;
}
//---------------------------------------
if(ZT[i]===2&&dist(ZOldX[i],ZOldY[i],PX,PY)<=Pnoise&&ZT
.length<60){
AddZombie(3,1,ZOldX[i]+random(-20,20),ZOldY[i]+random(-
20,20));
ZSpeedAtktimer[i]=500;
}
//---------------------------------------
if(ZT[i]===4&&dist(ZOldX[i],ZOldY[i],PX,PY)<=100&&ZT.length <
30){
for (var j=0; j <=splat_Spawn; j++){
stor.push(new spt(new PVector(ZOldX[i]+random(-20,20),
ZOldY[i]+random(-20,20))));
}
AddZombie(3,5,ZOldX[i]+random(-40,40),ZOldY[i]+random(-
40,40));
ZSpeedAtktimer[i]=500;
Zkill(i);
}
//---------------------------------------
if(ZT[i]===8&&dist(ZOldX[i],ZOldY[i],PX,PY)<=Pnoise){
stor.push(new Zshot(new PVector(ZOldX[i],ZOldY[i]),random(0,
360)));
ZSpeedAtktimer[i]=100;
}
if(ZT[i]===6&&dist(ZOldX[i],ZOldY[i],PX,PY)<=Pnoise){
ZSpeedAtktimer[i]=5000;
AddZombie(4,2,ZOldX[i]+random(-20,20),ZOldY[i]+random(-
20,20));
AddZombie(1,4,ZOldX[i]+random(-20,20),ZOldY[i]+random(-
20,20));
stor.push(new Zshot(new PVector(ZOldX[i],ZOldY[i]),300));
}
//---------------------------------------
if(1===1&&ZT[i]===5&&dist(ZOldX[i],ZOldY[i],PX,PY)<=50&&ZT.length<30){
if(Parmor <=0){
DiedHow="coverd in goo";
Php-=30*Zombie_di_mult;
}
else {
DiedHow="coverd in goo";
Parmor-=15*Zombie_di_mult;
}
Zhp[i]-=100;
for (var j=0; j <=splat_Spawn*4; j++){
stor.push(new spt(new PVector(ZOldX[i]+random(-40,40),
ZOldY[i]+random(-40,40))));
}
for (var t=0; t<splat_Spawn*4; t++){
stor2.push(new BigSplat(new PVector(random(0,width),random(
0,width))));
}
ZSpeedAtktimer[i]=10000;
}
//---------------------------------------
}
if(dist(ZOldX[i],ZOldY[i],PX,PY)<=Pnoise){
ZHeading[i]=atan3(PY-ZOldY[i],PX-ZOldX[i]);
ZSpeed[i]=ZSpeedMAX[i];
}
else {
ZSpeed[i]-=0.001;
}
if(ZOldX[i] >=-30&&ZOldX[i] <=MAP_W+30&&ZOldY[i] >=-30 &&
ZOldY[i] <=MAP_W+30){}
else if(ZTi[i] <=0){
ZSpeed[i]+=0.01;
ZHeading[i]=atan3(random(0,MAP_H)- ZOldY[i],random(0,MAP_W)-
ZOldX[i]);
ZNewX[i]=ZOldX[i]+(ZSpeed[i]*cos1(ZHeading[i])); //
ZNewY[i]=ZOldY[i]+(ZSpeed[i]*sin1(ZHeading[i]));
ZOldX[i]=ZNewX[i];
ZOldY[i]=ZNewY[i];
}
if(ZTi[i] <=0){
for (var j=0; j <=ZOldX.length; j++){
if(j !==i&&dist(ZOldX[i],ZOldY[i],ZOldX[j],ZOldY[j])<=Zombies[ZT[i]].Dect){
ZHeadingTemp[i]=atan3(ZOldY[i]-ZOldY[j],ZOldX[i]-ZOldX[
j]);
ZNewX[i]=ZOldX[i]+(ZSpeed[i]*cos1(ZHeadingTemp[i])); //
ZNewY[i]=ZOldY[i]+(ZSpeed[i]*sin1(ZHeadingTemp[i]));
ZOldX[i]=ZNewX[i];
ZOldY[i]=ZNewY[i];
}
}
ZTi[i]=Zombie_Dect_timer;
}
ZNewX[i]=ZOldX[i]+(ZSpeed[i]*cos1(ZHeading[i])); //
ZNewY[i]=ZOldY[i]+(ZSpeed[i]*sin1(ZHeading[i]));
ZOldX[i]=ZNewX[i];
ZOldY[i]=ZNewY[i];
if(Zhp[i] <=0){
for (var j=0; j<Zombies[ZT[i]].moneyD; j++){
stor.push(new ITEM(new PVector(ZOldX[i]+random(-20,20),ZOldY[
i]+random(-20,20)),1));
}
Additem(ZOldX[i]+random(-20,20),ZOldY[i]+random(-20,20));
Zkill(i);
}
ZSpeed[i]=constrain(ZSpeed[i],0,ZSpeedMAX[i]);
ZTi[i]-=1;
}
};
//**********************************************************
// player model
//**********************************************************
var playerModel=function(t,a,x,y,s){
noStroke();
pushMatrix();
if(x===0.01){
translate(600,600);
translate(-300-(PmouseX-0-width/2)/ 2,-300-(PmouseY-0 -
height/2)/ 2);
}
else {
translate(x,y);
}
rotate1(a);
scale(s);
handColor=Classes[t].HC;
Classes[t].show(x,y,a);
popMatrix();
};
//**********************************************************
// gun upgra
//**********************************************************
var GunGOT=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
];
var random124=0;
var gungetX=0;
var gungetY=0;
var gungetT=0;
var gungetG=0;
var Gungetshow=function(x,y,g){
fill(189,185,185,200);
stroke(0,0,0);
strokeWeight(3);
rect(x-50,y,60,45);
noStroke();
pushMatrix();
translate(x-65,y+5);
rotate1(90);
scale(1.2);
GUN[g].show();
popMatrix();
playerModel(player_model_E,90,x-65,y+5,1.2);
textAlign(LEFT);
textSize(10);
random124=GUN[g].reload/60;
//.substring(0,5)
fill(140, 140, 140,200);
stroke(0,0,0);
rect(x,y+98,160,148);
fill(0,0,0);
//440 ,492//String(random124).substring(0,3)
text("[ "+GUN[g].name+" ]\nMag-Size: "+GUN[g].ammoMax +
"\nReload speed: "+String(GUN[g].reload/60).substring(0,3)+
" sec"+"\nDamage: "+round(GUN[g].damage*damageMULT)+ "x" +
GUN[g].BPS+"\nAccuracy: "+(10-GUN[g].acc)+ "0%" +
"\nPircing: "+round(GUN[g].Blife/0.1)+"x\nRecoil: "+GUN[g].AccA+"0%"+"\nFire Rate: "+round(1000 /
GUN[g].delay)+ " RPM"+"\nMovement: -"+(GUN[g].Weight/4)*
100+"%"+"\nnoise: "+GUN[g].noise+"\nFiremode:"+GUN[g].FireMode+"\nID#:"+g,x-68,y+41);
fill(255,255,255);
text("[ "+GUN[g].name+" ]\nMag-Size: "+GUN[g].ammoMax +
"\nReload speed: "+String(random124).substring(0,3)+ " sec" +
"\nDamage: "+round(GUN[g].damage*damageMULT)+ "x"+GUN[g].BPS +
"\nAccuracy: "+(10-GUN[g].acc)+ "0%"+"\nPircing: "+round(GUN[g].Blife/0.1)+"x\nRecoil: "+GUN[g].AccA +
"0%"+"\nFire Rate: "+round(1000/GUN[g].delay)+ " RPM" +
"\nMovement: -"+(GUN[g].Weight/4)* 100+"%"+"\nnoise: " +
GUN[g].noise+"\nFiremode:"+GUN[g].FireMode+"\nID#:"+g,x-68,y+39);
textAlign(CENTER,CENTER);
};
var GUNgetUpg=function(g,x,y,cost,costType){
fill(130,128,128,50);
if(mouseX>x-20&&mouseX<x+20&&mouseY>y-23&&mouseY<y +
23){
// fill(237,237,237,80);
}
stroke(8,8,8);
strokeWeight(3);
rect(x,y,40,46);
fill(196,196,196);
fill(0,0,0);
noStroke();
textSize(11);
noStroke();
fill(0,0,0);
if(GunGOT[g]===1){
if(mouseX>x-25&&mouseX<x+25&&mouseY>y-20&&mouseY <
y+20){
fill(255, 252, 252);
text("equip",x,y+12);
}
else {
text("---",x,y+12);
fill(255, 252, 252);
}
}
else {
if(costType===0){
fill(0,0,0);
text(cost+"$",x,y+16);
fill(250,245,250);
text(cost+"$",x,y+14);
}
else
if(costType===1){
fill(0,0,0);
text(cost+"G",x,y+16);
fill(8,243,255);
text(cost+"G",x,y+14);
}
}
if(g===GUNE){
stroke(8,8,8);
strokeWeight(2);
stroke(255, 255, 255);
noFill();
rect(x,y,37,43);
noStroke();
}
pushMatrix();
translate(x-8,y-5);
rotate1(100);
scale(0.7);
GUN[g].show();
popMatrix();
playerModel(player_model_E,100,x-8,y-5,0.8);
if(mouseX>x-25&&mouseX<x+25&&mouseY>y-20&&mouseY<y +
20){
//if(keys[69]){
if(CLICKED){
if(costType===0){
if(money >=cost&&GunGOT[g] !==1){
money-=cost;
GUNU[itemE]=g;
GUNE=GUNU[itemE];
gunchange();
GunGOT[g]=1;
GunSGOT+=1;
if(HaveSound){playSound(getSound("rpg/coin-jingle"));}
}
else if(GunGOT[g]===1){
GUNU[itemE]=g;
GUNE=GUNU[itemE];
gunchange();
}
}
if(costType===1){
if(Gems >=cost){
Gems-=cost;
GUNU[itemE]=g;
GUNE=GUNU[itemE];
gunchange();
GunGOT[g]=1;
GunSGOT+=1;
}
else if(GunGOT[g]===1){
GUNU[itemE]=g;
GUNE=GUNU[itemE];
gunchange();
}
}
}
}
if(mouseX>x-30&&mouseX<x+30&&mouseY>y-20&&mouseY<y +
20){
cursor("pointer");
fill(255,255,255);
textSize(12);
gungetX=x;
gungetY=y;
gungetG=g;
gungetT+=1;
}
else {}
};
//**********************************************************
// item drop
//**********************************************************
var GungetT=0;
var randomItemGun=[floor(random(1,25)),floor(random(15,25))];
var GUNget=function(g,x,y,cost){
textSize(12);
fill(130,128,128);
rect(x,y,60,40);
fill(196,196,196);
rect(x,y-22,60-(60*(GungetT/2000)),5);
fill(0,0,0);
GungetT+=0.5;
if(GungetT>2000){
randomItemGun=[floor(random(1,25)),floor(random(15,250))];
GungetT=0;
}
text(cost+"$",x,y+15);
pushMatrix();
translate(x-10,y-5);
rotate1(90);
GUN[g].show();
popMatrix();
playerModel(player_model_E,90,x-10,y-5);
if(PX>x-30&&PX<x+30&&PY>y-20&&PY<y+20){
if(key.toString()==='q'){
if(money >=5){
randomItemGun=[floor(random(1,25)),floor(random(15,25))];
money-=5;
}
}
if(keys[69]){
if(money >=cost){
money-=cost;
GUNU[itemE]=g;
GUNE=GUNU[itemE];
gunchange();
}
}
}
if(PX>x-30&&PX<x+30&&PY>y-20&&PY<y+20){
textSize(15);
fill(3,3,3);
text("press [E] to buy",300,300-21);
text("press [E] to buy",300,300-19);
textSize(15);
fill(255,255,255);
text("press [E] to buy",300,300-20);
fill(0,0,0);
textSize(15);
text(""+GUN[g].name+"\n"+"Mag-Size:"+GUN[g].ammoMax+"\n" +
"damage:"+GUN[g].damage+"\n"+"noise:"+GUN[g].noise +
"\n"+"Recoil:"+GUN[g].AccA+"\n"+"Accuracy:"+(10-GUN[
g].acc)+ "0 %",500,410);
}
};
//**********************************************************
// Clss pick function
//**********************************************************
var classpick=function(x,y,t){
fill(181,181,181,150);
stroke(0,0,0);
strokeWeight(5);
if(dist(mouseX,mouseY,x,y)<=50){
fill(255,255,255);
textSize(10);
text(Classes[t].name+"\n"+GUN[Classes[t].E1].name+"\n"+GUN[
Classes[t].E2].name,x,y-50);
fill(204,204,204,250);
if(mousePressed){
player_model_E=t;
scene=-2;
stor2.push(new FADE(0,0,3));
}
}
rect(x,y,60,60,5);
playerModel(t,90,x,y);
//resetMatrix();
noStroke();
};
//**********************************************************
// player display
//**********************************************************
var PlayerShow=function(){
// translate(300+CamX,300+CamY);
//rotate1(angle);
//shows the gun
pushMatrix();
translate(600,600);
if(shooting===true){
translate(-303-(PmouseX-width/2)/2,-300-(PmouseY-
height/2)/2);
}
else {
translate(-300-(PmouseX-width/2)/2,-300-(PmouseY-
height/2)/2);
}
if(IsReloading===true){
rotate1(angle+12);
translate(0,5);
}
else {
rotate1(angle);
}
GUN[GUNE].show();
strokeWeight(8);
if(Game_mode===3){
noFill();
for(var i=0;i<6;i++){
stroke(0,0,0,i*55);
arc(0,0,100+i*15,100+i*15,0*(PI/180),180*(PI/180));
line(50+i*7.5,-5,150+i*7.5,-800);
line(-50-i*7.5,-5,-150-i*7.5,-800);
}
strokeWeight(500);
stroke(0, 0, 0);
line(-340,0,-420,-800);
line(340,0,420,-800);
arc(0,0,680,680,0*(PI/180),180*(PI/180));
}
//resetMatrix();
popMatrix();
pushMatrix();
playerModel(player_model_E,angle,0.01,01);
popMatrix();
pushMatrix();
translate(mouseX,mouseY);
rotate1(angle);
//MAP BORDER CODE
if(PX>MAP_W){
PX=MAP_W;
}
if(PX<0){
PX=0;
}
if(PY>MAP_H){
PY=MAP_H;
}
if(PY<0){
PY=0;
}
fill(255,250,250);
stroke(sightColor2);
strokeWeight(3);
line(1.5+BAcc*6+8,0,1.5+BAcc*6,0);
line(-1.5-BAcc*6-8,0,-1.5-BAcc*6,0);
line(0,+1.5+BAcc*6,0,+1.5+BAcc*6+8);
fill(143,29,29);
stroke(sightColor);
strokeWeight(2);
line(1.5+BAcc*6+8,0,1.5+BAcc*6,0);
line(-1.5-BAcc*6-8,0,-1.5-BAcc*6,0);
line(0,+1.5+BAcc*6,0,+1.5+BAcc*6+8);
//line(0,0,0,6);
noFill();
strokeWeight(3);
stroke(sightColor2);
ellipse(0,0,6,6);
strokeWeight(2);
stroke(sightColor);
ellipse(0,0,6,6);
noStroke();
popMatrix();
noFill();
if(Php<30){
strokeWeight(30);
//for (var i=0; i<6; i++){
// stroke(255,0,0,5+i*35);
// ellipse(300,300,560+i*60,560+i*60);
//}
fill(255, 0, 0,20+ 1* (frameCount/2 % 20));
rect(300,300,600,600);
noStroke();
}
};
//**********************************************************
// HUD displaye
//**********************************************************
var HUDShow=function(){
if(DiedHow!==""){
fill(255, 0, 0,20+ 1* (frameCount/2 % 20));
rect(300,300,600,600);
}
rectMode(CENTER);
textSize(10);
fill(148,148,148,200);
rect(490,20,200,15,0);
rect(490,45,200,15,0);
rect(490,65,200,6,0);
rect(280,20,200,20,0);
rect(280,45,200,15,0);
rect(280,65,200,6,0);
fill(148,148,148);
if(itemE===0){
fill(186,186,186);
}
else {
fill(148,148,148,200);
}
rect(35,40,50,60);
if(itemE===1){
fill(186,186,186);
}
else {
fill(148,148,148,200);
}
rect(90,40,50,60);
fill(148,148,148,200);
rect(145,40,50,60);
rectMode(CORNER);
fill(207, 199, 207,200);
rect(120,10,50,(PowerTimer/PowerDelay)*60);
rectMode(CENTER);
textSize(20);
fill(0,0,0);
text(PowerCount,145,40);
textSize(10);
fill(0,0,0);
text("1",55,20);
text("2",110,20);
pushMatrix();
translate(35,50);
GUN[GUNU[0]].show();
popMatrix();
playerModel(player_model_E,0,35,50);
pushMatrix();
translate(90,50);
GUN[GUNU[1]].show();
popMatrix();
playerModel(player_model_E,0,90,50);
//rect(280,45,200,40);
textSize(10);
rectMode(LEFT);
fill(255,0,0,200);
rect(390,35,(Php/PhpMax)* 200,20,0);
//180
fill(66,66,66,100);
rect(390,35,(Parmor/ParmorMax)* 200,20,0);
fill(0,0,0);
fill(43,255,0,200);
rect(390,10,(PS/PSmax)* 200,20,0);
fill(0,247,255,200);
rect(390,60,(floor(Pnoise-45)/ 3)* 1.095,10,0);
fill(255,204,0,200);
rect(180,35,((ammo/ammoMax)* 200),20,0);
fill(179,179,179);
rect(180,60,round((ReloadTimer/Reload)* 100)* 2,10,0);
fill(0,0,0);
textAlign(LEFT,CENTER);
//text(" "+GUN[GUNE].name+" - "+AmmoBANK[GUN[GUNE].AT] +
// "",165,20);
textSize(14);
text(""+GUN[GUNE].name+"",185,22);
fill(232, 229, 232);
text(""+GUN[GUNE].name+"",185,20);
fill(0,0,0);
textAlign(RIGHT,CENTER);
fill(0,0,0);
text(money+" $",375,22);
fill(232, 229, 232);
text(money+" $",375,20);
textAlign(CENTER,CENTER);
fill(0,0,0);
textSize(10);
text(round(Php)+ "/"+round(PhpMax),490,46);
textSize(9);
text(round(Parmor)+ "/"+round(ParmorMax),550,51);
textSize(10);
text(round(PS)+ "/"+round(PSmax),490,21);
noFill();
stroke(0,0,0,40);
strokeWeight(1);
var AMX=(200/ammoMax);
for (var i=0; i <=ammoMax; i++){
line(180+(AMX* i),35,180+(AMX* i),54);
}
if(ammo <=0){
fill(0,0,0);
text("PRESS R TO RELOAD",280,46);
fill(255,10,10);
text("PRESS R TO RELOAD",280,45);
}
noStroke();
rectMode(CENTER);
fill(5, 5, 5);
textSize(15);
text("press 'q' to open shop",300,552);
fill(255, 255, 255);
text("press 'q' to open shop",300,550);
text("wave - "+wave,300,570);
textSize(10);
text("FPS-"+FPSCountT+" | "+"zombies-"+ZOldX.length+" | " +
"bullets-"+BOldX.length+" | "+"Effects-"+stor.length +
" | "+""+" spawn timer-"+zombiespawnT,300,590);
};
//**********************************************************
// controls
//**********************************************************
var Controls=function(){
if(keys[16]&&PS >=0.5){
Pspeed=5.45;
PS-=0.8;
Pnoise+=2.1;
}
else {
if(PS <=1.5){
Pspeed=4;
PS+=0.005;
}
else {
Pspeed=4;
PS+=PSmax/250;
}
}
PS=constrain(PS,0,PSmax);
if(keys[87]||keys[UP]){
PY-=Pspeed-GUN[GUNE].Weight;
Pnoise+=1.005;
}
if(keys[83]||keys[DOWN]){
PY+=Pspeed-GUN[GUNE].Weight;
Pnoise+=1.005;
}
if(keys[65]||keys[LEFT]){
PX-=Pspeed-GUN[GUNE].Weight;
Pnoise+=1.005;
}
if(keys[68]||keys[RIGHT]){
PX+=Pspeed-GUN[GUNE].Weight;
Pnoise+=1.005;
}
AtkTimer-=1;
if(keys[82]){
IsReloading=true;
}
if(mouseButton===RIGHT&&mousePressed){
IsReloading=true;
}
if(keys[49]){
if(HaveSound){playSound(getSound("rpg/battle-swing"));}
GUNE=GUNU[0];
gunchange();
itemE=0;
}
if(keys[50]){
if(HaveSound){playSound(getSound("rpg/battle-swing"));}
GUNE=GUNU[1];
gunchange();
itemE=1;
}
if(keys[86]&&AtkTimer <=0){
if(HaveSound){playSound(getSound("rpg/battle-swing"));}
MAtk();
GUNE=GUNU[2];
gunchange();
itemE=2;
}
if(keyTyped&&keys[70]){
if(PowerTimer>=PowerDelay){
//Grenade 1
if(PowerEquip===0&&PowerCount>0){
GUNE=GUNU[2];
gunchange();
itemE=2;
MAtk();
stor.push(new Gnad(new PVector(PX,PY)));
PowerCount-=1;
PowerTimer=0;
}
//Adrine 1
if(PowerEquip===1&&PowerCount>0){
stor2.push(new Adrine());
PowerCount-=1;
PowerTimer=0;
}
if(PowerEquip===2&&PowerCount>0){
GUNE=GUNU[2];
gunchange();
itemE=2;
MAtk();
stor.push(new AirStk(new PVector(PX,PY)));
PowerCount-=1;
PowerTimer=0;
}
}
}
PowerTimer++;
PowerTimer=constrain(PowerTimer,0,PowerDelay);
};
//**********************************************************
// crates
//**********************************************************
var BOXitem=function(position){
this.position=position.get();
this.LiveT=1.0;
this.rot=random(0,360);
BOXitem.prototype.run=function(){
pushMatrix();
translate(this.position.x,this.position.y);
rotate1(this.rot);
fill(204,173,47);
rect(0,0,20,20);
fill(214, 188, 83);
rect(0,0,14,14);
fill(191, 172, 97);
rect(-3,0,2,14);
rect(2,0,2,14);
popMatrix();
if(dist(this.position.x,this.position.y,PX+ArotX,PY+ArotY)<=45&&Atking===true){
this.LiveT=-1;
}
for (var i=0; i<BOldX.length; i++){
if(dist(BOldX[i],BOldY[i],this.position.x,this.position.y)<
25){
Bkill(i);
this.LiveT=-1;
if(HaveSound){playSound(getSound("rpg/hit-thud"));}
}
}
};
BOXitem.prototype.isDead=function(){
if(this.LiveT<0){
for (var j=0; j <=5; j++){
stor.push(new Cratespt(new PVector(this.position.x+random(-
20,20),this.position.y+random(-20,20))));
Additem(this.position.x+random(-20,20),this.position.y +
random(-20,20));
stor.push(new ITEM(new PVector(this.position.x+random(-20,
20),this.position.y+random(-20,20)),1));
}
return true;
}
else {
return false;
}
};
};
//**********************************************************
// gas tank
//**********************************************************
var boomBOX=function(position){
this.position=position.get();
this.LiveT=1.0;
this.rot=random(0,360);
boomBOX.prototype.run=function(){
pushMatrix();
translate(this.position.x,this.position.y);
rotate1(this.rot);
fill(184,11,11);
rect(0,0,20,30);
fill(122, 46, 46);
rect(0,-9,22,3);
rect(0,9,22,3);
fill(230, 114, 25);
triangle(-6,6,6,6,0,-8);
fill(255, 239, 8);
triangle(-3,3,3,3,0,-3);
popMatrix();
for (var i=0; i<BOldX.length; i++){
if(dist(BOldX[i],BOldY[i],this.position.x,this.position.y)<
20){
Bkill(i);
this.LiveT=-1;
stor.push(new BOOM(new PVector(this.position.x,this.position
.y)));
if(HaveSound){ playSound(getSound("retro/rumble"));}
Pnoise+=150;
shake+=2;
i+=1000;
}
}
};
boomBOX.prototype.isDead=function(){
if(this.LiveT<0){
for (var j=0; j<ZOldX.length; j++){
if(dist(ZOldX[j],ZOldY[j],this.position.x,this.position.y)<
100){
Zhp[j]-=150-dist(ZOldX[j],ZOldY[j],this.position.x,
this.position.y);
for (var w=0; w <=splat_Spawn*4; w++){
stor.push(new spt(new PVector(ZOldX[j]+random(-20,20),
ZOldY[j]+random(-20,20))));
}
}
}
return true;
}
else {
return false;
}
};
};
//**********************************************************
// barrier
//**********************************************************
var barrier=function(x,y,w,h,color1,color2,color3){
fill(color1,color2,color3);
pushMatrix();
translate(w/2-10,h/2-10);
rect(x,y,w,h);
popMatrix();
if(PX+20>x&&PX<x+w&&PY+20>y&&PY<y+h){
if(PY+20>y&&PY+20<y+5){
PY=y-20;
}
if(PY<y+h&&PY>y+h-5){
PY=y+h;
}
if(PY+18>y&&PY<y+(h/20)* 18){
if(PX+20>x&&PX+20<x+5){
PX=x-20;
}
if(PX<x+w&&PX>x+w-5){
PX=x+w;
}
}
}
};
var barbwire=function(x,y){
fill(255,255,255,0);
stroke(200);
strokeWeight(3);
ellipse(x,y,20,20);
line(x,y-10,x,y-13);
line(x+10,y,x+13,y);
line(x,y+10,x,y+13);
line(x-10,y,x-13,y);
line(x-8,y-8,x-10,y-10);
line(x+8,y+8,x+10,y+10);
line(x-8,y+8,x-10,y+10);
line(x+8,y-8,x+10,y-10);
};
//**********************************************************
// load game
//**********************************************************
var loadgame=function(){
background(189,189,189);
stor=[];
wave=0;
GUNUU=[
Classes[player_model_E].E1,
Classes[player_model_E].E2,
27
];
ammo=GUN[GUNE].ammoMax; // gun ammo
GUNE=Classes[player_model_E].E1;
gunchange();
AmmoBANK=[
50000,//500 mec gun
10000,//480 pistol
10000,//100 sniper
12000,//120 shot gun
12000,//1200 rifle
10000,//2000 smg
];
PX=MAP_W/2;
PY=MAP_H/2;
pause=false;
GUNU=GUNUU;
PowerCount=0;
money=parseInt("a", 34)-10;
Php=PhpMax;
Parmor=0;
gameTime=0;
Zkills=0;
shotFired=0;
shake=0;
zombiespawnT=0;
ZT=[];
ZNewX=[];
ZNewY=[];
ZOldX=[];
ZOldY=[];
ZRot=[];
ZHeading=[];
Zhp=[];
ZHeadingTemp=[];
ZSpeed=[];
ZSpeedMAX=[];
ZSpeedAtktimer=[];
damageMULTbase=1;
stor2.push(new popText(new PVector(550, 550)));
stor.push(new BOXitem(new PVector(random(20,MAP_W-20),random(20,
MAP_H-20))));
stor.push(new BOXitem(new PVector(random(20,MAP_W-20),random(20,
MAP_H-20))));
stor.push(new BOXitem(new PVector(random(20,MAP_W-20),random(20,
MAP_H-20))));
stor.push(new BOXitem(new PVector(random(20,MAP_W-20),random(20,
MAP_H-20))));
frameRate(60);
};
//**********************************************************
// wave MEC
//**********************************************************
var randomZombieSpawn=0;
var waveMEC=function(){
if(zombiespawnT >=waveTimer&&ZT.length <=Zombie_Spawn_thes){
zombiespawnT=0;
wave+=1;
stor2.push(new ParticleTxt2(new PVector(300,500),"WAVE-"+wave));
randomZombieSpawn=floor(random(0,6));
AddZombie(7,4,0,0);
if(randomZombieSpawn===1){
AddZombie(7,3,0,0);
}
if(randomZombieSpawn <=3){
AddZombie(0,6,0,0);
}
if(randomZombieSpawn===3&&wave>10){
AddZombie(9,3,0,0);
}
if(randomZombieSpawn >=4&&wave>16){
AddZombie(0,3,0,0);
AddZombie(2,2,0,0);
AddZombie(1,1,0,0);
}
if(randomZombieSpawn===3&&wave>10){
AddZombie(1,3,0,0);
}
if(randomZombieSpawn===2&&wave>5){
AddZombie(5,3,0,0);
}
if(randomZombieSpawn===4){
AddZombie(1,3,0,0);
// AddZombie(8,3,0,0);
}
if(randomZombieSpawn===4&&wave>8){
AddZombie(8,2,0,0);
}
if(randomZombieSpawn===5&&wave>5){
AddZombie(4,3,0,0);
}
if(wave===15){
AddZombie(2,4,0,0);
zombiespawnT=-2000;
}
if(wave===30){
AddZombie(6,1,0,0);
AddZombie(0,6,0,0);
zombiespawnT=-5000;
}
stor.push(new BOXitem(new PVector(random(20,MAP_W-20),random(20,
MAP_H-20))));
stor.push(new BOXitem(new PVector(random(20,MAP_W-20),random(20,
MAP_H-20))));
stor.push(new boomBOX(new PVector(random(20,MAP_W-20),random(20,
MAP_H-20))));
}
zombiespawnT+=waveSpeed;
};
//**********************************************************
// background display
//**********************************************************
var LOGOROT=0;
var Logo=function(){
this.LOGOTIMER=0;
this.LOGOx=0;
this.LOGOt=0;
this.LOGOs=0;
};
Logo.prototype.draw=function(){
//background(255,255,255);
// pushMatrix();
if(this.LOGOTIMER <=400){
this.LOGOx+=3.7;
}
if(this.LOGOTIMER>400&&this.LOGOTIMER <=500){
this.LOGOx-=3.7;
this.LOGOt+=1.5;
}
if(this.LOGOTIMER >=800&&this.LOGOTIMER <=900){
this.LOGOt-=1.5;
this.LOGOx+=3.7;
}
if(this.LOGOTIMER >=965&&this.LOGOTIMER <=1265){
this.LOGOs+=9;
}
if(this.LOGOTIMER>1385&&this.LOGOTIMER<1395){
scene=8;
}
if(this.LOGOTIMER>1385){
this.LOGOs-=10;
}
//textFont(createFont("Arial Bold"));
fill(0,0,0);
ellipse(-200+this.LOGOx,300,20+this.LOGOs,20+this.LOGOs);
ellipse(800-this.LOGOx,300,20+this.LOGOs,20+this.LOGOs);
textSize(this.LOGOt);
textAlign(CENTER,CENTER);
text("TAZAL",300,300);
this.LOGOTIMER+=3;
};
var logo=new Logo();
var BASEBCOLOR=color(66, 34, 5); //255,89,0
var BackG2=function(){
background(30,59,50);
noStroke();
for (var i=0; i<18; i++){
fill(55,120,102,i*30);
rect(300,340-i*20,600,20);
}
rectMode(CENTER);
fill(89,57,37);
ellipse(300,350,200,50);
fill(89,57,37);
fill(77,41,18);
ellipse(210,350,200,50);
ellipse(90,350,200,50);
ellipse(570,350,200,50);
fill(99,44,8);
rect(300,500,600,300);
for (var i=0; i<13; i++){
rect(300,360+i*20,600,20);
}
fill(133,129,129);
ellipse(50,500,80,50);
noStroke();
//translate(-100,-100);
pushMatrix();
translate(100,400);
rotate1(20);
scale(0.4,0);
strokeWeight(15);
stroke(0,0,0);
line(0,0,30,350);
strokeWeight(10);
fill(255,89,0);
stroke(0,0,0);
triangle(0,-170,-160,80,160,80);
noStroke();
fill(0,0,0);
ellipse(200-200,155-200,100,100);
ellipse(160-200,220-200,100,100);
ellipse(240-200,220-200,100,100);
fill(255,89,0);
ellipse(200-200,136-200,75,75);
ellipse(145-200,230-200,75,75);
ellipse(255-200,230-200,75,75);
ellipse(200-200,200-200,20,20);
stroke(0,0,0);
strokeWeight(10);
noFill();
ellipse(200-200,200-200,95,95);
stroke(255,89,0);
strokeWeight(6);
ellipse(200-200,140-200,70,70);
ellipse(145-200,230-200,70,70);
ellipse(255-200,230-200,70,70);
line(200-200,200-200,200-200,170-200);
line(200-200,200-200,180-200,210-200);
line(200-200,200-200,220-200,210-200);
popMatrix();
noStroke();
fill(145,143,143);
ellipse(80,510,80,40);
fill(163,157,157);
ellipse(60,530,80,40);
fill(36,36,36);
quad(100,600,500,600,470,350,400,350);
stroke(143,137,24);
line(270,600,430,355);
line(290,600,433,355);
};
var BackG=function(X,Y){
//(255,89,0);
background(BASEBCOLOR);
noStroke();
if(scene===-1){
fill(0,0,0);
rect(300,10,610,200);
textSize(50);
//text("BIOLOGICAL HAZARD",300,500);
textSize(25);
//text("HAZMAT SUITS REQUIRED.",300,540);
fill(BASEBCOLOR);
textFont(createFont("Arial Bold"),20);
textSize(100);
text("CONTAMINATION\nBREACH-4.0",300,55);
Nlogo();
}
else {
LOGOROT=30;
}
pushMatrix();
textSize(40);
translate(X,Y);
rotate1(LOGOROT);
if(scene===-1){
scale(1.8,0);
}
if(scene !==-1){
scale(3,0);
}
fill(97, 70, 21);
ellipse(200-200,155-200,100,100);
ellipse(160-200,220-200,100,100);
ellipse(240-200,220-200,100,100);
fill(BASEBCOLOR);
ellipse(200-200,136-200,75,75);
ellipse(145-200,230-200,75,75);
ellipse(255-200,230-200,75,75);
ellipse(200-200,200-200,20,20);
stroke(97, 70, 21);
strokeWeight(10);
noFill();
ellipse(200-200,200-200,95,95);
stroke(BASEBCOLOR);
strokeWeight(6);
ellipse(200-200,140-200,70,70);
ellipse(145-200,230-200,70,70);
ellipse(255-200,230-200,70,70);
line(200-200,200-200,200-200,170-200);
line(200-200,200-200,180-200,210-200);
line(200-200,200-200,220-200,210-200);
popMatrix();
};
//**********************************************************
// display
//**********************************************************
var img;
Gems = parseInt(GSAVE.s, 34);
var upgradeNUM = GSAVE.upG;
var TUnlock = parseInt(GSAVE.wave,8);
var Cintsback = [];
var Cnum =GSAVE.gunG;
var Chexarr = Cnum.split(";");
for(var i = 0; i < Chexarr.length-1; i++) {
Cintsback.push(parseInt(Chexarr[i], 33));
}
var Cendstr = [];
for(var i=0;i<Cintsback.length;i++){
Cendstr[i]=Cintsback[i]%10;
Cendstr[i]=round(Cendstr[i]/(Cendstr[i]+1));
}
var GunGOT= Cendstr;
//var upgradeNUM=[SAVE[0],SAVE[1],SAVE[2],SAVE[3],SAVE[4],SAVE[5]];
//var TUnlock=SAVE[6];
var ParmorMax=50+GSAVE.upG[5]*15;
//for (var i=0; i<GunGOT.length; i++){
// GunGOT[i]=SAVE[i+8];
// if(SAVE[i+8]===1){
// GunSGOTE+=1;
// }
//}
//GunSGOT=GunSGOTE;
//if(SAVE[33]*SAVE[7] !==GunSGOTE){
//scene=-111;
//}
var shopscene=0;
draw=function(){
if(keys[79]){
var Cints = [];
var CAstr = GunGOT;
for(var i=0;i<CAstr.length;i++){
if(CAstr[i]===0){Cints[i]=round(random(2,8))*10;}
if(CAstr[i]===1){Cints[i]=1+round(random(1,8))*11;}
}
var Chexstr = "";
var Chexstr2= "";
for(var i=0; i < Cints.length; i++) {
Chexstr += Cints[i].toString(33) + ";";
}
for(var i=0; i < upgradeNUM.length; i++) {
Chexstr2 += upgradeNUM[i].toString(33) + ";";
}
println("gunG:'"+Chexstr+"',\nwave:"+TUnlock.toString(8)+",\nupG:["+upgradeNUM+"],\ns:'"+Gems.toString(34)+"'");
}
textAlign(CENTER,CENTER);
rectMode(CENTER);
textFont(createFont("Arial Bold"),20);
cursor();
//**********************************************************
// menu and scene display and code
//**********************************************************
if(scene===-111){
background(255,0,0);
fill(242,225,225);
textSize(55);
text("SAVE CODE ENTERED\nCLICK RESTART",300,300);
}
if(scene===-201){
background(255,255,255);
//logo.draw();
scene=8;
}
if(scene===-11){
AREA_MAP=4;
scene=-3;
}
if(scene===-10){
AREA_MAP=3;
scene=-3;
}
if(scene===-5.2){
BackG2();
button(60,40,100,50,"BACK",25,-6);
textSize(60);
fill(0, 0, 0);
text("CHOOSE MAP SIZE\n",300,164);
fill(242,225,225);
text("CHOOSE MAP SIZE\n",300,160);
textSize(15);
fill(0, 0, 0);
// text("CHOOSE MAP SIZE\n",300,164);
fill(242,225,225);
text("NOTE: normal mode is\n highly recommended",300,180);
button(300,400,500,50,"TINY",35,-5.3);
button(300,450,500,50,"SMALL",35,-5.4);
button(300,300,500,150,"NORMAL",55,-5.5);
button(300,500,500,50,"BIG",35,-5.6);
button(300,550,500,50,"MASSIVE",35,-5.7);
}
if(scene===-5.3){MAP_W=400;MAP_H=400;scene=-5;}
if(scene===-5.4){MAP_W=600;MAP_H=600;scene=-5;}
if(scene===-5.5){MAP_W=800;MAP_H=800;scene=-5;}
if(scene===-5.6){MAP_W=1000;MAP_H=1000;scene=-5;}
if(scene===-5.7){MAP_W=1400;MAP_H=1400;scene=-5;}
if(scene===-5){
Zombie_di_mult=1.2;
Zombie_Spawn_thes=5;
waveSpeed=1;
Game_mode=1;
scene=-2;
AREA_MAP=0;
player_model_E=0;
}
if(scene===-4){
Zombie_di_mult=1.2;
Zombie_Spawn_thes=5;
waveSpeed=1;
Game_mode=2;
scene=-7;
}
if(scene===-8){
AREA_MAP=1;
scene=-3;
}
if(scene===-9){
AREA_MAP=2;
scene=-3;
}
if(scene===10){
Zombie_di_mult=5;
Zombie_Spawn_thes=10;
waveSpeed=5;
scene=-2;
AREA_MAP=2;
player_model_E=0;
Game_mode=3;
}
if(scene===-27){
FIX_SHOP_BUG=false;
splat_Spawn=10;
Max_effects=600;
itemLife=13000;
scene=-1;
}
if(scene===-26){
FIX_SHOP_BUG=true;
splat_Spawn=1;
Max_effects=150;
itemLife=7000;
scene=-1;
}
if(scene===-25){
splat_Spawn=0;
Max_effects=0;
scene=-1;
}
if(scene===8.1){}
if(scene===8){
background(112,110,112);
textSize(75);
fill(255,255,255);
text("LAUNCH GAME\n",300,100);
button(300,165,500,60,
"NONVIOLENT MODE\nless violent (no splat marks)",25,-25);
button(300,265,500,60,"LAG FREE MODE\nless lag",25,-26);
button(300,355,500,60,"GRAPHICS\nthe best looking version",25,-
27);
button(300,455,500,100,"NORMAL",40,-1);
if(width!==600||height!==600){
background(255, 255, 255);
fill(5, 5, 5);
text("wrong size canvas\nset to 600x600 to play",width/2,height/2);
}
}
if(scene===-7){
BackG2();
button(60,40,100,50,"BACK",25,0);
button(440,555,250,40,"Mission: Road",25,-8);
button(155,555,250,40,"Mission: E-vac",25,-9);
button(440,505,250,40,"Mission: House *",25,-10);
button(155,505,250,40,"Mission: River *",25,-11);
fill(242,225,225);
textSize(25);
//text("Mission mode is a WIP\n but it is still playable",300,100);
textSize(15);
text("missions with* were made by aidan01pay",300,470);
fill(0,0,0);
textSize(85);
text("CHOOSE\nMISSION\n",300,304);
fill(242,225,225);
textSize(85);
text("CHOOSE\nMISSION\n",300,300);
}
if(scene===-6){
BackG2();
button(300,175,500,150,"MISSION MODE\nmore maps & class unlockes",
35,-4);
button(300,325,500,150,"NORMAL MODE\nthe basic game",35,-5.2);
button(300,475,500,150,
"NIGHTMARE MODE\nfast waves & harder zombies",35,10);
button(60,40,100,50,"BACK",25,0);
textSize(20);
//showHint
text("HINT: \n"+hints[showHint],300,50);
// text("SAVING ADDED\n press 'o' to get save codes",300,555);
//if(TUnlock>=25){
//button(540,40,100,50,"NIGHTMARE\nMODE",15,10);
//}
}
if(scene===-3){
BackG2();
button(60,40,100,50,"BACK",25,0);
pushMatrix();
classpick(200,100,1);
classpick(300,100,2);
classpick(400,100,3);
if(TUnlock >=10){
classpick(200,200,4);
classpick(300,200,5);
classpick(400,200,6);
}
else {
stroke(0,0,0);
strokeWeight(5);
fill(110,110,110,150);
rect(300,200,250,50,5);
fill(255,252,255);
textSize(15);
text("get past wave 10 to unlock\ntier 2 classes",300,200);
}
if(TUnlock >=15){
classpick(200,300,7);
classpick(300,300,8);
classpick(400,300,9);
}
else {
fill(110,110,110,150);
rect(300,300,250,50);
fill(255,252,255);
textSize(15);
text("get past wave 15 to unlock\ntier 3 classes",300,300);
}
if(TUnlock >=25){
classpick(200,400,10);
classpick(300,400,11);
classpick(400,400,12);
}
else {
fill(110,110,110,150);
rect(300,400,250,50);
fill(255,252,255);
textSize(15);
text("get past wave 25 to unlock\ntier 4 classes",300,400);
}
if(TUnlock >=30){
classpick(50,150,13);
}
popMatrix();
fill(0,0,0);
textSize(45);
text("CHOOSE YOUR CLASS\n highest wave-"+TUnlock,300,505);
fill(242,225,225);
textSize(45);
text("CHOOSE YOUR CLASS\n highest wave-"+TUnlock,300,500);
}
if(scene===-2){
forcePause=false;
loadgame();
scene=1;
}
else if(scene===-1){
BackG2();
button(300,575,250,40,"START-GAME",25,0);
fill(3,3,3);
fill(3,3,3);
textSize(70);
text("CONTAMINATION\nBREACH IV\n ",300,205);
fill(242,225,225);
textSize(70);
text("CONTAMINATION\nBREACH IV\n",300,200);
fill(3,3,3);
Nlogo();
}
else if(scene===0){
BackG2();
fill(3,3,3);
textSize(60);
text("CONTAMINATION \nBREACH IV",300,105);
fill(242,225,225);
textSize(60);
text("CONTAMINATION \nBREACH IV",300,100);
button(300,440,250,50,"PLAY-GAME",35,-6);
button(300,260,250,50,"HOW-TO",35,2);
button(300,320,250,50,"WEAPONS",35,3);
button(235,380,120,50,"credits",25,4);
button(365,380,120,50,"updates",25,5);
fill(242,225,225);
textSize(20);
// text("CONTAMINATION \nBREACH BUILD 3.0",300,580);
showHint=floor(random(0,hints.length));
Nlogo();
}else
if(scene===2){
BackG2();
button(60,40,100,50,"BACK",25,0);
button(200,200,200,50,"Movement",25,2.1);
button(400,200,200,50,"Using Weapons",25,2.2);
button(200,250,200,50,"Weapon Types",25,2.3);
button(400,250,200,50,"Weapons abilities ",22,2.4);
button(200,300,200,50,"Zombies",25,2.5);
button(400,300,200,50,"melee/powerup",25,2.6);
button(200,350,200,50,"Health Sprint etc",25,2.7);
button(400,350,200,50,"Money and Gems",22,2.8);
button(200,400,200,50,"Upgrades",25,2.9);
button(400,400,200,50,"Waves",25,2.91);
textAlign(CENTER,CENTER);
fill(255,255,255);
textSize(20);
textAlign(CENTER,CENTER);
}
if(scene===2.1){
BackG2();
button(60,40,100,50,"BACK",25,2);
text("WASD to move \n[SHIFT] + WASD to sprint ",300,300);
}
if(scene===2.2){
BackG2();
button(60,40,100,50,"BACK",25,2);
text("Use your mouse to aim\nLeft click or [SPACE] to fire\nRight click or [R] to reload\nPress [1] or [2] to swap weapons ",300,300);
}
if(scene===2.3){
BackG2();
button(60,40,100,50,"BACK",25,2);
textSize(15);
text("SMGS : Lightweight, with high ammo capacity and fast rate of fire, but low damage \nMEC GUN : Heavy, huge ammo capacity, super fast rate of fire, tons of damage\nPISTOLS : Super lightweight with low ammo capacity, rate of fire, and damage \nSHOTGUNS : Medium weight, low ammo capacity\n and rate of fire, but shoots multiple bullets\nSNIPERS : Heavy, tiny ammo capacity, super low rate of fire, tons of damage\nRIFLES : Medium weight, medium ammo capacity, high rate of fire ,good damage",300,300);
}
if(scene===2.4){
BackG2();
button(60,40,100,50,"BACK",25,2);
textSize(20);
text("Mag-Size : how much ammo the gun can hold\nReload Speed : how fast you can reload the gun\nDamage : how much damage the gun deals to zombies\nAccuracy : chance of bullet being on target \nFire Rate : how fast the gun fires\nFire mode : SIMI - click to fire , AUTO hold to fire\nWeight : how much your player is slowed",300,300);
}
if(scene===2.5){
BackG2();
button(60,40,100,50,"BACK",25,2);
text("",300,300);
}
if(scene===2.6){
BackG2();
button(60,40,100,50,"BACK",25,2);
text("Press [V] to use your melee attack\nMelee attacks are a short range attack \nPress [F] to use your power up\nPower ups first need to be bought in the shop",300,300);
}
if(scene===2.7){
BackG2();
button(60,40,100,50,"BACK",25,2);
text("",300,300);
}
if(scene===2.8){
BackG2();
button(60,40,100,50,"BACK",25,2);
textSize(15);
text("Money is obtained by killing zombies or destroying crates.\nMoney can be used to buy upgrades or new weapons\nIf you die you will lose your money but not your upgrades\n\nGems are like money but rarer \nGems can be used to buy super power weapons and power ups\nYou will not lose gems when you die",300,300);
}
if(scene===2.9){
BackG2();
button(60,40,100,50,"BACK",25,2);
text("Upgrades can be used to\n improve your players stats, health, damage, etc\nDon’t worry you won’t lose your upgrades\n when you die",300,300);
}
if(scene===2.91){
BackG2();
button(60,40,100,50,"BACK",25,2);
text("",300,300);
}
if(scene===3){
BackG2();
fill(217,217,217,100);
rect(300,300,610,610);
button(60,40,100,50,"BACK",25,0);
fill(255,255,255);
for (var g=1; g <=24; g++){
if(mouseX>50&&mouseX<200&&mouseY>(100+g*20)- 10 &&
mouseY<(100+g*20)+ 10){
textSize(30);
textAlign(LEFT);
fill(255,255,255);
text(GUN[g].name,210,130);
text("Mag-Size: "+GUN[g].ammoMax,210,160);
text("Damage: "+GUN[g].damage+"x"+GUN[g].BPS,210,190);
text("Accuracy:"+(10-GUN[g].acc)+ "0%",210,220);
text("Recoil: "+GUN[g].AccA+"0%",210,250);
text("Fire Rate: "+round(1000/GUN[g].delay)+ " RPM",210,
280);
text("Movement: -"+(GUN[g].Weight/4)* 100+"%",210,310);
text("noise: "+GUN[g].noise,210,340);
text("Reload speed: "+String(GUN[g].reload/60).substring(0,
3)+ "sec",210,370);
pushMatrix();
translate(350,430);
scale(3.7,3.7);
rotate1(90);
GUN[g].show();
fill(255,255,255);
ellipse(0,0,20,20);
fill(0,0,0);
rect(-3,-5,2,6);
rect(3,-5,2,6);
// playerModel(player_model_E,90,350,400);
popMatrix();
fill(245,242,245,200);
rect(100,100+g*20,200,20);
textAlign(CENTER,CENTER);
}
else {
// fill(217,217,217,100);
noFill();
}
textSize(20);
stroke(77,77,77);
strokeWeight(2);
noStroke();
fill(255,252,255);
text(GUN[g].name,100,100+g*20);
noStroke();
}
}
else if(scene===4){
BackG2();
button(60,40,100,50,"BACK",25,0);
textAlign(CENTER,CENTER);
fill(0,0,0);
text(
"game by Tazal\n\naidan01pay - missions river and house\n\npanther programming - delagging function\n\n codehunterX - bug testing and suggestions ",
300,303);
fill(255,255,255);
text(
"game by Tazal\n\naidan01pay - missions river and house\n\npanther programming - delagging function\n\n codehunterX - bug testing and suggestions ",
300,300);
Nlogo();
textAlign(CENTER,CENTER);
} //credits
if(scene===5){
BackG2();
button(60,40,100,50,"BACK",25,0);
textSize(12);
textAlign(LEFT);
text(
"\nv2.02-add shot guns and gas tanks \nv2.03-Lag and bug fixes \nv2.04-add more zombie types\nv2.05-cleaned up some of the code+bug fixes\nv2.06-more lag fixes\nv2.07-fixed menu bug\nv2.08-HUGE LAG FIX\nv2.09-change play damage mult\nv2.10-added shop and menu basics\nv2.11-finish shop\nv2.12-changed wave mec\nv2.13-added player classes\nv2.14-bug fixes\nv2.15-added backgrounds for the world\nv2.16-add game modes v2.17-2x ammo bank size\nv2.18-bug fixes \nv2.19-add new missions by aidan01pay\nv2.2 -bug fixes \nv2.21-more bug fixes\nv2.21-Cleaned the code\nv2.22-working on saving\nv2.23-add launch settings\nv2.24-ADDED SAVING \nv2.25-fixed saving \nv2.26-made it harder to cheat\nv2.27-fixed saving \nv2.28-bug fixesv2.29-bug fixes\nv2.3 -added new zombies,right click to reload\nv2.4 -nurfs some guns fixs some bugs\nv2.5 -bug fixs\nv2.5+-taking a break for a few months \nv2.6 -a Ton of bug fixes and Optmzaion \nv2.7 -more Optmzaion\nv2.8 -text fixes\nv2.9 -random fixes \nv3.0 -four new guns,armor gems ,scores hints ,more zombies better \ncode way too meny bug fixes better saving this is my finle build for this game",
50,100);
textAlign(CENTER,CENTER);
}
//**********************************************************
// MAIN GAME DISPLAY
//**********************************************************
for (var i=stor2.length-1; i >=0; i--){
var p=stor2[i];
p.run();
if(p.isDead()){
stor2.splice(i,1);
}
}
if(scene===1){
cursor("none");
background(0,0,0);
fill(255,255,255);
PmouseX+=(mouseX-PmouseX)/ 10;
PmouseY+=(mouseY-PmouseY)/ 10;
if(pause===false){
pushMatrix();
//frameRate(60-shake*5);
RTx=random(-1,1)*BAccAdd*3;
RTy=random(-1,1)*BAccAdd*3;
angle=atan3(mouseY-300,mouseX-300)+90;
// println(angle);
CamX=PX+(PmouseX-width/2)/ 2;
CamY=PY+(PmouseY-height/2)/ 2;
gameTime=millis();
if(shooting){
translate((300+RTx)-CamX,(300+RTy)-CamY);
}else{
translate(300-CamX,300-CamY);
}
translate(random(-shake,shake),random(-shake,shake));
//**********************************************************
// MAPS
//**********************************************************
// MAIN MAP
if(AREA_MAP===0){
BackG(MAP_W/2,MAP_H/2);
}
noStroke();
if(AREA_MAP===4){
MAP_W=600;
MAP_H=600;
fill(62,133,17);
rect(300,300,620,620);
fill(102,78,7);
rect(290,300,200,120);
for (var i=210; i<380; i+=20){
fill(0,0,0,50);
rect(i,300,2,120);
fill(0,0,0,50);
rect(290,243,200,5);
rect(290,358,200,5);
}
fill(0,0,255);
rect(290,110,200,61);
fill(120);
ellipse(300,110,20,20);
ellipse(280,98,16,16);
ellipse(240,129,21,21);
ellipse(256,113,14,14);
ellipse(207,105,25,25);
ellipse(324,104,17,17);
ellipse(356,115,13,13);
ellipse(378,127,16,16);
fill(0,0,255);
rect(290,550,200,61);
fill(120);
ellipse(300,550,20,20);
ellipse(280,98+440,16,16);
ellipse(240,129+440,21,21);
ellipse(256,113+440,14,14);
ellipse(207,105+440,25,25);
ellipse(324,104+440,17,17);
ellipse(356,115+440,13,13);
ellipse(378,127+440,16,16);
fill(6,117,21);
ellipse(520,70,75,75);
ellipse(500,80,75,75);
ellipse(525,90,75,75);
ellipse(540,65,75,75);
ellipse(520-440,70+440,75,75);
ellipse(500-440,80+440,75,75);
ellipse(525-440,90+440,75,75);
ellipse(540-440,65+440,75,75);
noStroke();
barrier(200,-80,200,180,0,0,255);
barrier(200,150,200,100,0,0,255);
barrier(200,590,200,310,0,0,255);
barrier(200,370,200,170,0,0,255);
}
if(AREA_MAP===3){
MAP_W=600;
MAP_H=600;
fill(62,133,17);
rect(300,300,620,620);
barrier(200,200,200,200,100,100,100);
fill(97,60,5);
rect(290,385,50,10);
fill(0,255,213);
rect(225,385,40,10);
rect(355,385,40,10);
rect(195,280,10,40);
rect(385,280,10,40);
rect(290,195,40,10);
noStroke();
fill(6,117,21);
ellipse(70,70,75,75);
ellipse(520,70,75,75);
ellipse(520,520,75,75);
ellipse(70,520,75,75);
}
if(AREA_MAP===1){
MAP_W=600;
MAP_H=600;
fill(222,211,222);
rect(300,300,620,900);
fill(173,173,173);
rect(300,300,580,900);
fill(54,52,54);
rect(300,300,420,900);
fill(125,125,125);
rect(300,300,20,900);
fill(237,225,0);
rect(180,300,5,900);
rect(190,300,5,900);
rect(420,300,5,900);
rect(430,300,5,900);
fill(199,175,18);
stroke(107,90,5);
strokeWeight(3);
}
if(AREA_MAP===2){
MAP_W=600;
MAP_H=600;
fill(194,194,194);
rect(300,300,410,410);
rect(300,600,100,500);
fill(135,135,135);
rect(300,300,390,390);
rect(300,600,80,500);
fill(241,255,48);
rect(300,300,190,190);
fill(31,31,31);
rect(300,300,170,170);
fill(241,255,48);
rect(330,300,20,120);
rect(270,300,20,120);
rect(300,300,60,20);
fill(153,153,153);
rect(150,150,60,60);
}
noStroke();
// resetMatrix();
// run the effects
for (var U=stor.length-1; U >=0; U--){
var ZP=stor[U];
ZP.run();
if(ZP.isDead()){
stor.splice(U,1);
}
}
Controls();
BulletMATH();
ZombieMATH();
//translate(300-CamX,300-CamY);
noFill();
strokeWeight(11);
for (var i=0; i <=40; i++){
stroke(0,0,0,i*50);
rect(MAP_W/2,MAP_H/2,(MAP_W)+ i*20,(MAP_H)+
i*20);
}
noStroke();
//gun math
GunMATH();
//display player
popMatrix();
PlayerShow();
for (var U=stor2.length-1; U >=0; U--){
var p=stor2[U];
p.run();
if(p.isDead()){
stor2.splice(U,1);
}
}
resetMatrix();
//player noise mec
Pnoise-=0.6;
Pnoise=constrain(Pnoise,50,600);
FPSCount+=1;
if(millis()- FPStimer >=1000){
DiedHow="";
FPStimer=millis();
FPSCountT=FPSCount;
FPSCount=0;
}
shake-=0.01;
shake=constrain(shake,0,3);
waveMEC();
Php+=HpRegen;
Php=constrain(Php,-1,PhpMax);
Parmor=constrain(Parmor,0,ParmorMax);
}
if(Php<0&&pause===false){
img=get(0,0,600,600);
pause=true;
}
if((pause===true&&Php<0)){
background(128,128,128);
BackG();
if(!FIX_SHOP_BUG){
image(img,0,0,600,600);
}
fill(0,0,0);
cursor();
textSize(70);
//contaminated
text("You were\n"+DiedHow,300,154);
textSize(45);
//text("you lasted "+round((gameTime/1000)/60)+" min",300,370);
textSize(35);
text("\nYou shot "+shotFired+" rounds\nand killed "+Zkills +
" Zombies",300,443);
fill(255,252,252);
textSize(70);
text("You were\n"+DiedHow,300,150);
textSize(45);
//text("you lasted "+round((gameTime/1000)/60)+" min",300,370);
textSize(35);
text("\nYou shot "+shotFired+" rounds\nand killed "+Zkills +
" Zombies",300,440);
if(Game_mode===1){
button(200,555,160,50,"RETRY",25,-5);
}
else if(Game_mode===2){
button(200,555,160,50,"RETRY",25,-3);
}else if(Game_mode===3){
button(200,555,160,50,"RETRY",25,10);
}
button(385,555,160,50,"MAIN MENU",25,0);
textSize(15);
}
else if(pause){
cursor();
fill(148,148,148);
rect(300,300,600,600);
fill(219,219,219,50);
if(!FIX_SHOP_BUG){
image(img,0,0,600,600);
}
fill(201,201,201,50);
rect(300,300,610,610);
strokeWeight(5);
stroke(0,0,0);
if(keys[UP]&&Game_mode !==2){
shopscene=1;
}
if(keys[DOWN]){
shopscene=0;
}
if(shopscene===0){
rectMode(CENTER);
button(100,300,50,50,"<",25,-22.2);
button(500,300,50,50,">",25,-22.3);
fill(201,201,201,50);
strokeWeight(5);
stroke(0,0,0);
if(dist(mouseX,mouseY,380,160)<=50){
cursor("pointer");
fill(173,173,173,200);
if(CLICKED&&money>=15+(upgradeNUM[0]*5)){
money-=15+(upgradeNUM[0]*5);
upgradeNUM[0]+=1;
}
}
ellipse(380,160,100,100);
stroke(0,255,9);
arc(380,160,105,105,0*(PI/180),upgradeNUM[0]*5*(PI/180));
stroke(3,3,3);
textSize(15);
fill(15,15,15);
text("Damage \n "+(15+(upgradeNUM[0]*5))+ " $\n +"+(5 +
upgradeNUM[0]*5)+ "%",380,162);
fill(255,255,255);
text("Damage \n "+(15+(upgradeNUM[0]*5))+ " $\n +"+(5 +
upgradeNUM[0]*5)+ "%",380,160);
fill(219,219,219,50);
if(dist(mouseX,mouseY,380,280)<=50){
fill(173,173,173,200);
cursor("pointer");
if(CLICKED&&money >=15+(upgradeNUM[1]*5)){
money-=15+(upgradeNUM[1]*5);
upgradeNUM[1]+=1;
PhpMax+=10;
}
}
ellipse(380,280,100,100);
stroke(0,255,9);
arc(380,280,105,105,0*(PI/180),upgradeNUM[1]*5*(PI/180));
stroke(3,3,3);
fill(15,15,15);
text("health\n "+(15+(upgradeNUM[1]*5))+ " $\n +"+(5 +
upgradeNUM[1]*5)+ "%",380,282);
fill(255,252,255);
text("health\n "+(15+(upgradeNUM[1]*5))+ " $\n +"+(5 +
upgradeNUM[1]*5)+ "%",380,280);
fill(219,219,219,50);
if(dist(mouseX,mouseY,380,400)<=50){
fill(173,173,173,200);
cursor("pointer");
if(CLICKED&&money >=25+(upgradeNUM[2]*25)){
money-=25+(upgradeNUM[2]*25);
upgradeNUM[2]+=1;
HpRegen+=0.01;
}
}
ellipse(380,400,100,100);
stroke(0,255,9);
arc(380,400,105,105,0*(PI/180),upgradeNUM[2]*5*(PI/180));
stroke(3,3,3);
fill(15,15,15);
text("health regen\n "+(25+(upgradeNUM[2]*25))+ " $\n +" +
(0.5+upgradeNUM[2]*0.5)+ "/sec",380,402);
fill(252,247,252);
text("health regen\n "+(25+(upgradeNUM[2]*25))+ " $\n +" +
(0.5+upgradeNUM[2]*0.5)+ "/sec",380,400);
fill(219,219,219,50);
if(dist(mouseX,mouseY,230,160)<=50){
fill(173,173,173,200);
cursor("pointer");
if(CLICKED&&money >=15+(upgradeNUM[3]*3)){
money-=15+(upgradeNUM[3]*3);
upgradeNUM[3]+=1;
PSmax+=15;
}
}
ellipse(230,160,100,100);
stroke(0,255,9);
arc(230,160,105,105,0*(PI/180),upgradeNUM[3]*3*(PI/180));
stroke(3,3,3);
fill(15,15,15);
text("sprint \n "+(15+(upgradeNUM[3]*3))+ " $\n +"+(15 +
upgradeNUM[3]*15)+ "%",230,162);
fill(255,255,255);
text("sprint \n "+(15+(upgradeNUM[3]*3))+ " $\n +"+(15 +
upgradeNUM[3]*15)+ "%",230,160);
//strokeWeight(3);
//stroke(32,148,3);
fill(219,219,219,50);
if(dist(mouseX,mouseY,230,280)<=50){
cursor("pointer");
fill(173,173,173,200);
if(CLICKED&&money >=6+(upgradeNUM[4]*3)){
money-=6+(upgradeNUM[4]*3);
upgradeNUM[4]+=1;
AtkM+=5;
}
}
ellipse(230,280,100,100);
stroke(0,255,9);
arc(230,280,105,105,0*(PI/180),upgradeNUM[4]*3*(PI/180));
stroke(3,3,3);
fill(15,15,15);
text("Melee \n "+(6+(upgradeNUM[4]*3))+ " $\n +"+(5 +
upgradeNUM[4]*5)+ "%",230,282);
fill(255,255,255);
text("Melee \n "+(6+(upgradeNUM[4]*3))+ " $\n +"+(5 +
upgradeNUM[4]*5)+ "%",230,280);
fill(219,219,219,50);
if(dist(mouseX,mouseY,230,400)<=50){
cursor("pointer");
fill(173,173,173,200);
if(CLICKED&&money >=25+(upgradeNUM[5]*15)){
money-=25+(upgradeNUM[5]*15);
upgradeNUM[5]+=1;
ParmorMax+=15;
}
}
ellipse(230,400,100,100);
stroke(0,255,9);
arc(230,400,105,105,0*(PI/180),upgradeNUM[5]*3*(PI/180));
stroke(3,3,3);
fill(15,15,15);
textSize(15);
text("Armor \n "+(25+(upgradeNUM[5]*15))+ " $\n +"+(15+upgradeNUM[5]*15)+ "pts",230,402);
fill(247,242,247);
textSize(15);
text("Armor \n "+(25+(upgradeNUM[5]*15))+ " $\n +"+(15+upgradeNUM[5]*15)+ "pts",230,400);
if(Game_mode===1){}
/*
textSize(15);
//showHint
fill(138,136,136,50);
rect(450,300,280,100);
fill(3,3,3);
text("HINT: \n"+hints[showHint],450,307);
fill(255,250,250);
text("HINT: \n"+hints[showHint],450,305);
*/ }
strokeWeight(3);
stroke(32,148,3);
noStroke();
///AtkM
fill(145,145,145,100);
stroke(0,0,0);
rect(300,35,250,60);
strokeWeight(3);
stroke(32,148,3);
noStroke();
///AtkM
fill(145,145,145,100);
stroke(0,0,0);
rect(300,520,250,80);
fill(255,255,255);
if(shopscene===1){
// sds
button(100,300,50,50,"<",25,-22.3);
button(500,300,50,50,">",25,-22.1);
if(Game_mode===1 || Game_mode===3){
textSize(15);
fill(255,255,255);
gungetT=0;
text("SUB MEC GUNS",300,80);
GUNgetUpg(21,160,115,50,0);
GUNgetUpg(22,200,115,100,0);
GUNgetUpg(23,240,115,200,0);
GUNgetUpg(24,320,115,300,0);
GUNgetUpg(34,280,115,200,0);
GUNgetUpg(35,360,115,300,0);
GUNgetUpg(32,400,115,100,1);
//GUNgetUpg(36,440,115,0,0);
textSize(15);
fill(255,255,255);
text("MEC GUNS",300,150);
GUNgetUpg(1,160,180,100,0);
GUNgetUpg(2,200,180,200,0);
GUNgetUpg(3,240,180,300,0);
GUNgetUpg(4,280,180,400,0);
GUNgetUpg(33,320,180,100,1);
GUNgetUpg(37,360,180,999,1);
//GUNgetUpg(38,400,180,0,0);
//GUNgetUpg(39,440,180,0,0);
textSize(15);
fill(255,255,255);
text("PISTOLS",300,215);
GUNgetUpg(5,160,245,20,0);
GUNgetUpg(6,200,245,60,0);
GUNgetUpg(7,240,245,100,0);
GUNgetUpg(40,280,245,100,0);
GUNgetUpg(41,320,245,100,0);
GUNgetUpg(8,360,245,200,0);
GUNgetUpg(31,400,245,100,1);
//GUNgetUpg(42,440,245,0,0);
textSize(15);
fill(255,255,255);
text("SNIPERS",300,280);
GUNgetUpg(9,160,310,100,0);
GUNgetUpg(10,200,310,200,0);
GUNgetUpg(11,240,310,300,0);
GUNgetUpg(12,360,310,400,0);
GUNgetUpg(30,400,310,100,1);
GUNgetUpg(43,280,310,300,0);
GUNgetUpg(44,320,310,300,0);
//GUNgetUpg(45,440,310,0,0);
textSize(15);
fill(255,255,255);
text("SHOTGUNS",300,345);
GUNgetUpg(13,160,375,50,0);
GUNgetUpg(14,200,375,100,0);
GUNgetUpg(15,240,375,200,0);
GUNgetUpg(16,360,375,300,0);
GUNgetUpg(29,400,375,100,1);
GUNgetUpg(46,280,375,200,0);
GUNgetUpg(47,320,375,200,0);
//GUNgetUpg(48,440,375,0,0);
textSize(15);
fill(255,255,255);
text("RIFLES",300,410);
GUNgetUpg(17,160,440,50,0);
GUNgetUpg(18,200,440,100,0);
GUNgetUpg(19,240,440,200,0);
GUNgetUpg(20,320,440,300,0);
GUNgetUpg(28,360,440,100,1);
GUNgetUpg(49,280,440,200,0);
//GUNgetUpg(50,400,440,0,0);
//GUNgetUpg(51,440,440,0,0);
textSize(10);
fill(255,255,255);
}else{
textSize(30);
fill(0, 0, 0);
text("Weapon upgrades\nonly in normal \nand nightmare modes",300,302);
fill(255,255,255);
text("Weapon upgrades\nonly in normal \nand nightmare modes",300,300);
}
}
else {}
if(shopscene===2){
if(PowerEquip!==1){
button(300,200,180,50,"adrine shot\n[heal health and sprint]\n 10-gems",12,-22.4);
}
if(PowerEquip!==0){
button(300,400,180,50,"grenade\n[trowable bomb]\n 10-gems",12,-22.5);}
button(100,300,50,50,"<",25,-22.1);
button(500,300,50,50,">",25,-22.2);
textSize(15);
//showHint
strokeWeight(3);
stroke(5, 5, 5);
fill(138,136,136,50);
rect(300,300,280,100);
fill(3,3,3);
text("HINT: \n"+hints[showHint],300,307);
fill(255,250,250);
text("HINT: \n"+hints[showHint],300,305);
}
textSize(20);
fill(26,26,26);
if(Gems>0){
text(money+"$ - "+Gems+"G",300,502);
text("press 'e' to close menu",300,532);
fill(245,245,245);
text(money+"$ - "+Gems+"G",300,500);
text("press 'e' to close menu",300,530);
}else{
text(money+"$",300,502);
text("press 'e' to close menu",300,532);
fill(245,245,245);
text(money+"$",300,500);
text("press 'e' to close menu",300,530);
}
textSize(50);
fill(26,26,26);
text("SHOP",300,39);
fill(245,245,245);
text("SHOP",300,35);
button(500,40,100,50,"EXIT GAME",15,0);
// button(100,520,130,50,"BUY AMMO x"+ammoMax*2+" \n" +
// round(AmmoBANK[GUN[GUNE].AT]/3)+ "$",15,-10);
button(100,520,130,50,"RETURN TO\n GAME",15,-102);
button(500,520,130,50,"RETURN TO\n GAME",15,-102);
button(100,40,100,50,"SAVE GAME",15,-103);
textSize(10);
// text("cost is based on how much\nammo you have",100,560);
textSize(12);
if(gungetT>0&&shopscene===1){
Gungetshow(gungetX,gungetY,gungetG);
}
}
if(scene===-10){
if(money >=round(AmmoBANK[GUN[GUNE].AT]/3)){
money-=round(AmmoBANK[GUN[GUNE].AT]/3);
AmmoBANK[GUN[GUNE].AT]+=ammoMax*2;
}
scene=1;
}
if(scene===-103){
scene=1;
var Cints = [];
var CAstr = GunGOT;
for(var i=0;i<CAstr.length;i++){
if(CAstr[i]===0){Cints[i]=round(random(2,8))*10;}
if(CAstr[i]===1){Cints[i]=1+round(random(1,8))*11;}
}
var Chexstr = "";
var Chexstr2= "";
for(var i=0; i < Cints.length; i++) {
Chexstr += Cints[i].toString(33) + ";";
}
for(var i=0; i < upgradeNUM.length; i++) {
Chexstr2 += upgradeNUM[i].toString(33) + ";";
}
println("gunG:'"+Chexstr+"',\nwave:"+TUnlock.toString(8)+",\nupG:["+upgradeNUM+"],\ns:'"+Gems.toString(34)+"'");
}
if(scene===-102){
scene=1;
pause=false;
forcePause=false;
}
if(scene===-22.1){
shopscene=0;
scene=1;
forcePause=false;
}
if(scene===-22.2){
shopscene=1;
scene=1;
}
if(scene===-22.3){
shopscene=2;
scene=1;
}
if(scene===-22.4){
if(Gems>=10){
PowerEquip=1;
Gems-=10000000;
PowerCount=6;
}
scene=1;
}
if(scene===-22.5){
if(Gems>=10){
PowerEquip=0;
Gems-=10;
PowerCount=10;
}
scene=1;
}
//HpRegen
damageMULT=damageMULTbase+((upgradeNUM[0]*5)/100);
AtkM=((upgradeNUM[4]*5));
PSmax=100+((upgradeNUM[3]*15));
HpRegen=((upgradeNUM[2]*0.01));
PhpMax=100+((upgradeNUM[1]*10));
if(wave>25){
Zombie_di_mult=0.2*wave;
}
else {
//Zombie_di_mult=1;
}
if(wave>TUnlock){
TUnlock=wave;
}
if((keys[81]&&pause===false)||forcePause){
forcePause=false;
showHint=floor(random(0,hints.length));
pause=true;
if(!FIX_SHOP_BUG){
img=get(0,0,600,600);
}
}
else if(keys[69]&&pause===true){
pause=false;
forcePause=false;
}
if(pause===false){
HUDShow();
}
}
CLICKED=false;
//FPSgraph(50,5);
};