if(isGlobalSet("loadscreen")==false){
setGlobal("loadscreen",true);
}
setGlobal("level",23);
setGlobal("map",0);
setGlobal("message1","By cutting off the Green Menace at their source");
setGlobal("message2","perhaps you can prevent any further attempts");
setGlobal("message3","at 'trade negotiations'.");
setGlobal("message4","");
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",0.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);
setZRotation(s,90);
setGlobal("playerx",0);
setGlobal("playery",200);
createTimeStamp("animateship");
createTimeStamp("moveship");
createTimeStamp("shootrate");
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,27,0,200,0);
setLocal(s,"animate",0);
setLocal(s,"type","exit");
//Create the planet.
i=24;
x=800;
y=300;
setGlobal("Earthx",x+64);
setGlobal("Earthy",y+64);
setGlobal("EarthSize",116);
setGlobal("earthstart",s+1);
while(i<=25){
s=createSprite(i,6,0+x,((i-24)*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-24)*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-24)*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-24)*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-24)*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-24)*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-24)*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-24)*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=800;
y=300;
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);
setOffscreenProcessing(s,false);
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;
while(i<16){
int test=(int)(rand()*2.0);
boolean offscreen=false;
if(test==1)
offscreen=true;
offscreen=false;
y=intValue(rand()*600.0);
x=intValue(rand()*1300.0);
s=createSprite(18,1,x,y,1);
setOffscreenProcessing(s,offscreen);
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);
setOffscreenProcessing(s,offscreen);
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,offscreen);
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,offscreen);
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,offscreen);
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,offscreen);
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,offscreen);
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,offscreen);
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,offscreen);
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);
setOffscreenProcessing(s,false);
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);
setOffscreenProcessing(s,false);
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);
setOffscreenProcessing(s,false);
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);
setOffscreenProcessing(s,false);
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);
setOffscreenProcessing(s,false);
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);
setOffscreenProcessing(s,false);
setGlobal("max",s);