Galaxium III map

From Hack Wars Wiki

Jump to: navigation, search

Initialize

setViewportY(100);
setViewportX(-50);
setViewportZ(500);
 
if(isGlobalSet("loadscreen")==false){
	setGlobal("loadscreen",true);
}
setGlobal("level",0);
setGlobal("map",0);
setGlobal("message1","Realizing that the Green Menace has brainwashed"); 
setGlobal("message2","your home planet's population, you grimly");
setGlobal("message3","prepare for what must be done. To save your");
setGlobal("message4","planet you must destroy your planet.");
setGlobal("maxx",1408);
setGlobal("maxy",736);
 
if(getGlobal("loadscreen")==true){
	changeMap(1,4);
}
 
 
int y=200;
int x=1000;
setGlobal("diecount",0);
setGlobal("Sunx",x);
setGlobal("Suny",y);
setGlobal("Ms",1.98892*pow(10.0,30.0));
int s=0;
int i=0;
setGlobal("G",6.67259*pow(10.0,-11.0));
setGlobal("Me",5.97*pow(10.0,24.0));
setGlobal("earthhealth",300);
setGlobal("earthexplode",0);
setGlobal("sunhealth",500);
float G = 6.67259*pow(10.0,-11.0);
float Me = 5.97*pow(10.0,24.0);
//Create Max Power's Ship.
s=createSprite(8,2,0,200,0);
setZOffset(5);
setZRotation(s,90);
setGlobal("playerx",0);
setGlobal("playery",200);
createTimeStamp("animateship");
createTimeStamp("moveship");
createTimeStamp("shootrate");
setFrame(s,0);
setLocal(s,"anglecount",5);
setLocal(s,"storeangle",5);
setLocal(s,"animate",0);
setLocal(s,"explode",0);
setLocal(s,"type","player");
setLocal(s,"life",0);
 
setViewportY(100);
setViewportX(-50);
setGlobal("shiphealth",100);
setGlobal("Sunx",x+128);
setGlobal("Suny",y+128);
setGlobal("SunSize",256);
setGlobal("sunstart",s+1);
 
//CREATE THE EXIT STRATEGY.
if(isGlobalSet("score")==false)
	setGlobal("score",0);
if(isGlobalSet("ships")==false)
	setGlobal("ships",5);
setGlobal("fade",1);
setGlobal("fadecount",255);
setGlobal("objective",0);
s=createSprite(22,13,0,200,0);
setLocal(s,"animate",0);
setLocal(s,"type","exit");
 
