Galaxium III back to earth

From Hack Wars Wiki

Jump to: navigation, search

Initialize

setViewportY(100);
setViewportX(-50);
 
if(isGlobalSet("loadscreen")==false){
	setGlobal("loadscreen",true);
}
setGlobal("diecount",0);
setGlobal("level",24);
setGlobal("map",1);
setGlobal("message1","What's this! Your own army is intercepting"); 
setGlobal("message2","you on your triumphant return to earth...");
setGlobal("message3","something isn't right!");
setGlobal("message4","");
setGlobal("asscount",0);
setGlobal("maxx",1408);
setGlobal("maxy",200);
 
if(getGlobal("loadscreen")==true){
	changeMap(1,4);
}
 
 
int y=200;
int x=1000;
int s=0;
int i=0;
 
//Create Wormhole.
s=createSprite(22,26,0,128,0);
setLocal(s,"animate",0);
setLocal(s,"type","exit");
 
 
//Create Max Power's Ship.
s=createSprite(8,2,1000,128,0);
 
setGlobal("playerx",0);
setGlobal("playery",200);
setZRotation(s,90);
createTimeStamp("animateship");
createTimeStamp("moveship");
createTimeStamp("shootrate");
setLocal(s,"anglecount",14);
setLocal(s,"storeangle",14);
setLocal(s,"animate",0);
setLocal(s,"explode",0);
setLocal(s,"type","player");
setLocal(s,"life",0);
setGlobal("shiphealth",100);
 
//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);
 
//Create some land mines.
i=0;
int ii=0;
x=0;
y=0;
//45
while(i<20){
 
if(i%4==0){
	x=x+164;
	if(ii%2==0){
		y=0;
	}else{
		y=64;
	}
	ii=ii+1;
}else{
	y=y+32;
}
 
s=createSprite(18,1,x,y,1);
int center=s;
setOffscreenProcessing(s,false);
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);
setOffscreenProcessing(s,false);
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);
setOffscreenProcessing(s,false);
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);
setOffscreenProcessing(s,false);
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);
setOffscreenProcessing(s,false);
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);
setOffscreenProcessing(s,false);
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);
setOffscreenProcessing(s,false);
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);
setOffscreenProcessing(s,false);
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);
setOffscreenProcessing(s,false);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;
}
 
x=0;
i=0;
while(i<4){
x=x+200;
y=intValue(rand()*200);
 
s=createSprite(8,10,x,y,0);
setZRotation(s,90);
setLocal(s,"anglecount",6);
setLocal(s,"storeangle",6);
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);
 
 
i=i+1;
}
 
 
s=createSprite(22,22,950,100,1);
setLocal(s,"animate",0);
setLocal(s,"type","exit");
 
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 asscount=getGlobal("asscount");
setGlobal("asscount",asscount+1);
 
if(asscount%20==0){
/*	int y=intValue(rand()*200);
	int x=getViewportX()-300;
	int s=createSprite(12,20,x,y,1);
	setLocal(s,"type","asteroid");
	setLocal(s,"explode",0);
	setLocal(s,"damaging",0);
	setLocal(s,"frames",0);
	setLocal(s,"show",0);
	setLocal(s,"health",10);
	setLocal(s,"direction",0);
	setLocal(s,"dealdamage",0);*/
 
    int y=intValue(rand()*200);
	int x=getViewportX()-300;
	int s=createSprite(13,20,x,y,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",10);
	setLocal(s,"direction",0);
	setLocal(s,"dealdamage",0);
}
 
 
drawText("1: Return to Earth 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(1,24);
		}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(0,0);
	}
	fillRectangle(0,0,288,256,255,255,255,fadecount);	
}
Personal tools