fade down graphics mode 640,480 set framerate max vbl sync on load map 128 global int maxx=map width * map tile width - 250 global int maxy=map height * map tile height - 250 global int turn global int redplan=1600 global int blueplan=1700 global int greenplan=1800 global int purpplan=1900 global int planrandx[200] global int planrandy[200] global int planetnum[200] global int redplanx=random(1,10)*map tile width global int redplany=random(1,10)*map tile height global int redplan2=random(4,13) global int redplan2x=random(1,10)*map tile width global int redplan2y=random(1,10)*map tile height global int redplan3=random(4,13) global int redplan3x=random(1,10)*map tile width global int redplan3y=random(1,10)*map tile height global int redplan4=random(4,13) global int redplan4x=random(1,10)*map tile width global int redplan4y=random(1,10)*map tile height global int redplan5=random(4,13) global int redplan5x=random(1,10)*map tile width global int redplan5y=random(1,10)*map tile height global int blueplanx=random(85,95)*map tile width global int blueplany=random(1,10)*map tile height global int blueplan2=random(4,13) global int blueplan2x=random(85,95)*map tile width global int blueplan2y=random(1,10)*map tile height global int blueplan3=random(4,13) global int blueplan3x=random(85,95)*map tile width global int blueplan3y=random(1,10)*map tile height global int blueplan4=random(4,13) global int blueplan4x=random(85,95)*map tile width global int blueplan4y=random(1,10)*map tile height global int blueplan5=random(4,13) global int blueplan5x=random(85,95)*map tile width global int blueplan5y=random(1,10)*map tile height global int greenplanx=random(85,95)*map tile width global int greenplany=random(85,95)*map tile height global int greenplan2=random(4,13) global int greenplan2x=random(85,95)*map tile width global int greenplan2y=random(85,95)*map tile height global int greenplan3=random(4,13) global int greenplan3x=random(85,95)*map tile width global int greenplan3y=random(85,95)*map tile height global int greenplan4=random(4,13) global int greenplan4x=random(85,95)*map tile width global int greenplan4y=random(85,95)*map tile height global int greenplan5=random(4,13) global int greenplan5x=random(85,95)*map tile width global int greenplan5y=random(85,95)*map tile height global int purpplanx=random(1,10)*map tile width global int purpplany=random(85,95)*map tile height global int purpplan2=random(4,13) global int purpplan2x=random(1,10)*map tile width global int purpplan2y=random(85,95)*map tile height global int purpplan3=random(4,13) global int purpplan3x=random(1,10)*map tile width global int purpplan3y=random(85,95)*map tile height global int purpplan4=random(4,13) global int purpplan4x=random(1,10)*map tile width global int purpplan4y=random(85,95)*map tile height global int purpplan5=random(4,13) global int purpplan5x=random(1,10)*map tile width global int purpplan5y=random(85,95)*map tile height global int sselected global int num=0 global int dset = 0 global int uset=0 global int fadenum global int rmoveship global int x,y global int rc,bc,gc,pc global int moneygiven global int bmenushow global int rcshipnum=0 global int rinshipnum=50 global int rsshipnum=100 global int rbshipnum=150 global int rsx[200] global int rsy[200] global int selected,selectedx,selectedy global int rcselected global int rinselected global int shipmovetilex,shipmovetiley load images 129 load music 128 play music hide mouse fade up turn=0 New Button 0,10,10,11,12,13,129 New Button 1,10,150,8,9,10,129 New Button 2,10,290,14,15,16,129 load images 128 Draw Frame fade up int quit=false while not quit Set Image Bank 0,128 Sprite 0,Mouse X - 4,Mouse Y - 4,16 int value=Poll Button Click if value=0 ' Play Game Clear Buttons loadgame() PlayGame() Draw Picture 0 New Button 0,10,10,11,12,13,129 New Button 1,10,150,8,9,10,129 New Button 2,10,290,14,15,16,129 Draw Frame Fade Up else if value=1 Fade Down Sprite Off Clear Buttons loadgame() Draw Picture 0 New Button 0,10,10,11,12,13,129 New Button 1,10,150,8,9,10,129 New Button 2,10,290,14,15,16,129 Draw Frame Fade Up else if value=2 ' Quit quit=true end if Draw Frame wend procedure loadgame() turn=1 moneygiven=false bmenushow=false rcselected=false rinselected=false rmoveship=false unload images 129 load images 128 Set Image Bank 0,128 set sprite priority 1600,0 set sprite priority 1700,0 set sprite priority 1800,0 set sprite priority 1900,0 open map viewport 1,0,0,0 to 405,450 showplanets() draw frame end proc procedure playgame() repeat showredplanets() showblueplanets() showgreenplanets() showpurpplanets() movescreen() forever end proc procedure movescreen() while x90*map tile width then x=90*map tile width if y>90*map tile height then y=90*map tile height set viewport offset 1,x,y raceturns() mouse() wend end proc procedure mouse() canvas 0 set sprite color 0,white set sprite transparency 0,50 Sprite 0,Mouse X - 12,Mouse Y - 12,16 end proc procedure showplanets() int planum for planum=0 to 199 planum=planum+1 set sprite priority planum+2000,0 planrandx[planum]=(random (0,99)*map tile width) planrandy[planum]=(random (0,99)*map tile height) planetnum[planum]=random (4,13) canvas 1 sprite planum+2000,planrandx[planum],planrandy[planum],planetnum[planum] paste sprite planum+2000 next end proc procedure showredplanets() canvas 1 sprite redplan,redplanx,redplany,0 sprite 1001,redplan2x,redplan2y,redplan2 sprite 1002,redplan3x,redplan3y,redplan3 sprite 1003,redplan4x,redplan4y,redplan4 sprite 1004,redplan5x,redplan5y,redplan5 mouse() draw frame end proc procedure showblueplanets() canvas 1 sprite blueplan,blueplanx,blueplany,1 sprite 2001,blueplan2x,blueplan2y,blueplan2 sprite 2002,blueplan3x,blueplan3y,blueplan3 sprite 2003,blueplan4x,blueplan4y,blueplan4 sprite 2004,blueplan5x,blueplan5y,blueplan5 mouse() draw frame end proc procedure showgreenplanets() canvas 1 sprite greenplan,greenplanx,greenplany,2 sprite 3001,greenplan2x,greenplan2y,greenplan2 sprite 3002,greenplan3x,greenplan3y,greenplan3 sprite 3003,greenplan4x,greenplan4y,greenplan4 sprite 3004,greenplan5x,greenplan5y,greenplan5 mouse() draw frame end proc procedure showpurpplanets() canvas 1 sprite purpplan,purpplanx,purpplany,3 sprite 4001,purpplan2x,purpplan2y,purpplan2 sprite 4002,purpplan3x,purpplan3y,purpplan3 sprite 4003,purpplan4x,purpplan4y,purpplan4 sprite 4005,purpplan5x,purpplan5y,purpplan5 mouse() draw frame end proc procedure raceturns() if turn=1 int mousetilex=(mouse x/map tile width + (x/map tile width)) int mousetiley=(mouse y/map tile height + (y/map tile height)) if moneygiven=false rc=rc+50 moneygiven=true end if canvas 0 draw picture 203,405,0 draw picture 199,405,0 draw picture 204,405,350 draw picture 203,405,200 draw picture 133,405,200 draw picture 151,405,100 draw frame set pen colour black fill rect 429,437 to 479,452 fill rect 410,50 to 600,150 fill rect 429,410 to 500,460 set pen colour make color (255,0,0) draw text 430,450,"("+as string(x/map tile width)+","+as string(y/map tile height)+")" draw text 430,440,"("+as string(mousetilex)+","+as string(mousetiley)+")" draw text 430,100,"You Have " +as string(rc)+ " Credits" if mouse button and mouse x<500 and mouse x>405 and mouse y<250 and mouse y>200 bmenushow=true set pen colour make color (255,0,0) draw text 405,285,"Coloniser" draw text 405,300,"Invasion Ship" draw text 405,315,"Scout" draw text 405,330,"Battlecruiser" end if if mouse button and mouse x<500 and mouse x>405 and mouse y<295 and mouse y>275 and bmenushow=true delay 1000 canvas 1 rcshipnum=(rcshipnum + 1) rsx[rcshipnum]=redplanx+48 rsy[rcshipnum]=redplany+48 set sprite priority rcshipnum,3 sprite rcshipnum,rsx[rcshipnum],rsy[rcshipnum],14 rc=rc-5 canvas 0 set pen colour black fill rect 405,270 to 600,350 end if 'Move Coloniser if mouse button and mouse x<450 and mouse y<150 and mouse x>405 and mouse y>100 and rmoveship=false rmoveship=true end if if rmoveship=true canvas 1 selected = Sprite Col (0,rcshipnum to 2200) canvas 1 canvas 0 set pen colour black fill rect 405,150 to 435,214 set pen colour make color (255,0,0) draw text 405,195,as string(selected) if selected <> -1 and mouse button and mouse x<(rsx[selected]+45) and mouse x>(rsx[selected]) and mouse y<(rsy[selected]+45) and mouse y>(rsy[selected]) and rcselected=false and rmoveship=true canvas 0 sselected=selected set pen colour black fill rect 550,180 to 700,200 set pen colour make color (255,0,0) draw text 405,195,"You have selceted ship " +as string(sselected)+ ", a coloniser" rcselected=true delay 500 end if if mouse button and rcselected=true canvas 1 sprite off sselected int mousemtilex=(((mouse x/map tile width + (x/map tile width))*map tile width) + 3) int mousemtiley=(((mouse y/map tile height + (y/map tile height))*map tile height) + 3) rsx[selected]=mousemtilex rsy[sselected]=mousemtiley sprite selected,rsx[sselected],rsy[sselected],14 delay 500 canvas 0 set pen colour black fill rect 405,180 to 800,200 draw frame rcselected=false rmoveship=false end if if rcshipnum=50 rcshipnum=0 end if if mouse button and mouse x<500 and mouse x>405 and mouse y<310 and mouse y>295 and bmenushow=true rsx[51]=redplanx+45 rsy[51]=redplany+45 delay 1000 canvas 1 rinshipnum=(rinshipnum + 1) set sprite priority rinshipnum,1 sprite rinshipnum,rsx[rinshipnum],rsy[rinshipnum],15 draw frame rc=rc-10 canvas 0 set pen colour black fill rect 405,270 to 600,350 selected=rinshipnum end if end if 'Move Invasion Ship if selected <> -1 and mouse button and mouse x<(rsx[selected]+45) and mouse x>(rsx[selected]) and mouse y<(rsy[selected]+45) and mouse y>(rsy[selected]) and rinselected=false set pen colour black fill rect 550,180 to 700,200 set pen colour make color (255,0,0) draw text 405,195,"You have selceted ship " +as string(selected)+ ", an invasion ship" rinselected=true delay 500 end if if mouse button and rinselected=true canvas 1 sprite off selected int mousemtilex=(((mouse x/map tile width + (x/map tile width))*map tile width) + 3) int mousemtiley=(((mouse y/map tile height + (y/map tile height))*map tile height) + 3) rsx[selected]=mousemtilex rsy[selected]=mousemtiley sprite selected,rsx[selected],rsy[selected],14 delay 500 draw frame rinselected=false end if if rinshipnum=100 rinshipnum=51 end if if mouse button and mouse x<500 and mouse x>405 and mouse y<325 and mouse y>310 and bmenushow=true rsx[101]=redplanx + 53 rsy[101]=redplany + 53 delay 1000 canvas 1 rsshipnum=(rsshipnum + 1) set sprite priority rsshipnum,4 sprite rsshipnum,rsx[rsshipnum],rsy[rsshipnum],16 rc=rc-5 canvas 0 set pen colour black fill rect 405,270 to 600,350 end if if mouse button and mouse x<500 and mouse x>405 and mouse y<340 and mouse y>325 and bmenushow=true rsx[151]=redplanx+46 rsy[151]=redplany+46 delay 1000 canvas 1 rbshipnum=(rbshipnum + 1) set sprite priority rbshipnum,2 sprite rbshipnum,rsx[rbshipnum],rsy[rbshipnum],17 rc=rc-5 canvas 0 set pen colour black fill rect 405,270 to 600,350 end if if mouse button and mouse x<500 and mouse x>405 and mouse y<500 and mouse y>350 selected = Sprite Col(1,2000 to 2100) selected = Sprite Col(2,2000 to 2100) selected = Sprite Col(3,2000 to 2100) selected = Sprite Col(4,2000 to 2100) if selected <> -1 stop music set sprite colour selected,make color(255,0,0) end if turn=2 x=blueplanx-45 y=blueplany-45 delay 1000 moneygiven=false bmenushow=false set pen colour black fill rect 405,270 to 600,350 end if end if if turn=2 if moneygiven=false bc=bc+50 moneygiven=true end if canvas 0 draw picture 203,405,0 draw picture 200,405,0 draw picture 205,405,350 draw picture 203,405,200 draw picture 134,405,200 draw frame set pen colour black fill rect 429,437 to 479,452 fill rect 410,50 to 600,150 set pen colour make color (0,0,255) draw text 430,450,"("+as string(x/map tile width)+","+as string(y/map tile height)+")" draw text 430,100,"You Have " +as string(bc)+ " Credits" if mouse button and mouse x<500 and mouse x>405 and mouse y<500 and mouse y>350 turn=3 x=greenplanx-45 y=greenplany-45 delay 1000 moneygiven=false end if end if if turn=3 if moneygiven=false gc=gc+50 moneygiven=true end if canvas 0 draw picture 203,405,0 draw picture 201,405,0 draw picture 206,405,350 draw picture 203,405,200 draw picture 208,405,200 draw frame set pen colour black fill rect 429,437 to 479,452 fill rect 410,50 to 600,150 set pen colour make color (0,255,0) draw text 430,450,"("+as string(x/map tile width)+","+as string(y/map tile height)+")" draw text 430,100,"You Have " +as string(gc)+ " Credits" if mouse button and mouse x<500 and mouse x>405 and mouse y<500 and mouse y>350 turn=4 y=purpplany-45 x=purpplanx-45 delay 1000 moneygiven=false end if end if if turn=4 if moneygiven=false pc=pc+50 moneygiven=true end if canvas 0 draw picture 203,405,0 draw picture 202,400,0 draw picture 207,405,350 draw picture 203,405,200 draw picture 209,405,200 draw frame set pen colour black fill rect 429,437 to 479,452 fill rect 410,50 to 600,150 set pen colour make color (75,0,100) draw text 430,450,"("+as string(x/map tile width)+","+as string(y/map tile height)+")" draw text 430,100,"You Have " +as string(pc)+ " Credits" if mouse button and mouse x<500 and mouse x>405 and mouse y<500 and mouse y>350 turn=1 x=redplanx-45 y=redplany-45 delay 1000 moneygiven=false end if end if end proc fade down text mode