//Create the Sun.
while(i<8){
 
//Create the sun.
s=createSprite(i,9,0+x,(i*32)+y,0);
setLocal(s,"xadd",1);
setLocal(s,"xcount",0);
setLocal(s,"yadd",1);
setLocal(s,"ycount",0);
setLocal(s,"drawCircle",0);
	setLocal(s,"frame",0);
	setLocal(s,"explode",0);
	setLocal(s,"movex",0);
	setLocal(s,"movey",0);
	setLocal(s,"type","planet");
s=createSprite(i,9,32+x,(i*32)+y,0);
setFrame(s,1);
setLocal(s,"xadd",1);
setLocal(s,"xcount",0);
setLocal(s,"yadd",1);
setLocal(s,"ycount",0);
setLocal(s,"drawCircle",0);
	setLocal(s,"frame",0);
	setLocal(s,"explode",0);
	setLocal(s,"movex",0);
	setLocal(s,"movey",0);
	setLocal(s,"type","planet");
s=createSprite(i,9,64+x,(i*32)+y,0);
setFrame(s,2);
setLocal(s,"xadd",1);
setLocal(s,"xcount",0);
setLocal(s,"yadd",1);
setLocal(s,"ycount",0);
setLocal(s,"drawCircle",0);
	setLocal(s,"frame",0);
	setLocal(s,"explode",0);
	setLocal(s,"movex",0);
	setLocal(s,"movey",0);
	setLocal(s,"type","planet");
s=createSprite(i,9,96+x,(i*32)+y,0);
setFrame(s,3);
setLocal(s,"xadd",1);
setLocal(s,"xcount",0);
setLocal(s,"yadd",1);
setLocal(s,"ycount",0);
setLocal(s,"drawCircle",0);
	setLocal(s,"frame",0);
	setLocal(s,"explode",0);
	setLocal(s,"movex",0);
	setLocal(s,"movey",0);
	setLocal(s,"type","planet");
s=createSprite(i,9,128+x,(i*32)+y,0);
setFrame(s,4);
setLocal(s,"xadd",1);
setLocal(s,"xcount",0);
setLocal(s,"yadd",1);
setLocal(s,"ycount",0);
setLocal(s,"drawCircle",0);
	setLocal(s,"frame",0);
	setLocal(s,"explode",0);
	setLocal(s,"movex",0);
	setLocal(s,"movey",0);
	setLocal(s,"type","planet");
s=createSprite(i,9,160+x,(i*32)+y,0);
setFrame(s,5);
setLocal(s,"xadd",1);
setLocal(s,"xcount",0);
setLocal(s,"yadd",1);
setLocal(s,"ycount",0);
setLocal(s,"drawCircle",0);
	setLocal(s,"frame",0);
	setLocal(s,"explode",0);
	setLocal(s,"movex",0);
	setLocal(s,"movey",0);
	setLocal(s,"type","planet");
s=createSprite(i,9,192+x,(i*32)+y,0);
setFrame(s,6);
setLocal(s,"xadd",1);
setLocal(s,"xcount",0);
setLocal(s,"yadd",1);
setLocal(s,"ycount",0);
setLocal(s,"drawCircle",0);
	setLocal(s,"frame",0);
	setLocal(s,"explode",0);
	setLocal(s,"movex",0);
	setLocal(s,"movey",0);
	setLocal(s,"type","planet");
s=createSprite(i,9,224+x,(i*32)+y,0);
setFrame(s,7);
setLocal(s,"xadd",1);
setLocal(s,"xcount",0);
setLocal(s,"yadd",1);
setLocal(s,"ycount",0);
setLocal(s,"drawCircle",0);
	setLocal(s,"frame",0);
	setLocal(s,"explode",0);
	setLocal(s,"movex",0);
	setLocal(s,"movey",0);
	setLocal(s,"type","planet");
i=i+1;
}
setGlobal("sunstop",s);
//Create the planet.
i=16;
x=288-64;
y=384-64;
setGlobal("Earthx",x+64);
setGlobal("Earthy",y+64);
setGlobal("EarthSize",116);
setGlobal("earthstart",s+1);
while(i<=17){
	s=createSprite(i,6,0+x,((i-16)*64)+y,0);
	setLocal(s,"drawCircle",0);
	setLocal(s,"frame",0);
	setLocal(s,"explode",0);
	setLocal(s,"movex",0);
	setLocal(s,"movey",0);
	setLocal(s,"type","planet");
	s=createSprite(i,6,32+x,((i-16)*64)+y,0);
	setLocal(s,"drawCircle",0);
	setLocal(s,"frame",0);
	setLocal(s,"explode",0);
	setLocal(s,"movex",0);
	setLocal(s,"movey",0);
	setLocal(s,"type","planet");
	setFrame(s,1);
	s=createSprite(i,6,64+x,((i-16)*64)+y,0);
	setLocal(s,"drawCircle",0);
	setLocal(s,"frame",0);
	setLocal(s,"explode",0);
	setLocal(s,"movex",0);
	setLocal(s,"movey",0);
	setLocal(s,"type","planet");
	setFrame(s,2);
	s=createSprite(i,6,96+x,((i-16)*64)+y,0);
	setLocal(s,"drawCircle",0);
	setLocal(s,"frame",0);
	setLocal(s,"movex",0);
	setLocal(s,"movey",0);
	setLocal(s,"type","planet");
	setFrame(s,3);
	setLocal(s,"explode",0);
	s=createSprite(i,6,0+x,((i-16)*64+32)+y,0);
	setLocal(s,"drawCircle",0);
	setLocal(s,"frame",0);
	setLocal(s,"movex",0);
	setLocal(s,"movey",0);
	setLocal(s,"explode",0);
	setLocal(s,"type","planet");
	setFrame(s,4);
	s=createSprite(i,6,32+x,((i-16)*64+32)+y,0);
	setLocal(s,"drawCircle",0);
	setLocal(s,"frame",0);
	setLocal(s,"explode",0);
	setLocal(s,"movex",0);
	setLocal(s,"movey",0);
	setLocal(s,"type","planet");
	setFrame(s,5);
	s=createSprite(i,6,64+x,((i-16)*64+32)+y,0);
	setLocal(s,"drawCircle",0);
	setLocal(s,"frame",0);
	setLocal(s,"explode",0);
	setLocal(s,"movex",0);
	setLocal(s,"movey",0);
	setLocal(s,"type","planet");
	setFrame(s,6);
	s=createSprite(i,6,96+x,((i-16)*64+32)+y,0);
	setLocal(s,"drawCircle",0);
	setLocal(s,"frame",0);
	setLocal(s,"explode",0);
	setLocal(s,"movex",0);
	setLocal(s,"movey",0);
	setLocal(s,"type","planet");
	setFrame(s,7);
	i=i+1;
}
setGlobal("earthstop",s);
 
