Galaxium III map3

From Hack Wars Wiki

Jump to: navigation, search

Initalize

for(int x=0;x<45;x++){//Set up the space texture.
   for(int y=0;y<24;y++){
      setTile(x,y,(x%15)+(y%8)*15); 
   }
}
setTerrain(125);
 
 
if(isGlobalSet("loadscreen")==false){
	setGlobal("loadscreen",true);
}
setGlobal("level",8);
setGlobal("map",0);
setGlobal("message1","Having learned of an inter-galactic peace"); 
setGlobal("message2","negotiation. Max Power races valiantly to intercept");
setGlobal("message3","the 'peace loving' Green Menace Ambassadors");
setGlobal("message4","before they can rendezvous with Earth.");
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,18,0,200,0);
setLocal(s,"animate",0);
setLocal(s,"type","exit");
 
//Create the Sun.
while(i<8){
 
//Create the sun.
s=createSprite(i,16,0+x,(i*32)+y,0);
setZ(s,2);
setIgnoreTerrain(s,true);
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,16,32+x,(i*32)+y,0);
setZ(s,2);
setIgnoreTerrain(s,true);
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,16,64+x,(i*32)+y,0);
setZ(s,2);
setIgnoreTerrain(s,true);
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,16,96+x,(i*32)+y,0);
setZ(s,2);
setIgnoreTerrain(s,true);
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,16,128+x,(i*32)+y,0);
setZ(s,2);
setIgnoreTerrain(s,true);
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,16,160+x,(i*32)+y,0);
setZ(s,2);
setIgnoreTerrain(s,true);
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,16,192+x,(i*32)+y,0);
setZ(s,2);
setIgnoreTerrain(s,true);
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,16,224+x,(i*32)+y,0);
setZ(s,2);
setIgnoreTerrain(s,true);
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,16,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");
setZ(s,2);
setIgnoreTerrain(s,true);
	s=createSprite(i,16,32+x,((i-16)*64)+y,0);
setZ(s,2);
setIgnoreTerrain(s,true);
	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,16,64+x,((i-16)*64)+y,0);
setZ(s,2);
setIgnoreTerrain(s,true);
	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,16,96+x,((i-16)*64)+y,0);
setZ(s,2);
setIgnoreTerrain(s,true);
	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,16,0+x,((i-16)*64+32)+y,0);
setZ(s,2);
setIgnoreTerrain(s,true);
	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,16,32+x,((i-16)*64+32)+y,0);
setZ(s,2);
setIgnoreTerrain(s,true);
	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,16,64+x,((i-16)*64+32)+y,0);
setZ(s,2);
setIgnoreTerrain(s,true);
	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,16,96+x,((i-16)*64+32)+y,0);
setZ(s,2);
setIgnoreTerrain(s,true);
	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);
    setRenderType(s,1);
    setWidth(s,(int)(rand()*15)+10);
    setHeight(s,(int)(rand()*15)+10);
    setHeight(s,20);
	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 enemy ships.
s=createSprite(19,17,200,300,1);
setXOffset(s,10);
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);
setOffscreenProcessing(false);
 
s=createSprite(19,17,260,360,1);
setXOffset(s,10);
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);
setOffscreenProcessing(false);
 
s=createSprite(19,17,900,260,1);
setXOffset(s,10);
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);
setOffscreenProcessing(false);
 
s=createSprite(19,17,600,400,1);
setXOffset(s,10);
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);
setOffscreenProcessing(false);
 
s=createSprite(19,17,750,350,1);
setXOffset(s,10);
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);
setOffscreenProcessing(false);
 
 
s=createSprite(19,17,500,150,1);
setXOffset(s,10);
setOffscreenProcessing(false);
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");
int nextlevel=getGlobal("nextlevel");
setViewportZ(500);
 
if(objective==0){
	drawText("1: Destroy Four Enemy Ships."+test,"courier",8,5,236,255,255,255,255);
}else if(objective==1){
	drawText("1: Destory Three Enemy Ships.","courier",8,5,236,255,255,255,255);
}else if(objective==2){
	drawText("1: Destory Two Enemy Ships.","courier",8,5,236,255,255,255,255);
}else if(objective==3){
	drawText("1: Destory One Enemy Ships.","courier",8,5,236,255,255,255,255);
}else{
	drawText("2: Chase Aliens 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("score",0);
			setGlobal("ships",ships-1);
			changeMap(0,8);
		}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;
		setGlobal("loadscreen",true);
		changeMap(1,12);
	}
	fillRectangle(0,0,288,256,255,255,255,fadecount);	
}
Personal tools