//Create the asteroids around the planet.
i=0;
setGlobal("starta1",s+1);
x=576;
y=384;
while(i<24){
	int startx=intValue(rand()*300.0-300.0);
	int starty=intValue(rand()*256.0-256.0);
	if(startx>(-64)&&startx<=0)
		startx=startx+(-64);
	if(starty>(-64)&&starty<=0)
		starty=starty+(-64);
	if(startx>=0&&startx<64)
		startx=startx+96;
	if(starty>=0&&starty<64)
		starty=starty+64;
 
	s=createSprite(13,5,x-startx,y-starty,1);
    setWidth(s,(int)(rand()*15)+10);
    setHeight(s,(int)(rand()*15)+10);
    setRenderType(s,1);
	setLocal(s,"type","asteroid");
	setLocal(s,"explode",0);
	setLocal(s,"damaging",0);
	setLocal(s,"frames",0);
	setLocal(s,"show",0);
	setLocal(s,"health",30);
	setLocal(s,"radius",3.84*pow(10.0,8.0));
	setLocal(s,"direction",1);
	setLocal(s,"dealdamage",0);
	i=i+1;
}
setGlobal("enda1",s);
 
//Create some land mines.
i=0;
int ii=0;
while(i<16){
ii=ii+67;
y=ii/45*32;
x=(ii-(ii/45));
debug("x: "+x+"y: "+y);
 
s=createSprite(18,1,x,y,1);
int center=s;
setLocal(s,"frame",0);
setLocal(s,"pulse",0);
setLocal(s,"center",center);
setLocal(s,"explode",0);
setLocal(s,"health",20);
setLocal(s,"type","headmine");
 
s=createSprite(18,1,x-32,y,1);
setFrame(s,7);
setLocal(s,"frame",0);
setLocal(s,"pulse",0);
setLocal(s,"center",center);
setLocal(s,"explode",0);
setLocal(s,"type","mine");
setCollisionType(s,1);
 
s=createSprite(18,1,x+32,y,1);
setFrame(s,7);
setLocal(s,"frame",0);
setLocal(s,"pulse",0);
setLocal(s,"center",center);
setLocal(s,"explode",0);
setLocal(s,"type","mine");
setCollisionType(s,1);
 
s=createSprite(18,1,x-32,y-32,1);
setFrame(s,7);
setLocal(s,"frame",0);
setLocal(s,"pulse",0);
setLocal(s,"center",center);
setLocal(s,"explode",0);
setLocal(s,"type","mine");
setCollisionType(s,1);
 
s=createSprite(18,1,x,y-32,1);
setFrame(s,7);
setLocal(s,"frame",0);
setLocal(s,"pulse",0);
setLocal(s,"explode",0);
setLocal(s,"center",center);
setLocal(s,"type","mine");
setCollisionType(s,1);
 
s=createSprite(18,1,x+32,y-32,1);
setFrame(s,7);
setLocal(s,"frame",0);
setLocal(s,"pulse",0);
setLocal(s,"explode",0);
setLocal(s,"center",center);
setLocal(s,"type","mine");
setCollisionType(s,1);
 
s=createSprite(18,1,x-32,y+32,1);
setFrame(s,7);
setLocal(s,"frame",0);
setLocal(s,"pulse",0);
setLocal(s,"explode",0);
setLocal(s,"center",center);
setLocal(s,"type","mine");
setCollisionType(s,1);
 
s=createSprite(18,1,x,y+32,1);
setFrame(s,7);
setLocal(s,"explode",0);
setLocal(s,"frame",0);
setLocal(s,"pulse",0);
setLocal(s,"center",center);
setLocal(s,"type","mine");
setCollisionType(s,1);
 
s=createSprite(18,1,x+32,y+32,1);
setFrame(s,7);
setLocal(s,"frame",0);
setLocal(s,"pulse",0);
setLocal(s,"explode",0);
setLocal(s,"center",center);
setLocal(s,"type","mine");
setCollisionType(s,1);
 
i=i+1;
}
 
//Create enemy ships.
s=createSprite(19,10,200,300,1);
setLocal(s,"anglecount",5);
setLocal(s,"storeangle",5);
setLocal(s,"animate",0);
setLocal(s,"move",0);
setLocal(s,"health",40);
setLocal(s,"explode",0);
setLocal(s,"type","enemy");
setLocal(s,"life",0);
setLocal(s,"patrol",0);
setLocal(s,"lastshoot",0);
 
 
s=createSprite(19,10,260,360,1);
setLocal(s,"anglecount",5);
setLocal(s,"storeangle",5);
setLocal(s,"animate",0);
setLocal(s,"move",0);
setLocal(s,"health",40);
setLocal(s,"explode",0);
setLocal(s,"type","enemy");
setLocal(s,"life",0);
setLocal(s,"patrol",0);
setLocal(s,"lastshoot",0);
 
 
s=createSprite(19,10,900,260,1);
setLocal(s,"anglecount",5);
setLocal(s,"storeangle",5);
setLocal(s,"animate",0);
setLocal(s,"move",0);
setLocal(s,"health",40);
setLocal(s,"explode",0);
setLocal(s,"type","enemy");
setLocal(s,"life",0);
setLocal(s,"patrol",0);
setLocal(s,"lastshoot",0);
 
 
s=createSprite(19,10,600,400,1);
setLocal(s,"anglecount",5);
setLocal(s,"storeangle",5);
setLocal(s,"animate",0);
setLocal(s,"move",0);
setLocal(s,"health",40);
setLocal(s,"explode",0);
setLocal(s,"type","enemy");
setLocal(s,"life",0);
setLocal(s,"patrol",0);
setLocal(s,"lastshoot",0);
 
 
s=createSprite(19,10,750,350,1);
setLocal(s,"anglecount",5);
setLocal(s,"storeangle",5);
setLocal(s,"animate",0);
setLocal(s,"move",0);
setLocal(s,"health",40);
setLocal(s,"explode",0);
setLocal(s,"type","enemy");
setLocal(s,"life",0);
setLocal(s,"patrol",0);
setLocal(s,"lastshoot",0);
 
 
 
s=createSprite(19,10,500,150,1);
setLocal(s,"anglecount",5);
setLocal(s,"storeangle",5);
setLocal(s,"animate",0);
setLocal(s,"move",0);
setLocal(s,"health",40);
setLocal(s,"explode",0);
setLocal(s,"type","enemy");
setLocal(s,"life",0);
setLocal(s,"patrol",0);
setLocal(s,"lastshoot",0);
 
 
setGlobal("max",s);


Continue

int health = getGlobal("shiphealth");
int objective=getGlobal("objective");
int fade=getGlobal("fade");
int fadecount=getGlobal("fadecount");
int ships=getGlobal("ships");
int score=getGlobal("score");
 
if(objective==0){
	drawText("1: Destroy the Planet Earth.","courier",8,5,236,255,255,255,255);
}else if(objective==1){
	drawText("2: Destroy the Sun.","courier",8,5,236,255,255,255,255);
}else{
	drawText("3: Escape Through Wormhole.","courier",8,5,236,255,255,255,255);
}
 
drawText("Health: "+health,"courier",10,5,15,255,255,255,255);
drawText("Ships: "+ships,"courier",10,5,25,255,255,255,255);
drawText(""+score,"courier",10,220,15,255,255,255,255);
 
if(getGlobal("shiphealth")<=0&&fade==0){
	int diecount=getGlobal("diecount");
	setGlobal("diecount",diecount+1);
	if(diecount>100){
		if(ships>1){
			setGlobal("ships",ships-1);
			changeMap(0,0);
		}else{
			drawText("Game Over","courier",15,98,120,255,255,255,255);
		}
	}
}
 
if(fade==1){
	fadecount=fadecount-10;
	setGlobal("fadecount",fadecount);
	if(fadecount<0){
		fadecount=0;
		setGlobal("fade",0);
	}
	fillRectangle(0,0,288,256,255,255,255,fadecount);
}else if(fade==2){
	fadecount=fadecount+10;
	setGlobal("fadecount",fadecount);
	if(fadecount>=255){
		fadecount=255;
		drawText("Score "+getGlobal("score"),"courier",15,98,120,0,0,0,255);	
	}
	fillRectangle(0,0,288,256,255,255,255,fadecount);
	if(fadecount>=255){
		setBeat();
		triggerWatch("Galaxium","score",getGlobal("score"));
		drawText("Score "+getGlobal("score"),"courier",15,89,120,0,0,0,255);	
	}	
}
Personal tools