20 Liners / 50 Liner - DBP - Empire Of The Far Suns - Space Conquest Strategy Game |
| Author | Message | ||
|
IBOL
User Joined: Tue Mar 30th 2004 Location: chair |
Empire Of The Far Suns - Space Conquest Strategy Game created for the 50-line challenge, this game features combat, invasion, and research among the stars, against two hostile alien forces, in an ever-changing galaxy. code as a 50-liner: + Code Snippet
set display mode 1024,768,32 : sync on : sync rate 60 : sync : Randomize Timer() : color backdrop 0 : set text font "lucida console" : set text opaque : for t=1000 to 1300 : make object sphere t,1 : position object t,rnd(500)-250,rnd(500)-250,340+rnd(30) : next t : dim PS(36,11) : dim RP(3,6) : dim TL(3,6) : dim FL(3) : dim TH(36,3) : DIM N$(36) AS STRING : dim w$(5,6) as string : dim CN(2,6)
CREATE_NEW_GAME_HERE: : for i=1 to 36 : if image exist(i) : delete object i : delete image i : endif : next i : RESTORE : for t=1 to 3 : for u=0 to 4 : read a$ : w$(t,u)=a$ : next u : next t : for t=1 to 6 : read a$ : w$(5,t)=a$ : next t : k=rnd(105) : for t=1 to k : read a$ : next t : for t=1 to 36
if object exist(t) : delete object t : endif : next t : IMG=0 : FAIL=0 : for a=1 to 6 : for b=1 to 6 : IF RND(19)<12 : x=a*7-1+rnd(2) : y=b*7-1+rnd(2) : repeat : j=(25+rnd(100))*rnd(2) : k=(25+rnd(100))*rnd(2) : l=(25+rnd(100))*rnd(2) : until (j+k+l)>50 : create bitmap 1,16,16 : ink rgb(j,k,l),0 : box 0,0,15,15 : ink rgb(l,j,k),0 : for t=1 to 5+rnd(3) : c=rnd(9)+2 : d=rnd(9)+2
box c,d,c+1+rnd(3),d+1+rnd(3) : next t : ink rgb(k,l,j),0 : for t=1 to 3+rnd(1) : c=rnd(8)+2 : d=rnd(8)+2 : box c,d,c+1+rnd(4),d+1+rnd(4) : next t : blur bitmap 1,2 : inc IMG : get image img,0,0,15,15 : delete bitmap 1 : make object sphere img,3.3 : texture object img,img : position object img,x,y,37 : rotate object img,rnd(359),rnd(359),rnd(359) : fix object pivot img : PS(img,4)=x : PS(img,5)=y : PS(img,6)=0 : for t=1 to 3 : ps(img,t)=1 : ps(img,t+6)=0
next t : k=rnd(5)+4+(3*(rnd(4)=1)) : for t=1 to k : inc ps(img,(rnd(2)+1)) : next t : inc ps(img,1),(rnd(3)+1) : read a$ : n$(img)=a$ : ENDIF : next b : next a : for t=1 to 3 : repeat : p=rnd(img-1)+1 : until PS(p,6)=0 : PS(p,6)=t : for u=1 to 3 : ps(p,u)=rnd(2)+5 : next u : FL(t)=5 : next t : for t=2 to 3 : for u=1 to 4
inc RP(t,rnd(5)+1),u : next u : next t : for t=1 to 3 : for u=1 to 6 : TL(t,u)=1 : next u : next t : YEAR=2100+RND(2100) : Y1=YEAR : position camera 0,25,30,12 : repeat : until mouseclick()=0 : set camera aspect 1.333 : set camera view 0,0,1024,768 : ink RGB(0,128,192),RGB(128,34,34) : set text size 48 : do : center text 512,200,"Empire Of The Far Suns" : center text 512,300,"Click Mouse To Play"
for i=1 to img : yrotate object i,object angle y(i)+0.5 : next i : sync : if mouseclick() : exit : endif : loop : set text size 16 : set camera aspect 1.0 : set camera view 0,0,600,600 : position camera 0,25,30,0 : Display_State=1 : DO : INC YEAR : if YEAR mod 8 = 0 : for i=1 to img : inc PS(i,1) : inc PS(i,rnd(1)+2) : next i : endif : CurPlay=1
GOSUB INIT_STATE : GOSUB PLAN_VAL_STR : FOR I=1 TO IMG : for OFF=1 to 3 : for DEF=1 to 3 : if OFF<>DEF : if PS(i,6+OFF)>0 and PS(i,6+DEF)>0 : for t=0 to 2 : for u=0 to 6 : CN(t,u)=0 : next u : next t : cn(1,0)=OFF : cn(2,0)=DEF : show=0 : if off=1 or def=1 : show=1 : C=1 : E=2 : if def=1 : C=2 : E=1
endif : endif : round=0 : repeat : inc round : if round=1 : PICK=99 : for t=1 to 2 : cn(t,1)=ps(i,6+cn(t,0)) : cn(t,2)=cn(t,1)*(6+(2*int(sqrt(TL(cn(t,0),4))))) : cn(t,4)=rnd(2)+1 : cn(t,5)=rnd(2)+1 : cn(t,6)=1 : for u=2 to 3 : if TL(cn(t,0),u)>TL(cn(t,0),cn(t,6)) : cn(t,6)=u : endif : next u : next t
else : for t=1 to 2 : PICK=1 : if cn(t,2)>0 : cn(t,1)=(cn(t,2) / (6+(2*int(sqrt(TL(cn(t,0),4))))))+1 : else : cn(t,1)=0 : endif : next t : for t=1 to 2 : if cn(t,0)>1 : if rnd(4)<4 : cn(t,rnd(1)+4)=rnd(2)+1 : endif : endif : next t : endif : IF CN(1,1)>0 AND CN(2,1)>0 : IF SHOW=1 : repeat : until mouseclick()=0 : DO
cls rgb(20,20,70) : center text 512,60," COMBAT AT "+N$(I)+" " : center text 512,80," ROUND # "+STR$(ROUND)+" " : text 300,120," You have "+str$(CN(c,1))+" Ships " : text 300,140," Player "+str$(cn(e,0))+" has "+str$(CN(e,1))+" Ships " : text 300,160," Give Your Fleet Orders ("+str$(PICK)+") " : for t=1 to 3 : text 200,100+100*t,w$(t,0)+":" : for u=1 to 3 : a$=w$(t,u) : if cn(c,t+3)=u : a$=upper$(" *"+a$+"* ") : endif : text 300,100+100*t+(u-1)*20,a$ : next u : next t : text 400,500," ENGAGE " : if mouseclick()=1 : if mousex()>199 and mousex()<420 : L=(mousey()-100)/100 : V=1+(mousey()-(100+L*100))/20
if L>0 and L<4 : if v>0 and V<4 : cn(c,L+3)=V : Dec PICK : repeat : until mouseclick()=0 : endif : endif : endif : IF mousey()>495 and mousey()<525 : if mousex()>300 and mousex()<500 : EXIT : endif : ENDIF : endif : sync : if PICK<1 : wait 500 : EXIT : endif : loop : ENDIF : for t=1 to 2
d=(int(sqrt(TL(cn(t,0),cn(t,6))))+2)*cn(t,1) : cn(t,3)=(d+rnd(d))*0.55 : next t : for t=1 to 3 : w$(4,t)="" : next t : for t=4 to 6 : if (cn(1,t)=1 and cn(2,t)=2 ) OR (cn(1,t)=2 and cn(2,t)=3 ) OR (cn(1,t)=3 and cn(2,t)=1 ) : DEC cn(2,3),((cn(2,3)/10)+1) : w$(4,t-3)=" Player "+str$(cn(1,0))+" has the advantage in "+w$(t-3)+" " : endif : next t : for t=4 to 6 : if (cn(2,t)=1 and cn(1,t)=2 ) OR (cn(2,t)=2 and cn(1,t)=3 ) OR (cn(2,t)=3 and cn(1,t)=1 ) : DEC cn(1,3),((cn(1,3)/10)+1) : w$(4,t-3)=" Player "+str$(cn(2,0))+" has the advantage in "+w$(t-3)+" " : endif : next t
IF SHOW=0 : dec cn(1,2),cn(2,3) : dec cn(2,2),cn(1,3) : ELSE : repeat : cls rgb(20,20,70) : center text 512,60," COMBAT AT "+N$(I)+" " : center text 512,80," ROUND # "+STR$(ROUND)+" " : for t=1 to 2 : if cn(t,2)>0 : cn(t,1)=(cn(t,2) / (6+(2*int(sqrt(TL(cn(t,0),4))))))+1 : else : cn(t,1)=0 : endif : next t : for t=1 to 2 : text (t-1)*400+100,100," Player "+str$(cn(t,0)) : text (t-1)*400+100,120," Ships : "+str$(cn(t,1)) : text (t-1)*400+100,140," Hull Points : "+str$(cn(t,2))
for u=1 to 3 : text (t-1)*400+100,160+u*20,w$(u,0)+" : "+w$(u,cn(t,u+3)) : next u : next t : for t=1 to 3 : if w$(4,t)<>"" : text 300,330+t*20,w$(4,t) : endif : next t : text 400,500," CONTINUE " : sync : if cn(1,3)>0 : dec cn(2,2) : dec cn(1,3) : endif : if cn(2,3)>0 : dec cn(1,2) : dec cn(2,3) : endif : until ( cn(2,3)<1 and cn(1,3)<1 ) OR cn(2,2)<0 or cn(1,2)<0 : DO : if mouseclick()
IF mousey()>495 and mousey()<525 : if mousex()>300 and mousex()<500 : EXIT : endif : ENDIF : endif : LOOP : ENDIF : ENDIF : until CN(1,1)=0 or CN(2,1)=0 : FOR T=1 TO 2 : PS(I,6+CN(T,0))=CN(T,1) : NEXT T : endif : endif : next DEF : next OFF : NEXT I : for t=1 to img : inc FL(ps(T,6)),PS(T,2) : next t : FL(0)=0 : YES=0
for t=1 to img : if ps(t,7)>=PS(T,11) : yes=1 : endif : next t : if yes=1 : COL_PHASE=1 : GOSUB INIT_STATE : GOSUB PLAN_VAL_STR : do : GOSUB SCREEN_SUBROUTINE : center text 812,24," COLONIZATION PHASE " : center text 812,64," Right Click Circled Planet To Colonize " : CENTER TEXT 812,84," DONE " : if mouseclick()=2 : T=pick object(mousex(),mousey(),1,img) : if t>0 and t<=img : if ps(t,6)<>1 : if ps(t,7)>=PS(T,11) : dec ps(t,7),PS(T,11) : ps(t,6)=1 : GOSUB PLAN_VAL_STR
endif : endif : endif : endif : if mouseclick()=1 : if mousey()>84 and mousey()<104 : if mousex()>780 and mousex()<844 : EXIT : endif : endif : endif : sync : loop : COL_PHASE=0 : endif : e=0 : FOR I=1 TO IMG : if PS(i,6)>1 : inc e : endif : NEXT I : IF e=0 : repeat
until mouseclick()=0 : CLS RGB(20,20,70) : set text size 48 : center text 512,200," YOU WIN! " : center text 512,280," YOU BUILT THE SUPREME EMPIRE " : center text 512,328," IN "+STR$(YEAR-Y1)+" YEARS! " : center text 512,400," Click Mouse To Play Again " : center text 512,450," Or Hit Escape Key To Quit " : sync : wait mouse : GOTO CREATE_NEW_GAME_HERE : ENDIF : FOR P=2 TO 3 : CurPlay=P : GOSUB INIT_STATE : for i=1 to img : if ps(i,6)<>P : if ps(i,6+P)>=PS(I,11) : if ps(i,7)<1 AND ( ( p=2 and ps(i,9)<1 ) OR ( p=3 and ps(i,8)<1 ) ) : dec ps(i,6+P),PS(I,11) : if ps(i,6)=1
CLS RGB(20,20,70) : center text 512,240+rnd(20)," Player "+str$(P)+" Invaded Your Colony At "+n$(i)+" " : sync : wait 2500 : endif : ps(i,6)=P : GOSUB PLAN_VAL_STR : endif : endif : endif : next i : NEXT P : e=0 : FOR I=1 TO IMG : if PS(i,6)=1 : inc e : endif : NEXT I : IF e=0
YOU_LOST_THE_GAME: : repeat : until mouseclick()=0 : CLS RGB(20,20,70) : set text size 48 : center text 512,200," YOU HAVE BEEN DEFEATED! " : center text 512,400," Click Mouse To Play Again " : center text 512,450," Or Hit Escape Key To Quit " : sync : wait mouse : GOTO CREATE_NEW_GAME_HERE : ENDIF : GOSUB PLAN_VAL_STR : CurPlay=1 : for t=1 to img : if ps(t,7)>0 : inc FL(1),ps(t,7) : ps(t,7)=0 : endif : next t : GOSUB INIT_STATE : GOSUB PLAN_VAL_STR : REPEAT : GOSUB SCREEN_SUBROUTINE
center text 812,24," MOVEMENT PHASE " : center text 812,64," Left Click Planet To Add 1 Ship " : center text 812,84," Right Click To Add 5 " : center text 812,264," "+str$(FL(1))+" Ships Left " : if mouseclick() : T=pick object(mousex(),mousey(),1,img) : if t>0 and t<=img : if object visible(t) : N=1 : if mouseclick()=2 AND fl(1)>4 : N=5 : endif : dec FL(1),n : inc PS(t,7),n : wait 125 : endif : endif : endif : SYNC : UNTIL FL(1)<1 : wait 250 : GOSUB INIT_STATE : GOSUB PLAN_VAL_STR
P=0 : for t=1 to img : if ps(t,6)=1 : inc P,ps(t,3) : endif : next t : REPEAT : GOSUB SCREEN_SUBROUTINE : center text 812,24," RESEARCH PHASE " : center text 812,64," Click To Add Points " : center text 812,84," "+str$(P)+" Points Left " : if mouseclick() : if mousex()>612 and mousex()<750 : y=(mousey()/20)-5 : if y>0 and y<7 : s=(P/25)+1 : dec P,s : Inc TL(1,y),s : wait 125 : endif : endif : endif
for t=1 to 6 : text 612,100+t*20,w$(5,t)+STR$(TL(1,t))+" ("+str$(INT(SQRT(TL(1,t))))+") " : next t : sync : UNTIL P<1 : wait 250 : FOR P=2 TO 3 : alive=0 : for i=1 to img : if ps(i,6)=P : alive=1 : endif : next i : if alive=0 : fl(p)=0 : for i=1 to img : ps(i,6+P)=0 : next i : endif : IF ALIVE=1 : CurPlay=P
GOSUB INIT_STATE : GOSUB PLAN_VAL_STR : for t=1 to img : if ps(t,6+P)>0 : inc FL(P),ps(t,6+P) : ps(t,6+P)=0 : endif : next t : for i=1 to img : for j=0 to 3 : th(i,j)=0 : next j : TH(I,1) = (ps(I,10)*100) / ps(I,11) : if ps(i,6)=0 : TH(I,1)=TH(I,1)*2.2 : endif : if object visible(i) : if FL(P)>=PS(i,11) AND PS(i,6)<>P : th(i,3)=1 : endif : endif : next i : F=FL(P)
fail=0 : while f>0 : TAR=0 : QUO=0 : for i=1 to img : if rnd(2)<2 : if th(i,3)=1 : if f>=ps(i,11) : if ps(i,6+P)<7 : if TH(I,1)>QUO : QUO=TH(I,1) : TAR=I : endif : endif : endif : endif : endif : next i : if tar>0 and quo>0 : ps(TAR,6+p)=ps(TAR,11) : dec f,ps(TAR,11) : x=rnd(f/2) : inc ps(TAR,6+p),x
dec f,x : endif : if fail>25 : repeat : if f>0 : x=rnd(img-1)+1 : if PS(x,6)=P : inc ps(x,6+P) : dec F : endif : endif : until f<1 : endif : INC FAIL : endwhile : FL(p)=0 : RP=0 : for t=1 to img : if ps(t,6)=P : inc RP,ps(t,3) : endif : next t : TRP=RP
nav=1 : vis=0 : for i=1 to img : if object visible(i) : inc vis : if ps(i,6)<>P : nav=0 : endif : endif : next i : if vis>=img OR TL(P,6)>48 : nav=0 : endif : IF NAV=1 : inc TL(P,6),RP : RP=0 : TRP=0 : ELSE : for a=1 to 5 : Z=(RP(P,a)*10*TRP)/100 : inc TL(P,A),Z : dec RP,Z : next a
while RP>0 : a=rnd(4)+1 : inc TL(P,A) : dec RP : endwhile : ENDIF : ENDIF : NEXT P : LOOP : END
SCREEN_SUBROUTINE: : if Display_State=2 : set text size 12 : endif : if Display_State=3 : set text size 14 : endif : for tt=1 to img : IF OBJECT VISIBLE(tT) : yrotate object tt,object angle y(tt)+0.35 : ox=object screen x(tt)*0.586 : oy=object screen y(tt)*0.781 : if Display_State=1 : center text ox,oy-18,n$(tt) : if PS(Tt,6)>0 : center text ox,oy," "+str$(PS(Tt,6))+" " : endif : endif : if Display_State=2
center text ox,oy-21," P: "+str$((ps(tt,1)))+" " : center text ox,oy-9," F: "+str$((ps(tt,2)))+" " : center text ox,oy+3," R: "+str$((ps(tt,3)))+" " : center text ox,oy+15," S: "+str$( ps(tt,11) )+" " : endif : if Display_State=3 : center text ox,oy-18," 1: "+str$((PS(tt,7)))+" " : center text ox,oy-6," 2: "+str$((PS(tt,8)))+" " : center text ox,oy+6," 3: "+str$((PS(tt,9)))+" " : endif : if COL_PHASE=1 : if ps(tt,6)<>1 : if ps(tt,7)>=ps(tt,11) : IF ps(tt,8)<1 and ps(tt,9)<1 : circle ox,oy,26 : circle ox,oy,27 : circle ox,oy,28 : ENDIF : endif : endif
endif : ENDIF : next tt : set text size 16 : if mouseclick()=1 : mx=mousex() : my=mousey() : IF MY>740 : IF MX>712 AND MX<912 : GOTO YOU_LOST_THE_GAME : ENDIF :ENDIF : if my>604 and my<620 : Display_State=0 : if mx>165 and mx<235 : Display_State=1 : endif : if mx>265 and mx<335 : Display_State=2 : endif : if mx>365 and mx<435 : Display_State=3
endif : endif : endif : ink rgb(20,20,70),0 : box 0,600,1024,768 : box 600,0,1024,768 : ink RGB(0,128,192),RGB(128,34,34) : line 0,0,1024,0 : line 0,0,0,768 : line 600,0,600,600 : line 0,600,601,600 : line 0,767,1024,767 : line 1023,0,1023,767 : center text 200,604," OWNER " : center text 300,604," STATS " : center text 400,604," FLEET " : CENTER TEXT 812,740," * SURRENDER * " : for tt=1 to 3 : text (tt-1)*150+112,650,w$(tt,4) : text 44,650+tt*20," "+str$(tt)+" "
next tt : for tt=1 to 3 : for uu=0 to 6 : tl(0,uu)=0 : next uu : for ii=1 to img : if PS(ii,6)=tt : for uu=1 to 3 : inc tl(0,uu),ps(ii,uu) : next uu : endif : next ii : for uu=1 to 3 : text (uu-1)*150+112,650+tt*20,str$(tl(0,uu)) : next uu : next tt : center text 812,44," Year : "+str$(year)+" " : RETURN
PLAN_VAL_STR: : FOR T=1 TO IMG : PS(T,10)=(ps(t,2)+ps(t,3)) : PS(T,11)=ps(t,1)+PS(T,10)+((ps(t,6)>0)*int(SQRT(TL(ps(t,6),5)))) : NEXT T : RETURN
INIT_STATE: : range=( 6+ (SQRT(TL(CurPlay,6))*3) ) : for t=1 to img : hide object t : next t : for t=1 to img : if ps(t,6)=CurPlay : show object t : for u=1 to img : if (abs(ps(u,4)-ps(t,4))+abs(ps(u,5)-ps(t,5)))<range : show object u : endif : next u : endif : next t : RETURN
data "STRATEGY","Fighter Attack","Battleship Firepower","Destroyer Maneuver","POPULATION","FORMATION","Hexagon","Wing","Zig-Zag","SHIPYARDS","WEAPON","Beams","Missiles","Mines","RESEARCH"," BEAMS: "," MISSILES: "," MINES: "," DEFENSE: "," TROOPS: "," NAVIGATION: "
DATA "Inora","Ixat","Sicogu","Iraga","Tethia","Zelopol","Chigor","Alsapha","Ataxon","Inzaras","Ulsulus","Venuxi","Lyapht","Dmuren","Inx","Sirces","Icogol","Darisul","Vugi","Zentili","Kotolro","Ioturon","Kadic","Jogoth"
DATA "Epran","Heraph","Mesga","Orazar","Sirukur","Pryus","Duoni","Kasoria","Tunephi","Etacion","Usomi","Eadi","Darsag","Ulicon","Clyus","Oxus","Rulko","Hayx","Oszri","Azarosa","Betu","Mirnath","Kimuri","Denigal"
DATA "Ondisa","Quordas","Usbeda","Uphrama","Hados","Orunath","Iliau","Joruk","Wrackur","Psani","Corigar","Rhefac","Silsha","Rafiad","Kemiron","Maryda","Izreus","Cibra","Argen","Nirodu","Astaka","Bhezar","Inconis","Delomec"
DATA "Idaros","Chromad","Misurud","Cornath","Vhudia","Jalyria","Onpha","Chiphan","Talux","Rasoron","Forani","Animir","Sildar","Koryl","Uronze","Mindara","Imiosc","Dargi","Daceron","Irasa","Cliurna","Iskande","Heralis"
DATA "Ebudri","Enicon","Uprogol","Eprusil","Tanir","Vagen","Prinath","Entaghi","Mizraga","Gisima","Irami","Ineax","Ontau","Regiden","Yirigi","Mayisa","Alera","Targesa","Masilus","Osreba","Tazuron","Detha","Tazaros","Rosmir"
DATA "Sirnami","Turnema","Askendi","Altoven","Ormiga","Mirius","Magmada","Necersi","Onumen","Ymbecri","Forturi","Scheda","Shiri","Cigen","Agemna","Rukani","Idmar","Cequum","Gaezann","Yenchak","Nepanus","Aethia"
Readme & Instructions: + Code Snippet Empire Of The Far Suns By Bob Saunders This is a strategy game of space conquest, programmed in Dark Basic Professional for the 50-line challenge. The challenge rules state that you may use up to 25 commands per line. EOTFS uses only 43 lines, with a maximum of 24 commands per line (average=21). The program requires no external media; it creates its own. [] Gameplay proceeds until you are destroyed, or both enemies are defeated, or until you surrender or quit (escape key). No two games are ever alike. The planets have different names, appearances, and locations every time. AI players have different research priorities every time, and they are focused, not random distribution. AIs also choose targets intelligently, but with enough randomness to provide a challenge. [] DISPLAY: The majority of the screen (upper left) shows all the planets that you can reach. You may choose to view them by OWNER, STATS, or FLEETS. -Owner shows the NAME of the planet and the NUMBER of the player that owns it, if any. -Stats shows P/F/R/S for the planet. These stand for Population - a relative measure of the number of inhabitants. Fleet - how many new ships the planet can produce per year. Research - how many "Research Points" the planet produces per year. Strength - how many ships you would need to land to colonize (or invade) the planet. -Fleet display shows how many ships each player has in that star system. Usually 0. The rest of the display is taken up by whatever is necessary for the current "PHASE", and a running tally of the relative holdings of each player. [] The game is played in "Phases" that comprise each turn (or year). PHASE 1: COLONIZATION --------------------- If you have enough ships at a planet to colonize (or invade) it, you may choose to do so. 'Enough' is greater than or equal to that planet's Strength. (under STAT display, the last number, labeled 'S:' ). Right click any circled planet to colonize, then hit "DONE" at upper right. PHASE 2: MOVEMENT ----------------- At the beginning of the movement phase, all of your ships are taken from wherever they are, and put into a "pool". You may then send any ships anywhere within your navigation range. They will arrive at the beginning of the next turn. This is how you colonize planets, and ultimately defeat your enemy's fleets. PHASE 3: RESEARCH ----------------- During this phase, you take the combined scientific power of your empire and apply it to 6 different areas of technology. Beams, Missiles, and Mines are 3 weapons technologies. Higher levels increase damage. Defense tech increases how much damage your ships can take before being destroyed. Troop tech increases the number of ships an invading force needs to take your worlds. Navigation tech increases how far your ships can travel. PHASE 4: COMBAT --------------- Combat occurs any time 2 or more players have ships orbiting the same planet. You have 3 decisions to make during the first round of combat. Strategy, Formation, and Weapon. No single choice is absolutely better than another. instead, they interact in a rock-scissors-paper manner. STRATEGY: Battleship Firepower, Destroyer Maneuver , Fighter Attack FORMATION: Hexagon, Wing, Zig-Zag WEAPON: Beams, Missiles, Mines The 1st beats the 2nd, the 2nd beats the 3rd, and the 3rd beats the 1st. Having advantage in one of these areas decreases the amount of damage your ships will take. NOTE that since weapons have a "Tech Level", it would be better to use L7 Beams instead of L2 missiles, even if your oponent were using Mines (which "beat" beams). During the SECOND and all subsequent rounds of a single combat, you may only change ONE of the 3 choices about your fleet's tactics per round. Combat continues until one side is destroyed. There is no retreat. [] A final note on the code of the game: The 50 line / 25 command rule imposes interesting challenges in programming a DBP game. Common structures like user defined types and functions will not compile on a single line (in my version). So a lot of what-means-what must be kept in the programmers head, and the cluttered MAIN() becomes the norm. Do NOT take my coding methods as the best idea for all situations. Nevertheless, this is a great game (IMHO) for the limitations. if you are running dbp 6.2 or above, i recommend this code: + Code Snippet
set display mode 1024,768,32 : sync on : sync rate 60 : sync : Randomize Timer() : color backdrop 0 : set text font "lucida console" : set text opaque : for t=1000 to 1300 : make object sphere t,1 : position object t,rnd(500)-250,rnd(500)-250,340+rnd(30) : next t : dim PS(36,11) : dim RP(3,6) : dim TL(3,6) : dim FL(3) : dim TH(36,3) : DIM N$(36) AS STRING : dim w$(5,6) as string : dim CN(2,6) : dim BC(6) as BYTE
for t=1 to 6 : bc(t)=80+rnd(9)*5 : next t : set text size 16 : do : cls rgb(BC(1),BC(2),BC(3)) : ink RGB(0,128,192),rgb(BC(4),BC(5),BC(6)) : center text 512,100," SCREEN COLOR MODIFIER " : center text 512,140," Mouse-Over the color you want to change" : center text 512,160," roll mouse wheel to change that component " : center text 512,180," PRESS ANY KEY WHEN YOU ARE FINISHED " : CENTER text 200,280," Background Screen Color " : CENTER text 800,280," Text Background Color " : for t=0 to 1 : CENTER text 200+t*600,300," RED "+STR$(BC(T*3+1))
CENTER text 200+t*600,320," GREEN "+STR$(BC(T*3+2)) : CENTER text 200+t*600,340," BLUE "+STR$(BC(T*3+3)) : next t : z=mousemovez() : z=(z/abs(z))*5 : y=(mousey()-280)/20 : x=mousex() : if y>0 and y<4 : if x>150 and x<250 : bc(y)=bc(y)+z : endif : if x>750 and x<850 : bc(y+3)=bc(y+3)+z : endif : endif : sync : IF SCANCODE() :EXIT : ENDIF : loop
CREATE_NEW_GAME_HERE: : for i=1 to 36 : if image exist(i) : delete object i : delete image i : endif : next i : RESTORE : for t=1 to 3 : for u=0 to 4 : read a$ : w$(t,u)=a$ : next u : next t : for t=1 to 6 : read a$ : w$(5,t)=a$ : next t : k=rnd(105) : for t=1 to k : read a$ : next t : for t=1 to 36
if object exist(t) : delete object t : endif : next t : IMG=0 : FAIL=0 : for a=1 to 6 : for b=1 to 6 : IF RND(19)<12 : x=a*7-1+rnd(2) : y=b*7-1+rnd(2) : repeat : j=(25+rnd(100))*rnd(2) : k=(25+rnd(100))*rnd(2) : l=(25+rnd(100))*rnd(2) : until (j+k+l)>50 : create bitmap 1,16,16 : ink rgb(j,k,l),0 : box 0,0,15,15 : ink rgb(l,j,k),0 : for t=1 to 5+rnd(3) : c=rnd(9)+2 : d=rnd(9)+2
box c,d,c+1+rnd(3),d+1+rnd(3) : next t : ink rgb(k,l,j),0 : for t=1 to 3+rnd(1) : c=rnd(8)+2 : d=rnd(8)+2 : box c,d,c+1+rnd(4),d+1+rnd(4) : next t : blur bitmap 1,2 : inc IMG : get image img,0,0,15,15 : delete bitmap 1 : make object sphere img,3.3 : texture object img,img : position object img,x,y,37 : rotate object img,rnd(359),rnd(359),rnd(359) : fix object pivot img : PS(img,4)=x : PS(img,5)=y : PS(img,6)=0 : for t=1 to 3 : ps(img,t)=1 : ps(img,t+6)=0
next t : k=rnd(5)+4+(3*(rnd(4)=1)) : for t=1 to k : inc ps(img,(rnd(2)+1)) : next t : inc ps(img,1),(rnd(3)+1) : read a$ : n$(img)=a$ : ENDIF : next b : next a : for t=1 to 3 : repeat : p=rnd(img-1)+1 : until PS(p,6)=0 : PS(p,6)=t : for u=1 to 3 : ps(p,u)=rnd(2)+5 : next u : FL(t)=5 : next t : for t=2 to 3 : for u=1 to 4
inc RP(t,rnd(5)+1),u : next u : next t : for t=1 to 3 : for u=1 to 6 : TL(t,u)=1 : next u : next t : YEAR=2100+RND(2100) : Y1=YEAR : position camera 0,25,30,12 : repeat : until mouseclick()=0 : set camera aspect 1.333 : set camera view 0,0,1024,768 : ink RGB(0,128,192),rgb(BC(4),BC(5),BC(6)) : set text size 48 : do : center text 512,200,"Empire Of The Far Suns" : center text 512,300,"Click Mouse To Play"
for i=1 to img : yrotate object i,object angle y(i)+0.5 : next i : sync : if mouseclick() : exit : endif : loop : set text size 16 : set camera aspect 1.0 : set camera view 0,0,600,600 : position camera 0,25,30,0 : Display_State=1 : DO : INC YEAR : if YEAR mod 8 = 0 : for i=1 to img : inc PS(i,1) : inc PS(i,rnd(1)+2) : next i : endif : CurPlay=1
GOSUB INIT_STATE : GOSUB PLAN_VAL_STR : FOR I=1 TO IMG : for OFF=1 to 3 : for DEF=1 to 3 : if OFF<>DEF : if PS(i,6+OFF)>0 and PS(i,6+DEF)>0 : for t=0 to 2 : for u=0 to 6 : CN(t,u)=0 : next u : next t : cn(1,0)=OFF : cn(2,0)=DEF : show=0 : if off=1 or def=1 : show=1 : C=1 : E=2 : if def=1 : C=2 : E=1
endif : endif : round=0 : repeat : inc round : if round=1 : PICK=99 : for t=1 to 2 : cn(t,1)=ps(i,6+cn(t,0)) : cn(t,2)=cn(t,1)*(6+(2*int(sqrt(TL(cn(t,0),4))))) : cn(t,4)=rnd(2)+1 : cn(t,5)=rnd(2)+1 : cn(t,6)=1 : for u=2 to 3 : if TL(cn(t,0),u)>TL(cn(t,0),cn(t,6)) : cn(t,6)=u : endif : next u : next t
else : for t=1 to 2 : PICK=1 : if cn(t,2)>0 : cn(t,1)=(cn(t,2) / (6+(2*int(sqrt(TL(cn(t,0),4))))))+1 : else : cn(t,1)=0 : endif : next t : for t=1 to 2 : if cn(t,0)>1 : if rnd(4)<4 : cn(t,rnd(1)+4)=rnd(2)+1 : endif : endif : next t : endif : IF CN(1,1)>0 AND CN(2,1)>0 : IF SHOW=1 : repeat : until mouseclick()=0 : DO
cls RGB(bc(1),bc(2),bc(3)) : center text 512,60," COMBAT AT "+N$(I)+" " : center text 512,80," ROUND # "+STR$(ROUND)+" " : text 300,120," You have "+str$(CN(c,1))+" Ships " : text 300,140," Player "+str$(cn(e,0))+" has "+str$(CN(e,1))+" Ships " : text 300,160," Give Your Fleet Orders ("+str$(PICK)+") " : for t=1 to 3 : text 200,100+100*t,w$(t,0)+":" : for u=1 to 3 : a$=w$(t,u) : if cn(c,t+3)=u : a$=upper$(" *"+a$+"* ") : endif : text 300,100+100*t+(u-1)*20,a$ : next u : next t : text 400,500," ENGAGE " : if mouseclick()=1 : if mousex()>199 and mousex()<420 : L=(mousey()-100)/100 : V=1+(mousey()-(100+L*100))/20
if L>0 and L<4 : if v>0 and V<4 : cn(c,L+3)=V : Dec PICK : repeat : until mouseclick()=0 : endif : endif : endif : IF mousey()>495 and mousey()<525 : if mousex()>300 and mousex()<500 : EXIT : endif : ENDIF : endif : sync : if PICK<1 : wait 500 : EXIT : endif : loop : ENDIF : for t=1 to 2
d=(int(sqrt(TL(cn(t,0),cn(t,6))))+2)*cn(t,1) : cn(t,3)=(d+rnd(d))*0.55 : next t : for t=1 to 3 : w$(4,t)="" : next t : for t=4 to 6 : if (cn(1,t)=1 and cn(2,t)=2 ) OR (cn(1,t)=2 and cn(2,t)=3 ) OR (cn(1,t)=3 and cn(2,t)=1 ) : DEC cn(2,3),((cn(2,3)/10)+1) : w$(4,t-3)=" Player "+str$(cn(1,0))+" has the advantage in "+w$(t-3)+" " : endif : next t : for t=4 to 6 : if (cn(2,t)=1 and cn(1,t)=2 ) OR (cn(2,t)=2 and cn(1,t)=3 ) OR (cn(2,t)=3 and cn(1,t)=1 ) : DEC cn(1,3),((cn(1,3)/10)+1) : w$(4,t-3)=" Player "+str$(cn(2,0))+" has the advantage in "+w$(t-3)+" " : endif : next t
IF SHOW=0 : dec cn(1,2),cn(2,3) : dec cn(2,2),cn(1,3) : ELSE : repeat : cls RGB(bc(1),bc(2),bc(3)) : center text 512,60," COMBAT AT "+N$(I)+" " : center text 512,80," ROUND # "+STR$(ROUND)+" " : for t=1 to 2 : if cn(t,2)>0 : cn(t,1)=(cn(t,2) / (6+(2*int(sqrt(TL(cn(t,0),4))))))+1 : else : cn(t,1)=0 : endif : next t : for t=1 to 2 : text (t-1)*400+100,100," Player "+str$(cn(t,0)) : text (t-1)*400+100,120," Ships : "+str$(cn(t,1)) : text (t-1)*400+100,140," Hull Points : "+str$(cn(t,2))
for u=1 to 3 : text (t-1)*400+100,160+u*20,w$(u,0)+" : "+w$(u,cn(t,u+3)) : next u : next t : for t=1 to 3 : if w$(4,t)<>"" : text 300,330+t*20,w$(4,t) : endif : next t : text 400,500," CONTINUE " : sync : if cn(1,3)>0 : dec cn(2,2) : dec cn(1,3) : endif : if cn(2,3)>0 : dec cn(1,2) : dec cn(2,3) : endif : until ( cn(2,3)<1 and cn(1,3)<1 ) OR cn(2,2)<0 or cn(1,2)<0 : DO : if mouseclick()
IF mousey()>495 and mousey()<525 : if mousex()>300 and mousex()<500 : EXIT : endif : ENDIF : endif : LOOP : ENDIF : ENDIF : until CN(1,1)=0 or CN(2,1)=0 : FOR T=1 TO 2 : PS(I,6+CN(T,0))=CN(T,1) : NEXT T : endif : endif : next DEF : next OFF : NEXT I : for t=1 to img : inc FL(ps(T,6)),PS(T,2) : next t : FL(0)=0 : YES=0
for t=1 to img : if ps(t,7)>=PS(T,11) : yes=1 : endif : next t : if yes=1 : COL_PHASE=1 : GOSUB INIT_STATE : GOSUB PLAN_VAL_STR : do : GOSUB SCREEN_SUBROUTINE : center text 812,24," COLONIZATION PHASE " : center text 812,64," Right Click Circled Planet To Colonize " : CENTER TEXT 812,84," DONE " : if mouseclick()=2 : T=pick object(mousex(),mousey(),1,img) : if t>0 and t<=img : if ps(t,6)<>1 : if ps(t,7)>=PS(T,11) : dec ps(t,7),PS(T,11) : ps(t,6)=1 : GOSUB PLAN_VAL_STR
endif : endif : endif : endif : if mouseclick()=1 : if mousey()>84 and mousey()<104 : if mousex()>780 and mousex()<844 : EXIT : endif : endif : endif : sync : loop : COL_PHASE=0 : endif : e=0 : FOR I=1 TO IMG : if PS(i,6)>1 : inc e : endif : NEXT I : IF e=0 : repeat
until mouseclick()=0 : CLS RGB(bc(1),bc(2),bc(3)) : set text size 48 : center text 512,200," YOU WIN! " : center text 512,280," YOU BUILT THE SUPREME EMPIRE " : center text 512,328," IN "+STR$(YEAR-Y1)+" YEARS! " : center text 512,400," Click Mouse To Play Again " : center text 512,450," Or Hit Escape Key To Quit " : sync : wait mouse : GOTO CREATE_NEW_GAME_HERE : ENDIF : FOR P=2 TO 3 : CurPlay=P : GOSUB INIT_STATE : for i=1 to img : if ps(i,6)<>P : if ps(i,6+P)>=PS(I,11) : if ps(i,7)<1 AND ( ( p=2 and ps(i,9)<1 ) OR ( p=3 and ps(i,8)<1 ) ) : dec ps(i,6+P),PS(I,11) : if ps(i,6)=1
CLS RGB(bc(1),bc(2),bc(3)) : center text 512,240+rnd(20)," Player "+str$(P)+" Invaded Your Colony At "+n$(i)+" " : sync : wait 2500 : endif : ps(i,6)=P : GOSUB PLAN_VAL_STR : endif : endif : endif : next i : NEXT P : e=0 : FOR I=1 TO IMG : if PS(i,6)=1 : inc e : endif : NEXT I : IF e=0
YOU_LOST_THE_GAME: : repeat : until mouseclick()=0 : CLS RGB(bc(1),bc(2),bc(3)) : set text size 48 : center text 512,200," YOU HAVE BEEN DEFEATED! " : center text 512,400," Click Mouse To Play Again " : center text 512,450," Or Hit Escape Key To Quit " : sync : wait mouse : GOTO CREATE_NEW_GAME_HERE : ENDIF : GOSUB PLAN_VAL_STR : CurPlay=1 : for t=1 to img : if ps(t,7)>0 : inc FL(1),ps(t,7) : ps(t,7)=0 : endif : next t : GOSUB INIT_STATE : GOSUB PLAN_VAL_STR : REPEAT : GOSUB SCREEN_SUBROUTINE
center text 812,24," MOVEMENT PHASE " : center text 812,64," Left Click Planet To Add 1 Ship " : center text 812,84," Right Click To Add 5 " : center text 812,264," "+str$(FL(1))+" Ships Left " : if mouseclick() : T=pick object(mousex(),mousey(),1,img) : if t>0 and t<=img : if object visible(t) : N=1 : if mouseclick()=2 AND fl(1)>4 : N=5 : endif : dec FL(1),n : inc PS(t,7),n : wait 125 : endif : endif : endif : SYNC : UNTIL FL(1)<1 : wait 250 : GOSUB INIT_STATE : GOSUB PLAN_VAL_STR
P=0 : for t=1 to img : if ps(t,6)=1 : inc P,ps(t,3) : endif : next t : REPEAT : GOSUB SCREEN_SUBROUTINE : center text 812,24," RESEARCH PHASE " : center text 812,64," Click To Add Points " : center text 812,84," "+str$(P)+" Points Left " : if mouseclick() : if mousex()>612 and mousex()<750 : y=(mousey()/20)-5 : if y>0 and y<7 : s=(P/25)+1 : dec P,s : Inc TL(1,y),s : wait 125 : endif : endif : endif
for t=1 to 6 : text 612,100+t*20,w$(5,t)+STR$(TL(1,t))+" ("+str$(INT(SQRT(TL(1,t))))+") " : next t : sync : UNTIL P<1 : wait 250 : FOR P=2 TO 3 : alive=0 : for i=1 to img : if ps(i,6)=P : alive=1 : endif : next i : if alive=0 : fl(p)=0 : for i=1 to img : ps(i,6+P)=0 : next i : endif : IF ALIVE=1 : CurPlay=P
GOSUB INIT_STATE : GOSUB PLAN_VAL_STR : for t=1 to img : if ps(t,6+P)>0 : inc FL(P),ps(t,6+P) : ps(t,6+P)=0 : endif : next t : for i=1 to img : for j=0 to 3 : th(i,j)=0 : next j : TH(I,1) = (ps(I,10)*100) / ps(I,11) : if ps(i,6)=0 : TH(I,1)=TH(I,1)*2.2 : endif : if object visible(i) : if FL(P)>=PS(i,11) AND PS(i,6)<>P : th(i,3)=1 : endif : endif : next i : F=FL(P)
fail=0 : while f>0 : TAR=0 : QUO=0 : for i=1 to img : if rnd(2)<2 : if th(i,3)=1 : if f>=ps(i,11) : if ps(i,6+P)<7 : if TH(I,1)>QUO : QUO=TH(I,1) : TAR=I : endif : endif : endif : endif : endif : next i : if tar>0 and quo>0 : ps(TAR,6+p)=ps(TAR,11) : dec f,ps(TAR,11) : x=rnd(f/2) : inc ps(TAR,6+p),x
dec f,x : endif : if fail>25 : repeat : if f>0 : x=rnd(img-1)+1 : if PS(x,6)=P : inc ps(x,6+P) : dec F : endif : endif : until f<1 : endif : INC FAIL : endwhile : FL(p)=0 : RP=0 : for t=1 to img : if ps(t,6)=P : inc RP,ps(t,3) : endif : next t : TRP=RP
nav=1 : vis=0 : for i=1 to img : if object visible(i) : inc vis : if ps(i,6)<>P : nav=0 : endif : endif : next i : if vis>=img OR TL(P,6)>48 : nav=0 : endif : IF NAV=1 : inc TL(P,6),RP : RP=0 : TRP=0 : ELSE : for a=1 to 5 : Z=(RP(P,a)*10*TRP)/100 : inc TL(P,A),Z : dec RP,Z : next a
while RP>0 : a=rnd(4)+1 : inc TL(P,A) : dec RP : endwhile : ENDIF : ENDIF : NEXT P : LOOP : END
SCREEN_SUBROUTINE: : if Display_State=2 : set text size 12 : endif : if Display_State=3 : set text size 14 : endif : for tt=1 to img : IF OBJECT VISIBLE(tT) : yrotate object tt,object angle y(tt)+0.35 : ox=object screen x(tt) : oy=object screen y(tt) : if Display_State=1 : center text ox,oy-18,n$(tt) : if PS(Tt,6)>0 : center text ox,oy," "+str$(PS(Tt,6))+" " : endif : endif : if Display_State=2
center text ox,oy-21," P: "+str$((ps(tt,1)))+" " : center text ox,oy-9," F: "+str$((ps(tt,2)))+" " : center text ox,oy+3," R: "+str$((ps(tt,3)))+" " : center text ox,oy+15," S: "+str$( ps(tt,11) )+" " : endif : if Display_State=3 : center text ox,oy-18," 1: "+str$((PS(tt,7)))+" " : center text ox,oy-6," 2: "+str$((PS(tt,8)))+" " : center text ox,oy+6," 3: "+str$((PS(tt,9)))+" " : endif : if COL_PHASE=1 : if ps(tt,6)<>1 : if ps(tt,7)>=ps(tt,11) : IF ps(tt,8)<1 and ps(tt,9)<1 : circle ox,oy,26 : circle ox,oy,27 : circle ox,oy,28 : ENDIF : endif : endif
endif : ENDIF : next tt : set text size 16 : if mouseclick()=1 : mx=mousex() : my=mousey() : IF MY>740 : IF MX>712 AND MX<912 : GOTO YOU_LOST_THE_GAME : ENDIF :ENDIF : if my>604 and my<620 : Display_State=0 : if mx>165 and mx<235 : Display_State=1 : endif : if mx>265 and mx<335 : Display_State=2 : endif : if mx>365 and mx<435 : Display_State=3
endif : endif : endif : ink RGB(bc(1),bc(2),bc(3)),0 : box 0,600,1024,768 : box 600,0,1024,768 : ink RGB(0,128,192),rgb(BC(4),BC(5),BC(6)) : line 0,0,1024,0 : line 0,0,0,768 : line 600,0,600,600 : line 0,600,601,600 : line 0,767,1024,767 : line 1023,0,1023,767 : center text 200,604," OWNER " : center text 300,604," STATS " : center text 400,604," FLEET " : CENTER TEXT 812,740," * SURRENDER * " : for tt=1 to 3 : text (tt-1)*150+112,650,w$(tt,4) : text 44,650+tt*20," "+str$(tt)+" "
next tt : for tt=1 to 3 : for uu=0 to 6 : tl(0,uu)=0 : next uu : for ii=1 to img : if PS(ii,6)=tt : for uu=1 to 3 : inc tl(0,uu),ps(ii,uu) : next uu : endif : next ii : for uu=1 to 3 : text (uu-1)*150+112,650+tt*20,str$(tl(0,uu)) : next uu : next tt : center text 812,44," Year : "+str$(year)+" " : RETURN
PLAN_VAL_STR: : FOR T=1 TO IMG : PS(T,10)=(ps(t,2)+ps(t,3)) : PS(T,11)=ps(t,1)+PS(T,10)+((ps(t,6)>0)*int(SQRT(TL(ps(t,6),5)))) : NEXT T : RETURN
INIT_STATE: : range=( 6+ (SQRT(TL(CurPlay,6))*3) ) : for t=1 to img : hide object t : next t : for t=1 to img : if ps(t,6)=CurPlay : show object t : for u=1 to img : if (abs(ps(u,4)-ps(t,4))+abs(ps(u,5)-ps(t,5)))<range : show object u : endif : next u : endif : next t : RETURN
data "STRATEGY","Fighter Attack","Battleship Firepower","Destroyer Maneuver","POPULATION","FORMATION","Hexagon","Wing","Zig-Zag","SHIPYARDS","WEAPON","Beams","Missiles","Mines","RESEARCH"," BEAMS: "," MISSILES: "," MINES: "," DEFENSE: "," TROOPS: "," NAVIGATION: "
DATA "Inora","Ixat","Sicogu","Iraga","Tethia","Zelopol","Chigor","Alsapha","Ataxon","Inzaras","Ulsulus","Venuxi","Lyapht","Dmuren","Inx","Sirces","Icogol","Darisul","Vugi","Zentili","Kotolro","Ioturon","Kadic","Jogoth"
DATA "Epran","Heraph","Mesga","Orazar","Sirukur","Pryus","Duoni","Kasoria","Tunephi","Etacion","Usomi","Eadi","Darsag","Ulicon","Clyus","Oxus","Rulko","Hayx","Oszri","Azarosa","Betu","Mirnath","Kimuri","Denigal"
DATA "Ondisa","Quordas","Usbeda","Uphrama","Hados","Orunath","Iliau","Joruk","Wrackur","Psani","Corigar","Rhefac","Silsha","Rafiad","Kemiron","Maryda","Izreus","Cibra","Argen","Nirodu","Astaka","Bhezar","Inconis","Delomec"
DATA "Idaros","Chromad","Misurud","Cornath","Vhudia","Jalyria","Onpha","Chiphan","Talux","Rasoron","Forani","Animir","Sildar","Koryl","Uronze","Mindara","Imiosc","Dargi","Daceron","Irasa","Cliurna","Iskande","Heralis"
DATA "Ebudri","Enicon","Uprogol","Eprusil","Tanir","Vagen","Prinath","Entaghi","Mizraga","Gisima","Irami","Ineax","Ontau","Regiden","Yirigi","Mayisa","Alera","Targesa","Masilus","Osreba","Tazuron","Detha","Tazaros","Rosmir"
DATA "Sirnami","Turnema","Askendi","Altoven","Ormiga","Mirius","Magmada","Necersi","Onumen","Ymbecri","Forturi","Scheda","Shiri","Cigen","Agemna","Rukani","Idmar","Cequum","Gaezann","Yenchak","Nepanus","Aethia"
Main Screen: |
||
| Back to top |
|||
|
IBOL
User Joined: Tue Mar 30th 2004 Location: chair |
+ Code Snippet
set display mode 1024,768,32
sync on
sync rate 60
sync
Randomize Timer()
color backdrop 0
set text font "lucida console"
set text opaque
dim PS(36,11)
dim RP(3,5)
dim TL(3,6)
dim FL(3)
dim TH(36,3)
DIM N$(36) AS STRING
dim w$(5,6) as string
dim CN(2,6)
for t=1000 to 1300
make object sphere t,1
position object t,rnd(500)-250,rnd(500)-250,340+rnd(30)
next t
` group 1 , count 20
` group 2 , count 23
CREATE_NEW_GAME_HERE:
for i=1 to 36
if image exist(i)
delete object i
delete image i
endif
next i
RESTORE
for t=1 to 3
for u=0 to 4
read a$
w$(t,u)=a$
next u
next t
for t=1 to 6
read a$
w$(5,t)=a$
next t
k=rnd(105)
for t=1 to k
read a$
next t
for t=1 to 36
` group 3 , count 23
if object exist(t)
delete object t
endif
next t
IMG=0
FAIL=0
for a=1 to 6
for b=1 to 6
IF RND(19)<12
x=a*7-1+rnd(2)
y=b*7-1+rnd(2)
repeat
j=(25+rnd(100))*rnd(2)
k=(25+rnd(100))*rnd(2)
l=(25+rnd(100))*rnd(2)
until (j+k+l)>50
create bitmap 1,16,16
ink rgb(j,k,l),0
box 0,0,15,15
ink rgb(l,j,k),0
for t=1 to 5+rnd(3)
c=rnd(9)+2
d=rnd(9)+2
` group 4 , count 23
box c,d,c+1+rnd(3),d+1+rnd(3)
next t
ink rgb(k,l,j),0
for t=1 to 3+rnd(1)
c=rnd(8)+2
d=rnd(8)+2
box c,d,c+1+rnd(4),d+1+rnd(4)
next t
blur bitmap 1,2
inc IMG
get image img,0,0,15,15
delete bitmap 1
make object sphere img,3.3
texture object img,img
position object img,x,y,37
rotate object img,rnd(359),rnd(359),rnd(359)
fix object pivot img
PS(img,4)=x
PS(img,5)=y
PS(img,6)=0
for t=1 to 3
ps(img,t)=1
ps(img,t+6)=0
` group 5 , count 23
next t
k=rnd(5)+4+(3*(rnd(4)=1))
for t=1 to k
inc ps(img,(rnd(2)+1))
next t
inc ps(img,1),(rnd(3)+1)
read a$
n$(img)=a$
ENDIF
next b
next a
for t=1 to 3
repeat
p=rnd(img-1)+1
until PS(p,6)=0
PS(p,6)=t
for u=1 to 3
ps(p,u)=rnd(2)+5
next u
FL(t)=5
next t
for t=2 to 3
for u=1 to 4
` group 6 , count 20
inc RP(t,rnd(5)+1),u
next u
next t
for t=1 to 3
for u=1 to 6
TL(t,u)=1
next u
next t
YEAR=2100+RND(2100)
Y1=YEAR
position camera 0,25,30,12
repeat
until mouseclick()=0
set camera aspect 1.333
set camera view 0,0,1024,768
ink RGB(0,128,192),RGB(128,34,34)
set text size 48
do
center text 512,200,"Empire Of The Far Suns"
center text 512,300,"Click Mouse To Play"
` group 7 , count 22
for i=1 to img
yrotate object i,object angle y(i)+0.5
next i
sync
if mouseclick()
exit
endif
loop
set text size 16
set camera aspect 1.0
set camera view 0,0,600,600
position camera 0,25,30,0
Display_State=1
DO
INC YEAR
if YEAR mod 10 = 0
for i=1 to img
inc PS(i,1)
inc PS(i,rnd(1)+2)
next i
endif
CurPlay=1
` group 8 , count 22
GOSUB INIT_STATE
GOSUB PLAN_VAL_STR
FOR I=1 TO IMG
for OFF=1 to 3
for DEF=1 to 3
if OFF<>DEF
if PS(i,6+OFF)>0 and PS(i,6+DEF)>0
for t=0 to 2
for u=0 to 6
CN(t,u)=0
next u
next t
cn(1,0)=OFF
cn(2,0)=DEF
show=0
if off=1 or def=1
show=1
C=1
E=2
if def=1
C=2
E=1
` group 9 , count 19
endif
endif
round=0
repeat
inc round
if round=1
PICK=99
for t=1 to 2
cn(t,1)=ps(i,6+cn(t,0))
cn(t,2)=cn(t,1)*(6+(2*int(sqrt(TL(cn(t,0),4)))))
cn(t,4)=rnd(2)+1
cn(t,5)=rnd(2)+1
cn(t,6)=1
for u=2 to 3
if TL(cn(t,0),u)>TL(cn(t,0),cn(t,6))
cn(t,6)=u
endif
next u
next t
` group 10 , count 22
else
for t=1 to 2
PICK=1
if cn(t,2)>0
cn(t,1)=(cn(t,2) / (6+(2*int(sqrt(TL(cn(t,0),4))))))+1
else
cn(t,1)=0
endif
next t
for t=1 to 2
if cn(t,0)>1
if rnd(4)<4
cn(t,rnd(1)+4)=rnd(2)+1
endif
endif
next t
endif
IF CN(1,1)>0 AND CN(2,1)>0
IF SHOW=1
repeat
until mouseclick()=0
DO
` group 11 , count 21
cls rgb(20,20,70)
center text 512,60," COMBAT AT "+N$(I)+" "
center text 512,80," ROUND # "+STR$(ROUND)+" "
text 300,120," You have "+str$(CN(c,1))+" Ships "
text 300,140," Player "+str$(cn(e,0))+" has "+str$(CN(e,1))+" Ships "
text 300,160," Give Your Fleet Orders ("+str$(PICK)+") "
for t=1 to 3
text 200,100+100*t,w$(t,0)+":"
for u=1 to 3
a$=w$(t,u)
if cn(c,t+3)=u
a$=upper$(" *"+a$+"* ")
endif
text 300,100+100*t+(u-1)*20,a$
next u
next t
text 400,500," ENGAGE "
if mouseclick()=1
if mousex()>199 and mousex()<420
L=(mousey()-100)/100
V=1+(mousey()-(100+L*100))/20
` group 12 , count 23
if L>0 and L<4
if v>0 and V<4
cn(c,L+3)=V
Dec PICK
repeat
until mouseclick()=0
endif
endif
endif
IF mousey()>495 and mousey()<525
if mousex()>300 and mousex()<500
EXIT
endif
ENDIF
endif
sync
if PICK<1
wait 500
EXIT
endif
loop
ENDIF
for t=1 to 2
` group 13 , count 18
d=(int(sqrt(TL(cn(t,0),cn(t,6))))+2)*cn(t,1)
cn(t,3)=(d+rnd(d))*0.55
next t
for t=1 to 3
w$(4,t)=""
next t
for t=4 to 6
if (cn(1,t)=1 and cn(2,t)=2 ) OR (cn(1,t)=2 and cn(2,t)=3 ) OR (cn(1,t)=3 and cn(2,t)=1 )
DEC cn(2,3),((cn(2,3)/10)+1)
w$(4,t-3)=" Player "+str$(cn(1,0))+" has the advantage in "+w$(t-3)+" "
endif
next t
for t=4 to 6
if (cn(2,t)=1 and cn(1,t)=2 ) OR (cn(2,t)=2 and cn(1,t)=3 ) OR (cn(2,t)=3 and cn(1,t)=1 )
DEC cn(1,3),((cn(1,3)/10)+1)
w$(4,t-3)=" Player "+str$(cn(2,0))+" has the advantage in "+w$(t-3)+" "
endif
next t
` group 14 , count 19
IF SHOW=0
dec cn(1,2),cn(2,3)
dec cn(2,2),cn(1,3)
ELSE
repeat
cls rgb(20,20,70)
center text 512,60," COMBAT AT "+N$(I)+" "
center text 512,80," ROUND # "+STR$(ROUND)+" "
for t=1 to 2
if cn(t,2)>0
cn(t,1)=(cn(t,2) / (6+(2*int(sqrt(TL(cn(t,0),4))))))+1
else
cn(t,1)=0
endif
next t
for t=1 to 2
text (t-1)*400+100,100," Player "+str$(cn(t,0))
text (t-1)*400+100,120," Ships : "+str$(cn(t,1))
text (t-1)*400+100,140," Hull Points : "+str$(cn(t,2))
` group 15 , count 22
for u=1 to 3
text (t-1)*400+100,160+u*20,w$(u,0)+" : "+w$(u,cn(t,u+3))
next u
next t
for t=1 to 3
if w$(4,t)<>""
text 300,330+t*20,w$(4,t)
endif
next t
text 400,500," CONTINUE "
sync
if cn(1,3)>0
dec cn(2,2)
dec cn(1,3)
endif
if cn(2,3)>0
dec cn(1,2)
dec cn(2,3)
endif
until ( cn(2,3)<1 and cn(1,3)<1 ) OR cn(2,2)<0 or cn(1,2)<0
DO
if mouseclick()
` group 16 , count 23
IF mousey()>495 and mousey()<525
if mousex()>300 and mousex()<500
EXIT
endif
ENDIF
endif
LOOP
ENDIF
ENDIF
until CN(1,1)=0 or CN(2,1)=0
FOR T=1 TO 2
PS(I,6+CN(T,0))=CN(T,1)
NEXT T
endif
endif
next DEF
next OFF
NEXT I
for t=1 to img
inc FL(ps(T,6)),PS(T,2)
next t
FL(0)=0
YES=0
` group 17 , count 22
for t=1 to img
if ps(t,7)>=PS(T,11)
yes=1
endif
next t
if yes=1
COL_PHASE=1
GOSUB INIT_STATE
GOSUB PLAN_VAL_STR
do
GOSUB SCREEN_SUBROUTINE
center text 812,24," COLONIZATION PHASE "
center text 812,64," Right Click Circled Planet To Colonize "
CENTER TEXT 812,84," DONE "
if mouseclick()=2
T=pick object(mousex(),mousey(),1,img)
if t>0 and t<=img
if ps(t,6)<>1
if ps(t,7)>=PS(T,11)
dec ps(t,7),PS(T,11)
ps(t,6)=1
GOSUB PLAN_VAL_STR
` group 18 , count 23
endif
endif
endif
endif
if mouseclick()=1
if mousey()>84 and mousey()<104
if mousex()>780 and mousex()<844
EXIT
endif
endif
endif
sync
loop
COL_PHASE=0
endif
e=0
FOR I=1 TO IMG
if PS(i,6)>1
inc e
endif
NEXT I
IF e=0
repeat
` group 19 , count 21
until mouseclick()=0
CLS RGB(20,20,70)
set text size 48
center text 512,200," YOU WIN! "
center text 512,280," YOU BUILT THE SUPREME EMPIRE "
center text 512,328," IN "+STR$(YEAR-Y1)+" YEARS! "
center text 512,400," Click Mouse To Play Again "
center text 512,450," Or Hit Escape Key To Quit "
sync
wait mouse
GOTO CREATE_NEW_GAME_HERE
ENDIF
FOR P=2 TO 3
CurPlay=P
GOSUB INIT_STATE
for i=1 to img
if ps(i,6)<>P
if ps(i,6+P)>=PS(I,11)
if ps(i,7)<1 AND ( ( p=2 and ps(i,9)<1 ) OR ( p=3 and ps(i,8)<1 ) )
dec ps(i,6+P),PS(I,11)
if ps(i,6)=1
` group 20 , count 19
CLS RGB(20,20,70)
center text 512,240+rnd(20)," Player "+str$(P)+" Invaded Your Colony At "+n$(i)+" "
sync
wait 2500
endif
ps(i,6)=P
GOSUB PLAN_VAL_STR
endif
endif
endif
next i
NEXT P
e=0
FOR I=1 TO IMG
if PS(i,6)=1
inc e
endif
NEXT I
IF e=0
` group 21 , count 24
YOU_LOST_THE_GAME:
repeat
until mouseclick()=0
CLS RGB(20,20,70)
set text size 48
center text 512,200," YOU HAVE BEEN DEFEATED! "
center text 512,400," Click Mouse To Play Again "
center text 512,450," Or Hit Escape Key To Quit "
sync
wait mouse
GOTO CREATE_NEW_GAME_HERE
ENDIF
GOSUB PLAN_VAL_STR
CurPlay=1
for t=1 to img
if ps(t,7)>0
inc FL(1),ps(t,7)
ps(t,7)=0
endif
next t
GOSUB INIT_STATE
GOSUB PLAN_VAL_STR
REPEAT
GOSUB SCREEN_SUBROUTINE
` group 22 , count 23
center text 812,24," MOVEMENT PHASE "
center text 812,64," Left Click Planet To Add 1 Ship "
center text 812,84," Right Click To Add 5 "
center text 812,264," "+str$(FL(1))+" Ships Left "
if mouseclick()
T=pick object(mousex(),mousey(),1,img)
if t>0 and t<=img
if object visible(t)
N=1
if mouseclick()=2 AND fl(1)>4
N=5
endif
dec FL(1),n
inc PS(t,7),n
wait 125
endif
endif
endif
SYNC
UNTIL FL(1)<1
wait 250
GOSUB INIT_STATE
GOSUB PLAN_VAL_STR
` group 23 , count 22
P=0
for t=1 to img
if ps(t,6)=1
inc P,ps(t,3)
endif
next t
REPEAT
GOSUB SCREEN_SUBROUTINE
center text 812,24," RESEARCH PHASE "
center text 812,64," Click To Add Points "
center text 812,84," "+str$(P)+" Points Left "
if mouseclick()
if mousex()>612 and mousex()<750
y=(mousey()/20)-5
if y>0 and y<7
s=(P/25)+1
dec P,s
Inc TL(1,y),s
wait 125
endif
endif
endif
` group 24 , count 21
for t=1 to 6
text 612,100+t*20,w$(5,t)+STR$(TL(1,t))+" ("+str$(INT(SQRT(TL(1,t))))+") "
next t
sync
UNTIL P<1
wait 250
FOR P=2 TO 3
alive=0
for i=1 to img
if ps(i,6)=P
alive=1
endif
next i
if alive=0
fl(p)=0
for i=1 to img
ps(i,6+P)=0
next i
endif
IF ALIVE=1
CurPlay=P
` group 25 , count 23
GOSUB INIT_STATE
GOSUB PLAN_VAL_STR
for t=1 to img
if ps(t,6+P)>0
inc FL(P),ps(t,6+P)
ps(t,6+P)=0
endif
next t
for i=1 to img
for j=0 to 3
th(i,j)=0
next j
TH(I,1) = (ps(I,10)*100) / ps(I,11)
if ps(i,6)=0
TH(I,1)=TH(I,1)*2.2
endif
if object visible(i)
if FL(P)>=PS(i,11) AND PS(i,6)<>P
th(i,3)=1
endif
endif
next i
F=FL(P)
` group 26 , count 23
fail=0
while f>0
TAR=0
QUO=0
for i=1 to img
if rnd(2)<2
if th(i,3)=1
if f>=ps(i,11)
if ps(i,6+P)<7
if TH(I,1)>QUO
QUO=TH(I,1)
TAR=I
endif
endif
endif
endif
endif
next i
if tar>0 and quo>0
ps(TAR,6+p)=ps(TAR,11)
dec f,ps(TAR,11)
x=rnd(f/2)
inc ps(TAR,6+p),x
` group 27 , count 23
dec f,x
endif
if fail>25
repeat
if f>0
x=rnd(img-1)+1
if PS(x,6)=P
inc ps(x,6+P)
dec F
endif
endif
until f<1
endif
INC FAIL
endwhile
FL(p)=0
RP=0
for t=1 to img
if ps(t,6)=P
inc RP,ps(t,3)
endif
next t
TRP=RP
` group 28 , count 23
nav=1
vis=0
for i=1 to img
if object visible(i)
inc vis
if ps(i,6)<>P
nav=0
endif
endif
next i
if vis>=img OR TL(P,6)>48
nav=0
endif
IF NAV=1
inc TL(P,6),RP
RP=0
TRP=0
ELSE
for a=1 to 5
Z=(RP(P,a)*10*TRP)/100
inc TL(P,A),Z
dec RP,Z
next a
` group 29 , count 10
while RP>0
a=rnd(4)+1
inc TL(P,A)
dec RP
endwhile
ENDIF
ENDIF
NEXT P
LOOP
END
` group 30 , count 19
SCREEN_SUBROUTINE:
if Display_State=2
set text size 12
endif
if Display_State=3
set text size 14
endif
for tt=1 to img
IF OBJECT VISIBLE(tT)
yrotate object tt,object angle y(tt)+0.35
ox=object screen x(tt)*0.586
oy=object screen y(tt)*0.781
if Display_State=1
center text ox,oy-18,n$(tt)
if PS(Tt,6)>0
center text ox,oy," "+str$(PS(Tt,6))+" "
endif
endif
if Display_State=2
` group 31 , count 20
center text ox,oy-21," P: "+str$((ps(tt,1)))+" "
center text ox,oy-9," F: "+str$((ps(tt,2)))+" "
center text ox,oy+3," R: "+str$((ps(tt,3)))+" "
center text ox,oy+15," S: "+str$( ps(tt,11) )+" "
endif
if Display_State=3
center text ox,oy-18," 1: "+str$((PS(tt,7)))+" "
center text ox,oy-6," 2: "+str$((PS(tt,8)))+" "
center text ox,oy+6," 3: "+str$((PS(tt,9)))+" "
endif
if COL_PHASE=1
if ps(tt,6)<>1
if ps(tt,7)>=ps(tt,11)
IF ps(tt,8)<1 and ps(tt,9)<1
circle ox,oy,26
circle ox,oy,27
circle ox,oy,28
ENDIF
endif
endif
` group 32 , count 22
endif
ENDIF
next tt
set text size 16
if mouseclick()=1
mx=mousex()
my=mousey()
IF MY>740
IF MX>712 AND MX<912
GOTO YOU_LOST_THE_GAME
ENDIF
ENDIF
if my>604 and my<620
Display_State=0
if mx>165 and mx<235
Display_State=1
endif
if mx>265 and mx<335
Display_State=2
endif
if mx>365 and mx<435
Display_State=3
` group 33 , count 20
endif
endif
endif
ink rgb(20,20,70),0
box 0,600,1024,768
box 600,0,1024,768
ink RGB(0,128,192),RGB(128,34,34)
line 0,0,1024,0
line 0,0,0,768
line 600,0,600,600
line 0,600,601,600
line 0,767,1024,767
line 1023,0,1023,767
center text 200,604," OWNER "
center text 300,604," STATS "
center text 400,604," FLEET "
CENTER TEXT 812,740," * SURRENDER * "
for tt=1 to 3
text (tt-1)*150+112,650,w$(tt,4)
text 44,650+tt*20," "+str$(tt)+" "
` group 34 , count 18
next tt
for tt=1 to 3
for uu=0 to 6
tl(0,uu)=0
next uu
for ii=1 to img
if PS(ii,6)=tt
for uu=1 to 3
inc tl(0,uu),ps(ii,uu)
next uu
endif
next ii
for uu=1 to 3
text (uu-1)*150+112,650+tt*20,str$(tl(0,uu))
next uu
next tt
center text 812,44," Year : "+str$(year)+" "
RETURN
` group 35 , count 6
PLAN_VAL_STR:
FOR T=1 TO IMG
PS(T,10)=(ps(t,2)+ps(t,3))
PS(T,11)=ps(t,1)+PS(T,10)+((ps(t,6)>0)*int(SQRT(TL(ps(t,6),5))))
NEXT T
RETURN
` group 36 , count 16
INIT_STATE:
range=( 6+ (SQRT(TL(CurPlay,6))*3) )
for t=1 to img
hide object t
next t
for t=1 to img
if ps(t,6)=CurPlay
show object t
for u=1 to img
if (abs(ps(u,4)-ps(t,4))+abs(ps(u,5)-ps(t,5)))<range
show object u
endif
next u
endif
next t
RETURN
data "STRATEGY","Fighter Attack","Battleship Firepower","Destroyer Maneuver","POPULATION","FORMATION","Hex","Wing","Zag","SHIPYARDS","WEAPON","Beams","Missiles","Mines","RESEARCH"," BEAMS: "," MISSILES: "," MINES: "," DEFENSE: "," TROOPS: "," NAVIGATION: "
DATA "Inora","Ixat","Sicogu","Iraga","Tethia","Zelopol","Chigor","Alsapha","Ataxon","Inzaras","Ulsulus","Venuxi","Lyapht","Dmuren","Inx","Sirces","Icogol","Darisul","Vugi","Zentili","Kotolro","Ioturon","Kadic","Jogoth"
DATA "Epran","Heraph","Mesga","Orazar","Sirukur","Pryus","Duoni","Kasoria","Tunephi","Etacion","Usomi","Eadi","Darsag","Ulicon","Clyus","Oxus","Rulko","Hayx","Oszri","Azarosa","Betu","Mirnath","Kimuri","Denigal"
DATA "Ondisa","Quordas","Usbeda","Uphrama","Hados","Orunath","Iliau","Joruk","Wrackur","Psani","Corigar","Rhefac","Silsha","Rafiad","Kemiron","Maryda","Izreus","Cibra","Argen","Nirodu","Astaka","Bhezar","Inconis","Delomec"
DATA "Idaros","Chromad","Misurud","Cornath","Vhudia","Jalyria","Onpha","Chiphan","Talux","Rasoron","Forani","Animir","Sildar","Koryl","Uronze","Mindara","Imiosc","Dargi","Daceron","Irasa","Cliurna","Iskande","Heralis"
DATA "Ebudri","Enicon","Uprogol","Eprusil","Tanir","Vagen","Prinath","Entaghi","Mizraga","Gisima","Irami","Ineax","Ontau","Regiden","Yirigi","Mayisa","Alera","Targesa","Masilus","Osreba","Tazuron","Detha","Tazaros","Rosmir"
DATA "Sirnami","Turnema","Askendi","Altoven","Ormiga","Mirius","Magmada","Necersi","Onumen","Ymbecri","Forturi","Scheda","Shiri","Cigen","Agemna","Rukani","Idmar","Cequum","Gaezann","Yenchak","Nepanus","Aethia"
` it CURENTLY appears to be 43 LINES.
this is the code broken up into nice, easy counting blocks, so you can see how many commands are on each line. |
||
| Back to top |
|||
|
IBOL
User Joined: Tue Mar 30th 2004 Location: chair |
+ Code Snippet
` Empire Of The Far Suns
set display mode 1024,768,32
sync on
sync rate 60
sync
Randomize Timer()
color backdrop 0
` this program is OPTIMIZED FOR THE 20-LINE (50-LINE) FORMAT.
` some of the techniques used here are NOT the best ways of doing things.
` i have avoided *Functions*, *User Defined Types* , and *Select/Case* structures
` because they WON'T COMPILE with my version of DBP and my editor.
` also, my "main loop" is cluttered, and that's not the way to go normally,
` but it works well here.
set text font "lucida console"
set text opaque
dim PS(36,11)
dim RP(3,6)
dim TL(3,6)
dim FL(3)
dim TH(36,3)
DIM N$(36) AS STRING
dim w$(4,4) as string
dim CN(2,6)
` PS() = planet stats
` RP() = Research Priorities
` TL() = Tech Level
` FL() = PLayer
` 1 2 3 , 4 5 6 , 7 8 9 , 10 , 11
` PS : pop,ind,sci , x,y,owner , F1,F2,F3 , VALUE , STRENGTH
`RP is in this order: ene,mis,min , def,troop
` TL() is in this order: ene,mis,min , def,troop , NAV
` FL() is FLEET
` TH() is Threat/Think . it is used for the AIs to evaluate movement decisions.
` it goes in order: VAL/STR QUOTIENT , (-threat felt), threat given.
` CN() is COMBAT NUMBERS, and represents 6 things for each side:
` SHIPS, DAMAGE TAKE-ABLE, DAMAGE DO-ABLE, STRAT/FORM/WEAPON
for t=1000 to 1300
make object sphere t,1
position object t,rnd(500)-250,rnd(500)-250,340+rnd(30)
next t
` # NEW GAME # ` ` # NEW GAME # ` ` # NEW GAME # ` ` # NEW GAME # `
CREATE_NEW_GAME_HERE:
for i=1 to 36
if image exist(i)
delete object i
delete image i
endif
next i
RESTORE
for t=1 to 3
for u=0 to 4
read a$
w$(t,u)=a$
next u
next t
k=rnd(105)
for t=1 to k
read a$
next t
for t=1 to 36
if object exist(t)
delete object t
endif
next t
IMG=0
FAIL=0
for a=1 to 6
for b=1 to 6
IF RND(19)<12
x=a*7-1+rnd(2)
y=b*7-1+rnd(2)
repeat
j=(25+rnd(100))*rnd(2)
k=(25+rnd(100))*rnd(2)
l=(25+rnd(100))*rnd(2)
until (j+k+l)>50
create bitmap 1,16,16
ink rgb(j,k,l),0
box 0,0,15,15
ink rgb(l,j,k),0
for t=1 to 5+rnd(3)
c=rnd(9)+2
d=rnd(9)+2
box c,d,c+1+rnd(3),d+1+rnd(3)
next t
ink rgb(k,l,j),0
for t=1 to 3+rnd(1)
c=rnd(8)+2
d=rnd(8)+2
box c,d,c+1+rnd(4),d+1+rnd(4)
next t
blur bitmap 1,2
inc IMG
get image img,0,0,15,15
delete bitmap 1
make object sphere img,3.3
texture object img,img
position object img,x,y,37
rotate object img,rnd(359),rnd(359),rnd(359)
fix object pivot img
PS(img,4)=x
PS(img,5)=y
PS(img,6)=0
for t=1 to 3
ps(img,t)=1
ps(img,t+6)=0
next t
k=rnd(5)+4+(3*(rnd(4)=1))
for t=1 to k
inc ps(img,(rnd(2)+1))
next t
inc ps(img,1),(rnd(3)+1)
` this adds 4-9 random points and extra population to planets. next, we name them.
read a$
n$(img)=a$
ENDIF
next b
next a
` SELECT HOMEWORLDS RANDOMLY
for t=1 to 3
repeat
p=rnd(img-1)+1
until PS(p,6)=0
PS(p,6)=t
for u=1 to 3
ps(p,u)=rnd(2)+5
next u
FL(t)=5
next t
` THIS SETS AI RESEARCH PRIORITIES:
` ene,mis,min , def,troop,nav
for t=2 to 3
for u=1 to 4
inc RP(t,rnd(5)+1),u
next u
next t
` Initialize Tech Levels:
for t=1 to 3
for u=1 to 6
TL(t,u)=1
next u
next t
YEAR=2100+RND(2100)
Y1=YEAR
` # NEW GAME # ` ` # NEW GAME # ` ` # NEW GAME # ` ` # NEW GAME # `
` 22
position camera 0,25,30,12
repeat
until mouseclick()=0
set camera aspect 1.333
set camera view 0,0,1024,768
ink RGB(0,128,192),RGB(128,34,34)
set text size 48
do
center text 512,200,"Empire Of The Far Suns"
center text 512,300,"Click Mouse To Play"
for i=1 to img
yrotate object i,object angle y(i)+0.5
next i
sync
if mouseclick()
exit
endif
loop
set text size 16
set camera aspect 1.0
set camera view 0,0,600,600
position camera 0,25,30,0
Display_State=1
` THE BIG LOOP:
DO
INC YEAR
if YEAR mod 10 = 0
` planets now GROW...population ALWAYS increases, while ind and sci MAY increase.
for i=1 to img
inc PS(i,1)
inc PS(i,rnd(1)+2)
next i
endif
CurPlay=1
`!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
`------------------------------------------------------------------------------------------------
` *** COMBAT PHASE *** ` *** COMBAT PHASE *** ` *** COMBAT PHASE *** ` *** COMBAT PHASE ***
GOSUB INIT_STATE
GOSUB PLAN_VAL_STR
` THIS should do combat for ALL SIDES, EVERY PLANET.
FOR I=1 TO IMG
` this goes thru EVERY planet, and must check to initiate a combat.
` so, once we find someone who HAS a fleet, we need to find him an OPPONENT.
` scanning p 1-3 to find opposing fleets.
for OFF=1 to 3
for DEF=1 to 3
if OFF<>DEF
` off & def are "offense and defense" and they don't have any real DIFFERENCE between them,
` it's just chosing 2 sides and remembering them...
` we may need to keep track of SHIPS, DAMAGE TAKE-ABLE, DAMAGE DO-ABLE, STRAT/FORM/WEAPON
` For Each Side.
if PS(i,6+OFF)>0 and PS(i,6+DEF)>0
` if 2 opposing sides have ships in this system.
` this clears any old data:
for t=0 to 2
for u=0 to 6
CN(t,u)=0
next u
next t
cn(1,0)=OFF
cn(2,0)=DEF
show=0
if off=1 or def=1
show=1
C=1
E=2
if def=1
C=2
E=1
endif
endif
` C is the off/def 1/2 combat # that is the human.
round=0
` COMBAT LOOP
repeat
inc round
if round=1
PICK=99
for t=1 to 2
cn(t,1)=ps(i,6+cn(t,0))
cn(t,2)=cn(t,1) * (6+(2*int(sqrt(TL(cn(t,0),4)))))
cn(t,4)=rnd(2)+1
cn(t,5)=rnd(2)+1
cn(t,6)=1
for u=2 to 3
if TL(cn(t,0),u)>TL(cn(t,0),cn(t,6))
cn(t,6)=u
endif
next u
` this tries to ALWAYS make a side use its most powerful weapon.
next t
` in the FIRST round, ships are pulled from the planet, and initial hull points are calculated.
` also, random strat/form/weapon configurations are chosen for BOTH sides.
else
` in subsequent rounds, #ships is calculated FROM hull points remaining
for t=1 to 2
PICK=1
if cn(t,2)>0
cn(t,1)=(cn(t,2) / (6+(2*int(sqrt(TL(cn(t,0),4))))))+1
else
cn(t,1)=0
endif
next t
` HERE is where the AI later changes something about his BATTLE STRATEGY. they do it 80% of the time
for t=1 to 2
if cn(t,0)>1
if rnd(4)<4
cn(t,rnd(1)+4)=rnd(2)+1
endif
endif
next t
endif
` initial ships and hull points are established, AND so are ONGOING hull points.
` if both sides still have ships
IF CN(1,1)>0 AND CN(2,1)>0
` HERE is where HUMAN INPUT must take place.
IF SHOW=1
repeat
until mouseclick()=0
DO
cls rgb(20,20,70)
center text 512,60," COMBAT AT "+N$(I)+" "
center text 512,80," ROUND # "+STR$(ROUND)+" "
text 300,120," You have "+str$(CN(c,1))+" Ships "
text 300,140," Player "+str$(cn(e,0))+" has "+str$(CN(e,1))+" Ships "
text 300,160," Give Your Fleet Orders ("+str$(PICK)+") "
for t=1 to 3
text 200,100+100*t,w$(t,0)+":"
for u=1 to 3
a$=w$(t,u)
if cn(c,t+3)=u
a$=upper$(" *"+a$+"* ")
endif
text 300,100+100*t+(u-1)*20,a$
next u
next t
text 400,500," ENGAGE "
if mouseclick()=1
if mousex()>199 and mousex()<420
L=(mousey()-100)/100
V=1+(mousey()-(100+L*100))/20
if L>0 and L<4
if v>0 and V<4
cn(c,L+3)=V
Dec PICK
repeat
until mouseclick()=0
endif
endif
endif
IF mousey()>495 and mousey()<525
if mousex()>300 and mousex()<500
EXIT
endif
ENDIF
endif
sync
if PICK<1
wait 500
EXIT
endif
loop
ENDIF
` CN() : SHIPS, DAMAGE TAKE-ABLE, DAMAGE DO-ABLE, STRAT/FORM/WEAPON
for t=1 to 2
d=(int(sqrt(TL(cn(t,0),cn(t,6))))+2)*cn(t,1)
cn(t,3)=(d+rnd(d))*0.55
next t
for t=1 to 3
w$(4,t)=""
next t
` these lines give the bonuses for strat/form/weap what-beats-what:
for t=4 to 6
if (cn(1,t)=1 and cn(2,t)=2 ) OR (cn(1,t)=2 and cn(2,t)=3 ) OR (cn(1,t)=3 and cn(2,t)=1 )
DEC cn(2,3),((cn(2,3)/10)+1)
w$(4,t-3)=" Player "+str$(cn(1,0))+" has the advantage in "+w$(t-3)+" "
endif
next t
for t=4 to 6
if (cn(2,t)=1 and cn(1,t)=2 ) OR (cn(2,t)=2 and cn(1,t)=3 ) OR (cn(2,t)=3 and cn(1,t)=1 )
DEC cn(1,3),((cn(1,3)/10)+1)
w$(4,t-3)=" Player "+str$(cn(2,0))+" has the advantage in "+w$(t-3)+" "
endif
next t
` NOW, HAVING *ADVANTAGE* DECREASES ENEMY FIREPOWER...NOT INC YOURS.
IF SHOW=0
` this DOES the damage:
dec cn(1,2),cn(2,3)
dec cn(2,2),cn(1,3)
ELSE
repeat
cls rgb(20,20,70)
center text 512,60," COMBAT AT "+N$(I)+" "
center text 512,80," ROUND # "+STR$(ROUND)+" "
for t=1 to 2
if cn(t,2)>0
cn(t,1)=(cn(t,2) / (6+(2*int(sqrt(TL(cn(t,0),4))))))+1
else
cn(t,1)=0
endif
next t
for t=1 to 2
text (t-1)*400+100,100," Player "+str$(cn(t,0))
text (t-1)*400+100,120," Ships : "+str$(cn(t,1))
text (t-1)*400+100,140," Hull Points : "+str$(cn(t,2))
for u=1 to 3
text (t-1)*400+100,160+u*20,w$(u,0)+" : "+w$(u,cn(t,u+3))
next u
next t
for t=1 to 3
if w$(4,t)<>""
text 300,330+t*20,w$(4,t)
endif
next t
text 400,500," CONTINUE "
sync
if cn(1,3)>0
dec cn(2,2)
dec cn(1,3)
endif
` these remove the hull points based on pre-calculated damage
if cn(2,3)>0
dec cn(1,2)
dec cn(2,3)
endif
until ( cn(2,3)<1 and cn(1,3)<1 ) OR cn(2,2)<0 or cn(1,2)<0
DO
if mouseclick()
IF mousey()>495 and mousey()<525
if mousex()>300 and mousex()<500
EXIT
endif
ENDIF
endif
LOOP
ENDIF : ` DO YOU SHOW THE DAMAGE?
ENDIF
until CN(1,1)=0 or CN(2,1)=0
` this repeat loop should always go at least once, and continues until at least one side is dead.
` END COMBAT LOOP
` this removes the loser's fleet:
FOR T=1 TO 2
PS(I,6+CN(T,0))=CN(T,1)
NEXT T
endif
endif
next DEF
next OFF
NEXT I
`------------------------------------------------------------------------------------------------
` + + + PRODUCTION PHASE + + + ` + + + PRODUCTION PHASE + + + ` + + + PRODUCTION PHASE + + +
for t=1 to img
inc FL(ps(T,6)),PS(T,2)
next t
FL(0)=0
` THIS DOES PRODUCTION FOR ALL PLAYERS AT ONCE. do not do it again for the AIs later...
`-------------------------------------------------------------------------------------------
` -vvv COLONIZATION PHASE vvv- ` -vvv COLONIZATION PHASE vvv- ` -vvv COLONIZATION PHASE vvv-
YES=0
for t=1 to img
if ps(t,7)>=PS(T,11)
yes=1
endif
next t
if yes=1
COL_PHASE=1
GOSUB INIT_STATE
GOSUB PLAN_VAL_STR
do
GOSUB SCREEN_SUBROUTINE
center text 812,24," COLONIZATION PHASE "
center text 812,64," Right Click Circled Planet To Colonize "
CENTER TEXT 812,84," DONE "
if mouseclick()=2
T=pick object(mousex(),mousey(),1,img)
if t>0 and t<=img
if ps(t,6)<>1
if ps(t,7)>=PS(T,11)
dec ps(t,7),PS(T,11)
ps(t,6)=1
GOSUB PLAN_VAL_STR
endif
endif
endif
endif
if mouseclick()=1
if mousey()>84 and mousey()<104
if mousex()>780 and mousex()<844
EXIT
endif
endif
endif
sync
loop
COL_PHASE=0
endif
e=0
FOR I=1 TO IMG
if PS(i,6)>1
inc e
endif
NEXT I
IF e=0
` you control all planets, and/or the others control NONE.
` THEREFORE YOU WIN!
repeat
until mouseclick()=0
CLS RGB(20,20,70)
set text size 48
center text 512,200," YOU WIN! "
center text 512,280," YOU BUILT THE SUPREME EMPIRE "
center text 512,320," IN "+STR$(YEAR-Y1)+" YEARS! "
center text 512,400," Click Mouse To Play Again "
center text 512,450," Or Hit Escape Key To Quit "
sync
wait mouse
GOTO CREATE_NEW_GAME_HERE
ENDIF
` AI COLONIZE - AI COLONIZE - AI COLONIZE - AI COLONIZE - AI COLONIZE - AI COLONIZE - AI COLONIZE - AI COLONIZE
FOR P=2 TO 3
CurPlay=P
GOSUB INIT_STATE
` - = # = - = # = - = # = - = # = - = # = - = # = - = # = -
` 3. COLONIZATION
` THIS TAKES PLACE any time a force capable of colonizing/invading is present.
for i=1 to img
if ps(i,6)<>P
if ps(i,6+P)>=PS(I,11)
if ps(i,7)<1 AND ( ( p=2 and ps(i,9)<1 ) OR ( p=3 and ps(i,8)<1 ) )
dec ps(i,6+P),PS(I,11)
if ps(i,6)=1
` here is where the player should get an INVASION message
CLS RGB(20,20,70)
center text 512,240+rnd(20)," Player "+str$(P)+" Invaded Your Colony At "+n$(i)+" "
sync
wait 2500
endif
ps(i,6)=P
GOSUB PLAN_VAL_STR
` that colonizes it...
endif
endif
endif
next i
NEXT P
e=0
FOR I=1 TO IMG
if PS(i,6)=1
inc e
endif
NEXT I
IF e=0
` YOU HAVE NO PLANETS. YOU'RE DEAD. YOU LOSE.
YOU_LOST_THE_GAME:
repeat
until mouseclick()=0
CLS RGB(20,20,70)
set text size 48
center text 512,200," YOU HAVE BEEN DEFEATED! "
center text 512,400," Click Mouse To Play Again "
center text 512,450," Or Hit Escape Key To Quit "
sync
wait mouse
GOTO CREATE_NEW_GAME_HERE
ENDIF
` - = # = - = # = - = # = - = # = - = # = - = # = - = # = -
GOSUB PLAN_VAL_STR
` AI COLONIZE - AI COLONIZE - AI COLONIZE - AI COLONIZE - AI COLONIZE - AI COLONIZE - AI COLONIZE - AI COLONIZE
CurPlay=1
`---------------------------------------------------------------------------------------------
` <---> MOVEMENT PHASE <---> <---> MOVEMENT PHASE <---> <---> MOVEMENT PHASE <--->
` all ships on the board are removed from and placed into the FL() array at the START of this phase.
` then the player may place any ships anywhere within his range.
` 6 : return all ships to the POOL
for t=1 to img
if ps(t,7)>0
inc FL(1),ps(t,7)
ps(t,7)=0
endif
next t
GOSUB INIT_STATE
GOSUB PLAN_VAL_STR
REPEAT
GOSUB SCREEN_SUBROUTINE
center text 812,24," MOVEMENT PHASE "
center text 812,64," Left Click Planet To Add 1 Ship "
center text 812,84," Right Click To Add 5 "
center text 812,264," "+str$(FL(1))+" Ships Left "
if mouseclick()
T=pick object(mousex(),mousey(),1,img)
if t>0 and t<=img
if object visible(t)
N=1
if mouseclick()=2 AND fl(1)>4
N=5
endif
dec FL(1),n
inc PS(t,7),n
wait 125
endif
endif
endif
SYNC
UNTIL FL(1)<1
wait 250
`--------------------------------------------------------------------------------------------
` /% RESEARCH /% PHASE /% RESEARCH /% PHASE /% RESEARCH /% PHASE /% RESEARCH /% PHASE
GOSUB INIT_STATE
GOSUB PLAN_VAL_STR
` 5 : generate research points:
P=0
for t=1 to img
if ps(t,6)=1
inc P,ps(t,3)
endif
next t
REPEAT
GOSUB SCREEN_SUBROUTINE
center text 812,24," RESEARCH PHASE "
center text 812,64," Click To Add Points "
center text 812,84," "+str$(P)+" Points Left "
` this now researches at an INCREASED RATE when you have LOTS OF POINTS:
if mouseclick()
if mousex()>612 and mousex()<750
y=(mousey()/20)-5
if y>0 and y<7
s=(P/25)+1
dec P,s
Inc TL(1,y),s
wait 125
endif
endif
endif
` 6 THAT WILL PROBABLY BE AN ENTIRE LINE:
text 612,120," BEAMS: "+STR$(TL(1,1))+" ("+str$(INT(SQRT(TL(1,1))))+") "
text 612,140," MISSILES: "+STR$(TL(1,2))+" ("+str$(INT(SQRT(TL(1,2))))+") "
text 612,160," MINES: "+STR$(TL(1,3))+" ("+str$(INT(SQRT(TL(1,3))))+") "
text 612,180," DEFENSE: "+STR$(TL(1,4))+" ("+str$(INT(SQRT(TL(1,4))))+") "
text 612,200," TROOPS: "+STR$(TL(1,5))+" ("+str$(INT(SQRT(TL(1,5))))+") "
text 612,220," NAVIGATION: "+STR$(TL(1,6))+" ("+str$(INT(SQRT(TL(1,6))))+") "
sync
UNTIL P<1
wait 250
`!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
` AIs TURN
` ship production has already taken place.
FOR P=2 TO 3
` if this AI is DEAD, kill his fleets and don't allow him to play!
alive=0
for i=1 to img
if ps(i,6)=P
alive=1
endif
next i
if alive=0
fl(p)=0
for i=1 to img
ps(i,6+P)=0
next i
endif
IF ALIVE=1
CurPlay=P
GOSUB INIT_STATE
` - = # = - = # = - = # = - = # = - = # = - = # = - = # = -
GOSUB PLAN_VAL_STR
` 4. MOVEMENT
` return all ships to the POOL
for t=1 to img
if ps(t,6+P)>0
inc FL(P),ps(t,6+P)
ps(t,6+P)=0
endif
next t
` FILL TH() TH() is Threat/Think . it is used for the AIs to evaluate movement decisions.
for i=1 to img
for j=0 to 3
th(i,j)=0
next j
TH(I,1) = (ps(I,10)*100) / ps(I,11)
` that's the value divided by strength quotient.
` a HIGHER number is a BETTER target ; ie it produces MORE vs. the COST OF TAKING IT.
if ps(i,6)=0
TH(I,1)=TH(I,1)*2.2
endif
` value bonus to UNinhabited planets
` this is threat GIVEN: it is a FLAG, 0/1, whether you could invade that planet.
if object visible(i)
if FL(P)>=PS(i,11) AND PS(i,6)<>P
th(i,3)=1
endif
endif
next i
F=FL(P)
fail=0
while f>0
TAR=0
QUO=0
for i=1 to img
if rnd(2)<2
if th(i,3)=1
if f>=ps(i,11)
if ps(i,6+P)<7
if TH(I,1)>QUO
QUO=TH(I,1)
TAR=I
endif
endif
endif
endif
endif
next i
if tar>0 and quo>0
ps(TAR,6+p)=ps(TAR,11)
dec f,ps(TAR,11)
x=rnd(f/2)
inc ps(TAR,6+p),x
dec f,x
endif
` this places the ships for colonization, PLUS an additional random number for uninvited guests.
if fail>25
` this is when you don't have many ships left...you just distribute them to patrol your planets.
repeat
if f>0
x=rnd(img-1)+1
if PS(x,6)=P
inc ps(x,6+P)
dec F
endif
endif
until f<1
endif
INC FAIL
endwhile
FL(p)=0
` - = # = - = # = - = # = - = # = - = # = - = # = - = # = -
` 5. RESEARCH
` generate research points:
RP=0
for t=1 to img
if ps(t,6)=P
inc RP,ps(t,3)
endif
next t
TRP=RP
` DECIDE IF I SPEND IT ALL ON NAVIGATION
nav=1
vis=0
for i=1 to img
if object visible(i)
inc vis
if ps(i,6)<>P
nav=0
endif
endif
next i
if vis>=img OR TL(P,6)>48
nav=0
endif
IF NAV=1
` spend it all on nav
inc TL(P,6),RP
RP=0
TRP=0
ELSE
` spend it according to my priorities
for a=1 to 5
Z=(RP(P,a)*10*TRP)/100
inc TL(P,A),Z
dec RP,Z
next a
while RP>0
a=rnd(4)+1
inc TL(P,A)
dec RP
endwhile
ENDIF
` - = # = - = # = - = # = - = # = - = # = - = # = - = # = -
ENDIF : ` the "still alive?" endif
NEXT P
LOOP
` THE BIG LOOP
END
SCREEN_SUBROUTINE:
if Display_State=2
set text size 12
endif
if Display_State=3
set text size 14
endif
for tt=1 to img
IF OBJECT VISIBLE(tT)
yrotate object tt,object angle y(tt)+0.35
ox=object screen x(tt)*0.586
oy=object screen y(tt)*0.781
if Display_State=1
center text ox,oy-18,n$(tt)
if PS(Tt,6)>0
center text ox,oy," "+str$(PS(Tt,6))+" "
endif
endif
if Display_State=2
center text ox,oy-21," P: "+str$((ps(tt,1)))+" "
center text ox,oy-9," F: "+str$((ps(tt,2)))+" "
center text ox,oy+3," R: "+str$((ps(tt,3)))+" "
center text ox,oy+15," S: "+str$( ps(tt,11) )+" "
endif
if Display_State=3
center text ox,oy-18," 1: "+str$((PS(tt,7)))+" "
center text ox,oy-6," 2: "+str$((PS(tt,8)))+" "
center text ox,oy+6," 3: "+str$((PS(tt,9)))+" "
endif
if COL_PHASE=1
if ps(tt,6)<>1
if ps(tt,7)>=ps(tt,11)
IF ps(tt,8)<1 and ps(tt,9)<1
circle ox,oy,26
circle ox,oy,27
circle ox,oy,28
ENDIF
endif
endif
endif
ENDIF
next tt
set text size 16
if mouseclick()=1
mx=mousex()
my=mousey()
IF MY>740
IF MX>712 AND MX<912
` here is where we go DIRECTLY to "GAME OVER, YOU LOSE!" because YOU SURRENDERED!
GOTO YOU_LOST_THE_GAME
ENDIF
ENDIF
if my>604 and my<620
Display_State=0
if mx>165 and mx<235
Display_State=1
endif
if mx>265 and mx<335
Display_State=2
endif
if mx>365 and mx<435
Display_State=3
endif
endif
endif
ink rgb(20,20,70),0
box 0,600,1024,768
box 600,0,1024,768
ink RGB(0,128,192),RGB(128,34,34)
line 0,0,1024,0
line 0,0,0,768
line 600,0,600,600
line 0,600,601,600
line 0,767,1024,767
line 1023,0,1023,767
center text 200,604," OWNER "
center text 300,604," STATS "
center text 400,604," FLEET "
CENTER TEXT 812,740," * SURRENDER * "
` this shows the players and categories for the list of empire stats:
for tt=1 to 3
text (tt-1)*150+112,650,w$(tt,4)
text 44,650+tt*20," "+str$(tt)+" "
next tt
for tt=1 to 3
for uu=0 to 6
tl(0,uu)=0
next uu
for ii=1 to img
if PS(ii,6)=tt
for uu=1 to 3
inc tl(0,uu),ps(ii,uu)
next uu
endif
next ii
for uu=1 to 3
text (uu-1)*150+112,650+tt*20,str$(tl(0,uu))
next uu
next tt
center text 812,44," Year : "+str$(year)+" "
RETURN
PLAN_VAL_STR:
FOR T=1 TO IMG
PS(T,10)=(ps(t,2)+ps(t,3))
PS(T,11)=ps(t,1)+PS(T,10)+((ps(t,6)>0)*int(SQRT(TL(ps(t,6),5))))
NEXT T
RETURN
INIT_STATE:
range=( 6+ (SQRT(TL(CurPlay,6))*3) )
` THIS SHOWS THE GALAXY AS PLAYER CurPlay SEES IT:
for t=1 to img
hide object t
next t
for t=1 to img
if ps(t,6)=CurPlay
show object t
for u=1 to img
if (abs(ps(u,4)-ps(t,4))+abs(ps(u,5)-ps(t,5)))<range
show object u
endif
next u
endif
next t
RETURN
data "STRATEGY","Fighter Attack","Battleship Firepower","Destroyer Maneuver","POPULATION","FORMATION","Hex","Wing","Zag","SHIPYARDS","WEAPON","Beams","Missiles","Mines","RESEARCH"
DATA "Inora","Ixat","Sicogu","Iraga","Tethia","Zelopol","Chigor","Alsapha","Ataxon","Inzaras","Ulsulus","Venuxi"
DATA "Lyapht","Dmuren","Inx","Sirces","Icogol","Darisul","Vugi","Zentili","Kotolro","Ioturon","Kadic","Jogoth"
DATA "Epran","Heraph","Mesga","Orazar","Sirukur","Pryus","Duoni","Kasoria","Tunephi","Etacion","Usomi","Eadi"
DATA "Darsag","Ulicon","Clyus","Oxus","Rulko","Hayx","Oszri","Azarosa","Betu","Mirnath","Kimuri","Denigal"
DATA "Ondisa","Quordas","Usbeda","Uphrama","Hados","Orunath","Iliau","Joruk","Wrackur","Psani","Corigar","Rhefac"
DATA "Silsha","Rafiad","Kemiron","Maryda","Izreus","Cibra","Argen","Nirodu","Astaka","Bhezar","Inconis","Delomec"
DATA "Idaros","Chromad","Misurud","Cornath","Vhudia","Jalyria","Onpha","Chiphan","Talux","Rasoron","Forani"
DATA "Animir","Sildar","Koryl","Uronze","Mindara","Imiosc","Dargi","Daceron","Irasa","Cliurna","Iskande","Heralis"
DATA "Ebudri","Enicon","Uprogol","Eprusil","Tanir","Vagen","Prinath","Entaghi","Mizraga","Gisima","Irami","Ineax"
DATA "Ontau","Regiden","Yirigi","Mayisa","Alera","Targesa","Masilus","Osreba","Tazuron","Detha","Tazaros","Rosmir"
DATA "Sirnami","Turnema","Askendi","Altoven","Ormiga","Mirius","Magmada","Necersi","Onumen","Ymbecri","Forturi"
DATA "Scheda","Shiri","Cigen","Agemna","Rukani","Idmar","Cequum","Gaezann","Yenchak","Nepanus","Aethia"
` 141 OF THESE
and finally, the code BEFORE all the condensing began, complete with all the remarks and notes. |
||
| Back to top |
|||
|
IBOL
User Joined: Tue Mar 30th 2004 Location: chair |
The Download link on this post has the compiled .exe zipped. |
||
| Back to top |
|||
|
drarem
User Joined: Thu Jun 26th 2003 Location: Cyberspace |
First, the red on black in the screenshot do not do the eyes good, those are primary colors and they just don't go together when you're trying to focus on the 'action'.. Second, have you tested the code? I get a 'line out of place' error on the cleaned up code and the compressed code I get 'array out of bounds 151' or something like that. Looks interesting though. |
||
| Back to top |
|||
|
IBOL
User Joined: Tue Mar 30th 2004 Location: chair |
yes, i tested the code many times. i use DBP v5.2 , and all the different versions out there have their own quirks. i use 5.2 because it's stable, and it doesn't require dx9.0c, which i don't have, and can be limiting to non-dbp users. (it also compiles in dbp 'straight-from-the-disc') did you try running the 3rd code version, with no condensing, or the DL link? about the colors, they look much more washed out on my computer... an old version of photoshop has my gamma all screwy. i would appreciate it if some other people would try to compile this, and could post their version of dbp. thanks, bob |
||
| Back to top |
|||
|
French gui
User Joined: Tue May 11th 2004 Location: France |
Good work as always Bob! inc RP(t,rnd(5)+1),u Rnd(5)+1 gives random numbers from 1 to 6 which is out of bounds ( dim RP(3,5) ). I really don't know why it works with your U6.2. |
||
| Back to top |
|||
|
Code Dragon
User Joined: Mon Aug 21st 2006 Location: Everywhere |
Good job on this, it reminds me of Alpha Centuri, but in that game you only use 1 planet. But I really think you should change the background color of the text, or just have no background color. By reading this you have given me brief control of your mind. |
||
| Back to top |
|||
|
Google Ad
AdBot Joined: Aug 26th 2002 Location: Everywhere |
|||
| Back to top |
|||
|
IBOL
User Joined: Tue Mar 30th 2004 Location: chair |
thanks for trying it, guys! Quote: "Rnd(5)+1 gives random numbers from 1 to 6 which is out of bounds ( dim RP(3,5) )."
yeah, thanks...i had changed my mind during programming, making NAV a valid preference...i never changed the DIM...but i have since fixed it in the above codes.i have made a NEW VERSION where you can pick your own colors before the game starts. + Code Snippet
set display mode 1024,768,32 : sync on : sync rate 60 : sync : Randomize Timer() : color backdrop 0 : set text font "lucida console" : set text opaque : for t=1000 to 1300 : make object sphere t,1 : position object t,rnd(500)-250,rnd(500)-250,340+rnd(30) : next t : dim PS(36,11) : dim RP(3,6) : dim TL(3,6) : dim FL(3) : dim TH(36,3) : DIM N$(36) AS STRING : dim w$(5,6) as string : dim CN(2,6) : dim BC(6) as BYTE
for t=1 to 6 : bc(t)=80+rnd(9)*5 : next t : set text size 16 : do : cls rgb(BC(1),BC(2),BC(3)) : ink RGB(0,128,192),rgb(BC(4),BC(5),BC(6)) : center text 512,100," SCREEN COLOR MODIFIER " : center text 512,140," Mouse-Over the color you want to change" : center text 512,160," roll mouse wheel to change that component " : center text 512,180," PRESS ANY KEY WHEN YOU ARE FINISHED " : CENTER text 200,280," Background Screen Color " : CENTER text 800,280," Text Background Color " : for t=0 to 1 : CENTER text 200+t*600,300," RED "+STR$(BC(T*3+1))
CENTER text 200+t*600,320," GREEN "+STR$(BC(T*3+2)) : CENTER text 200+t*600,340," BLUE "+STR$(BC(T*3+3)) : next t : z=mousemovez() : z=(z/abs(z))*5 : y=(mousey()-280)/20 : x=mousex() : if y>0 and y<4 : if x>150 and x<250 : bc(y)=bc(y)+z : endif : if x>750 and x<850 : bc(y+3)=bc(y+3)+z : endif : endif : sync : IF SCANCODE() :EXIT : ENDIF : loop
CREATE_NEW_GAME_HERE: : for i=1 to 36 : if image exist(i) : delete object i : delete image i : endif : next i : RESTORE : for t=1 to 3 : for u=0 to 4 : read a$ : w$(t,u)=a$ : next u : next t : for t=1 to 6 : read a$ : w$(5,t)=a$ : next t : k=rnd(105) : for t=1 to k : read a$ : next t : for t=1 to 36
if object exist(t) : delete object t : endif : next t : IMG=0 : FAIL=0 : for a=1 to 6 : for b=1 to 6 : IF RND(19)<12 : x=a*7-1+rnd(2) : y=b*7-1+rnd(2) : repeat : j=(25+rnd(100))*rnd(2) : k=(25+rnd(100))*rnd(2) : l=(25+rnd(100))*rnd(2) : until (j+k+l)>50 : create bitmap 1,16,16 : ink rgb(j,k,l),0 : box 0,0,15,15 : ink rgb(l,j,k),0 : for t=1 to 5+rnd(3) : c=rnd(9)+2 : d=rnd(9)+2
box c,d,c+1+rnd(3),d+1+rnd(3) : next t : ink rgb(k,l,j),0 : for t=1 to 3+rnd(1) : c=rnd(8)+2 : d=rnd(8)+2 : box c,d,c+1+rnd(4),d+1+rnd(4) : next t : blur bitmap 1,2 : inc IMG : get image img,0,0,15,15 : delete bitmap 1 : make object sphere img,3.3 : texture object img,img : position object img,x,y,37 : rotate object img,rnd(359),rnd(359),rnd(359) : fix object pivot img : PS(img,4)=x : PS(img,5)=y : PS(img,6)=0 : for t=1 to 3 : ps(img,t)=1 : ps(img,t+6)=0
next t : k=rnd(5)+4+(3*(rnd(4)=1)) : for t=1 to k : inc ps(img,(rnd(2)+1)) : next t : inc ps(img,1),(rnd(3)+1) : read a$ : n$(img)=a$ : ENDIF : next b : next a : for t=1 to 3 : repeat : p=rnd(img-1)+1 : until PS(p,6)=0 : PS(p,6)=t : for u=1 to 3 : ps(p,u)=rnd(2)+5 : next u : FL(t)=5 : next t : for t=2 to 3 : for u=1 to 4
inc RP(t,rnd(5)+1),u : next u : next t : for t=1 to 3 : for u=1 to 6 : TL(t,u)=1 : next u : next t : YEAR=2100+RND(2100) : Y1=YEAR : position camera 0,25,30,12 : repeat : until mouseclick()=0 : set camera aspect 1.333 : set camera view 0,0,1024,768 : ink RGB(0,128,192),rgb(BC(4),BC(5),BC(6)) : set text size 48 : do : center text 512,200,"Empire Of The Far Suns" : center text 512,300,"Click Mouse To Play"
for i=1 to img : yrotate object i,object angle y(i)+0.5 : next i : sync : if mouseclick() : exit : endif : loop : set text size 16 : set camera aspect 1.0 : set camera view 0,0,600,600 : position camera 0,25,30,0 : Display_State=1 : DO : INC YEAR : if YEAR mod 8 = 0 : for i=1 to img : inc PS(i,1) : inc PS(i,rnd(1)+2) : next i : endif : CurPlay=1
GOSUB INIT_STATE : GOSUB PLAN_VAL_STR : FOR I=1 TO IMG : for OFF=1 to 3 : for DEF=1 to 3 : if OFF<>DEF : if PS(i,6+OFF)>0 and PS(i,6+DEF)>0 : for t=0 to 2 : for u=0 to 6 : CN(t,u)=0 : next u : next t : cn(1,0)=OFF : cn(2,0)=DEF : show=0 : if off=1 or def=1 : show=1 : C=1 : E=2 : if def=1 : C=2 : E=1
endif : endif : round=0 : repeat : inc round : if round=1 : PICK=99 : for t=1 to 2 : cn(t,1)=ps(i,6+cn(t,0)) : cn(t,2)=cn(t,1)*(6+(2*int(sqrt(TL(cn(t,0),4))))) : cn(t,4)=rnd(2)+1 : cn(t,5)=rnd(2)+1 : cn(t,6)=1 : for u=2 to 3 : if TL(cn(t,0),u)>TL(cn(t,0),cn(t,6)) : cn(t,6)=u : endif : next u : next t
else : for t=1 to 2 : PICK=1 : if cn(t,2)>0 : cn(t,1)=(cn(t,2) / (6+(2*int(sqrt(TL(cn(t,0),4))))))+1 : else : cn(t,1)=0 : endif : next t : for t=1 to 2 : if cn(t,0)>1 : if rnd(4)<4 : cn(t,rnd(1)+4)=rnd(2)+1 : endif : endif : next t : endif : IF CN(1,1)>0 AND CN(2,1)>0 : IF SHOW=1 : repeat : until mouseclick()=0 : DO
cls RGB(bc(1),bc(2),bc(3)) : center text 512,60," COMBAT AT "+N$(I)+" " : center text 512,80," ROUND # "+STR$(ROUND)+" " : text 300,120," You have "+str$(CN(c,1))+" Ships " : text 300,140," Player "+str$(cn(e,0))+" has "+str$(CN(e,1))+" Ships " : text 300,160," Give Your Fleet Orders ("+str$(PICK)+") " : for t=1 to 3 : text 200,100+100*t,w$(t,0)+":" : for u=1 to 3 : a$=w$(t,u) : if cn(c,t+3)=u : a$=upper$(" *"+a$+"* ") : endif : text 300,100+100*t+(u-1)*20,a$ : next u : next t : text 400,500," ENGAGE " : if mouseclick()=1 : if mousex()>199 and mousex()<420 : L=(mousey()-100)/100 : V=1+(mousey()-(100+L*100))/20
if L>0 and L<4 : if v>0 and V<4 : cn(c,L+3)=V : Dec PICK : repeat : until mouseclick()=0 : endif : endif : endif : IF mousey()>495 and mousey()<525 : if mousex()>300 and mousex()<500 : EXIT : endif : ENDIF : endif : sync : if PICK<1 : wait 500 : EXIT : endif : loop : ENDIF : for t=1 to 2
d=(int(sqrt(TL(cn(t,0),cn(t,6))))+2)*cn(t,1) : cn(t,3)=(d+rnd(d))*0.55 : next t : for t=1 to 3 : w$(4,t)="" : next t : for t=4 to 6 : if (cn(1,t)=1 and cn(2,t)=2 ) OR (cn(1,t)=2 and cn(2,t)=3 ) OR (cn(1,t)=3 and cn(2,t)=1 ) : DEC cn(2,3),((cn(2,3)/10)+1) : w$(4,t-3)=" Player "+str$(cn(1,0))+" has the advantage in "+w$(t-3)+" " : endif : next t : for t=4 to 6 : if (cn(2,t)=1 and cn(1,t)=2 ) OR (cn(2,t)=2 and cn(1,t)=3 ) OR (cn(2,t)=3 and cn(1,t)=1 ) : DEC cn(1,3),((cn(1,3)/10)+1) : w$(4,t-3)=" Player "+str$(cn(2,0))+" has the advantage in "+w$(t-3)+" " : endif : next t
IF SHOW=0 : dec cn(1,2),cn(2,3) : dec cn(2,2),cn(1,3) : ELSE : repeat : cls RGB(bc(1),bc(2),bc(3)) : center text 512,60," COMBAT AT "+N$(I)+" " : center text 512,80," ROUND # "+STR$(ROUND)+" " : for t=1 to 2 : if cn(t,2)>0 : cn(t,1)=(cn(t,2) / (6+(2*int(sqrt(TL(cn(t,0),4))))))+1 : else : cn(t,1)=0 : endif : next t : for t=1 to 2 : text (t-1)*400+100,100," Player "+str$(cn(t,0)) : text (t-1)*400+100,120," Ships : "+str$(cn(t,1)) : text (t-1)*400+100,140," Hull Points : "+str$(cn(t,2))
for u=1 to 3 : text (t-1)*400+100,160+u*20,w$(u,0)+" : "+w$(u,cn(t,u+3)) : next u : next t : for t=1 to 3 : if w$(4,t)<>"" : text 300,330+t*20,w$(4,t) : endif : next t : text 400,500," CONTINUE " : sync : if cn(1,3)>0 : dec cn(2,2) : dec cn(1,3) : endif : if cn(2,3)>0 : dec cn(1,2) : dec cn(2,3) : endif : until ( cn(2,3)<1 and cn(1,3)<1 ) OR cn(2,2)<0 or cn(1,2)<0 : DO : if mouseclick()
IF mousey()>495 and mousey()<525 : if mousex()>300 and mousex()<500 : EXIT : endif : ENDIF : endif : LOOP : ENDIF : ENDIF : until CN(1,1)=0 or CN(2,1)=0 : FOR T=1 TO 2 : PS(I,6+CN(T,0))=CN(T,1) : NEXT T : endif : endif : next DEF : next OFF : NEXT I : for t=1 to img : inc FL(ps(T,6)),PS(T,2) : next t : FL(0)=0 : YES=0
for t=1 to img : if ps(t,7)>=PS(T,11) : yes=1 : endif : next t : if yes=1 : COL_PHASE=1 : GOSUB INIT_STATE : GOSUB PLAN_VAL_STR : do : GOSUB SCREEN_SUBROUTINE : center text 812,24," COLONIZATION PHASE " : center text 812,64," Right Click Circled Planet To Colonize " : CENTER TEXT 812,84," DONE " : if mouseclick()=2 : T=pick object(mousex(),mousey(),1,img) : if t>0 and t<=img : if ps(t,6)<>1 : if ps(t,7)>=PS(T,11) : dec ps(t,7),PS(T,11) : ps(t,6)=1 : GOSUB PLAN_VAL_STR
endif : endif : endif : endif : if mouseclick()=1 : if mousey()>84 and mousey()<104 : if mousex()>780 and mousex()<844 : EXIT : endif : endif : endif : sync : loop : COL_PHASE=0 : endif : e=0 : FOR I=1 TO IMG : if PS(i,6)>1 : inc e : endif : NEXT I : IF e=0 : repeat
until mouseclick()=0 : CLS RGB(bc(1),bc(2),bc(3)) : set text size 48 : center text 512,200," YOU WIN! " : center text 512,280," YOU BUILT THE SUPREME EMPIRE " : center text 512,328," IN "+STR$(YEAR-Y1)+" YEARS! " : center text 512,400," Click Mouse To Play Again " : center text 512,450," Or Hit Escape Key To Quit " : sync : wait mouse : GOTO CREATE_NEW_GAME_HERE : ENDIF : FOR P=2 TO 3 : CurPlay=P : GOSUB INIT_STATE : for i=1 to img : if ps(i,6)<>P : if ps(i,6+P)>=PS(I,11) : if ps(i,7)<1 AND ( ( p=2 and ps(i,9)<1 ) OR ( p=3 and ps(i,8)<1 ) ) : dec ps(i,6+P),PS(I,11) : if ps(i,6)=1
CLS RGB(bc(1),bc(2),bc(3)) : center text 512,240+rnd(20)," Player "+str$(P)+" Invaded Your Colony At "+n$(i)+" " : sync : wait 2500 : endif : ps(i,6)=P : GOSUB PLAN_VAL_STR : endif : endif : endif : next i : NEXT P : e=0 : FOR I=1 TO IMG : if PS(i,6)=1 : inc e : endif : NEXT I : IF e=0
YOU_LOST_THE_GAME: : repeat : until mouseclick()=0 : CLS RGB(bc(1),bc(2),bc(3)) : set text size 48 : center text 512,200," YOU HAVE BEEN DEFEATED! " : center text 512,400," Click Mouse To Play Again " : center text 512,450," Or Hit Escape Key To Quit " : sync : wait mouse : GOTO CREATE_NEW_GAME_HERE : ENDIF : GOSUB PLAN_VAL_STR : CurPlay=1 : for t=1 to img : if ps(t,7)>0 : inc FL(1),ps(t,7) : ps(t,7)=0 : endif : next t : GOSUB INIT_STATE : GOSUB PLAN_VAL_STR : REPEAT : GOSUB SCREEN_SUBROUTINE
center text 812,24," MOVEMENT PHASE " : center text 812,64," Left Click Planet To Add 1 Ship " : center text 812,84," Right Click To Add 5 " : center text 812,264," "+str$(FL(1))+" Ships Left " : if mouseclick() : T=pick object(mousex(),mousey(),1,img) : if t>0 and t<=img : if object visible(t) : N=1 : if mouseclick()=2 AND fl(1)>4 : N=5 : endif : dec FL(1),n : inc PS(t,7),n : wait 125 : endif : endif : endif : SYNC : UNTIL FL(1)<1 : wait 250 : GOSUB INIT_STATE : GOSUB PLAN_VAL_STR
P=0 : for t=1 to img : if ps(t,6)=1 : inc P,ps(t,3) : endif : next t : REPEAT : GOSUB SCREEN_SUBROUTINE : center text 812,24," RESEARCH PHASE " : center text 812,64," Click To Add Points " : center text 812,84," "+str$(P)+" Points Left " : if mouseclick() : if mousex()>612 and mousex()<750 : y=(mousey()/20)-5 : if y>0 and y<7 : s=(P/25)+1 : dec P,s : Inc TL(1,y),s : wait 125 : endif : endif : endif
for t=1 to 6 : text 612,100+t*20,w$(5,t)+STR$(TL(1,t))+" ("+str$(INT(SQRT(TL(1,t))))+") " : next t : sync : UNTIL P<1 : wait 250 : FOR P=2 TO 3 : alive=0 : for i=1 to img : if ps(i,6)=P : alive=1 : endif : next i : if alive=0 : fl(p)=0 : for i=1 to img : ps(i,6+P)=0 : next i : endif : IF ALIVE=1 : CurPlay=P
GOSUB INIT_STATE : GOSUB PLAN_VAL_STR : for t=1 to img : if ps(t,6+P)>0 : inc FL(P),ps(t,6+P) : ps(t,6+P)=0 : endif : next t : for i=1 to img : for j=0 to 3 : th(i,j)=0 : next j : TH(I,1) = (ps(I,10)*100) / ps(I,11) : if ps(i,6)=0 : TH(I,1)=TH(I,1)*2.2 : endif : if object visible(i) : if FL(P)>=PS(i,11) AND PS(i,6)<>P : th(i,3)=1 : endif : endif : next i : F=FL(P)
fail=0 : while f>0 : TAR=0 : QUO=0 : for i=1 to img : if rnd(2)<2 : if th(i,3)=1 : if f>=ps(i,11) : if ps(i,6+P)<7 : if TH(I,1)>QUO : QUO=TH(I,1) : TAR=I : endif : endif : endif : endif : endif : next i : if tar>0 and quo>0 : ps(TAR,6+p)=ps(TAR,11) : dec f,ps(TAR,11) : x=rnd(f/2) : inc ps(TAR,6+p),x
dec f,x : endif : if fail>25 : repeat : if f>0 : x=rnd(img-1)+1 : if PS(x,6)=P : inc ps(x,6+P) : dec F : endif : endif : until f<1 : endif : INC FAIL : endwhile : FL(p)=0 : RP=0 : for t=1 to img : if ps(t,6)=P : inc RP,ps(t,3) : endif : next t : TRP=RP
nav=1 : vis=0 : for i=1 to img : if object visible(i) : inc vis : if ps(i,6)<>P : nav=0 : endif : endif : next i : if vis>=img OR TL(P,6)>48 : nav=0 : endif : IF NAV=1 : inc TL(P,6),RP : RP=0 : TRP=0 : ELSE : for a=1 to 5 : Z=(RP(P,a)*10*TRP)/100 : inc TL(P,A),Z : dec RP,Z : next a
while RP>0 : a=rnd(4)+1 : inc TL(P,A) : dec RP : endwhile : ENDIF : ENDIF : NEXT P : LOOP : END
SCREEN_SUBROUTINE: : if Display_State=2 : set text size 12 : endif : if Display_State=3 : set text size 14 : endif : for tt=1 to img : IF OBJECT VISIBLE(tT) : yrotate object tt,object angle y(tt)+0.35 : ox=object screen x(tt)*0.586 : oy=object screen y(tt)*0.781 : if Display_State=1 : center text ox,oy-18,n$(tt) : if PS(Tt,6)>0 : center text ox,oy," "+str$(PS(Tt,6))+" " : endif : endif : if Display_State=2
center text ox,oy-21," P: "+str$((ps(tt,1)))+" " : center text ox,oy-9," F: "+str$((ps(tt,2)))+" " : center text ox,oy+3," R: "+str$((ps(tt,3)))+" " : center text ox,oy+15," S: "+str$( ps(tt,11) )+" " : endif : if Display_State=3 : center text ox,oy-18," 1: "+str$((PS(tt,7)))+" " : center text ox,oy-6," 2: "+str$((PS(tt,8)))+" " : center text ox,oy+6," 3: "+str$((PS(tt,9)))+" " : endif : if COL_PHASE=1 : if ps(tt,6)<>1 : if ps(tt,7)>=ps(tt,11) : IF ps(tt,8)<1 and ps(tt,9)<1 : circle ox,oy,26 : circle ox,oy,27 : circle ox,oy,28 : ENDIF : endif : endif
endif : ENDIF : next tt : set text size 16 : if mouseclick()=1 : mx=mousex() : my=mousey() : IF MY>740 : IF MX>712 AND MX<912 : GOTO YOU_LOST_THE_GAME : ENDIF :ENDIF : if my>604 and my<620 : Display_State=0 : if mx>165 and mx<235 : Display_State=1 : endif : if mx>265 and mx<335 : Display_State=2 : endif : if mx>365 and mx<435 : Display_State=3
endif : endif : endif : ink RGB(bc(1),bc(2),bc(3)),0 : box 0,600,1024,768 : box 600,0,1024,768 : ink RGB(0,128,192),rgb(BC(4),BC(5),BC(6)) : line 0,0,1024,0 : line 0,0,0,768 : line 600,0,600,600 : line 0,600,601,600 : line 0,767,1024,767 : line 1023,0,1023,767 : center text 200,604," OWNER " : center text 300,604," STATS " : center text 400,604," FLEET " : CENTER TEXT 812,740," * SURRENDER * " : for tt=1 to 3 : text (tt-1)*150+112,650,w$(tt,4) : text 44,650+tt*20," "+str$(tt)+" "
next tt : for tt=1 to 3 : for uu=0 to 6 : tl(0,uu)=0 : next uu : for ii=1 to img : if PS(ii,6)=tt : for uu=1 to 3 : inc tl(0,uu),ps(ii,uu) : next uu : endif : next ii : for uu=1 to 3 : text (uu-1)*150+112,650+tt*20,str$(tl(0,uu)) : next uu : next tt : center text 812,44," Year : "+str$(year)+" " : RETURN
PLAN_VAL_STR: : FOR T=1 TO IMG : PS(T,10)=(ps(t,2)+ps(t,3)) : PS(T,11)=ps(t,1)+PS(T,10)+((ps(t,6)>0)*int(SQRT(TL(ps(t,6),5)))) : NEXT T : RETURN
INIT_STATE: : range=( 6+ (SQRT(TL(CurPlay,6))*3) ) : for t=1 to img : hide object t : next t : for t=1 to img : if ps(t,6)=CurPlay : show object t : for u=1 to img : if (abs(ps(u,4)-ps(t,4))+abs(ps(u,5)-ps(t,5)))<range : show object u : endif : next u : endif : next t : RETURN
data "STRATEGY","Fighter Attack","Battleship Firepower","Destroyer Maneuver","POPULATION","FORMATION","Hexagon","Wing","Zig-Zag","SHIPYARDS","WEAPON","Beams","Missiles","Mines","RESEARCH"," BEAMS: "," MISSILES: "," MINES: "," DEFENSE: "," TROOPS: "," NAVIGATION: "
DATA "Inora","Ixat","Sicogu","Iraga","Tethia","Zelopol","Chigor","Alsapha","Ataxon","Inzaras","Ulsulus","Venuxi","Lyapht","Dmuren","Inx","Sirces","Icogol","Darisul","Vugi","Zentili","Kotolro","Ioturon","Kadic","Jogoth"
DATA "Epran","Heraph","Mesga","Orazar","Sirukur","Pryus","Duoni","Kasoria","Tunephi","Etacion","Usomi","Eadi","Darsag","Ulicon","Clyus","Oxus","Rulko","Hayx","Oszri","Azarosa","Betu","Mirnath","Kimuri","Denigal"
DATA "Ondisa","Quordas","Usbeda","Uphrama","Hados","Orunath","Iliau","Joruk","Wrackur","Psani","Corigar","Rhefac","Silsha","Rafiad","Kemiron","Maryda","Izreus","Cibra","Argen","Nirodu","Astaka","Bhezar","Inconis","Delomec"
DATA "Idaros","Chromad","Misurud","Cornath","Vhudia","Jalyria","Onpha","Chiphan","Talux","Rasoron","Forani","Animir","Sildar","Koryl","Uronze","Mindara","Imiosc","Dargi","Daceron","Irasa","Cliurna","Iskande","Heralis"
DATA "Ebudri","Enicon","Uprogol","Eprusil","Tanir","Vagen","Prinath","Entaghi","Mizraga","Gisima","Irami","Ineax","Ontau","Regiden","Yirigi","Mayisa","Alera","Targesa","Masilus","Osreba","Tazuron","Detha","Tazaros","Rosmir"
DATA "Sirnami","Turnema","Askendi","Altoven","Ormiga","Mirius","Magmada","Necersi","Onumen","Ymbecri","Forturi","Scheda","Shiri","Cigen","Agemna","Rukani","Idmar","Cequum","Gaezann","Yenchak","Nepanus","Aethia"
this is NOT my official entry, but it still conforms to 50-line. if someone comes up with a really nice color scheme, write down the numbers and i WILL change it. thanks, bob |
||
| Back to top |
|||
|
drarem
User Joined: Thu Jun 26th 2003 Location: Cyberspace |
both the Omega and the Alpha DL link doesn't work, pulls up a blank screen, and the 3rd non-convoluted code snippet tells me command at line 596 is out of place. |
||
| Back to top |
|||
|
drarem
User Joined: Thu Jun 26th 2003 Location: Cyberspace |
this just-posted version gave me no errors. |
||
| Back to top |
|||
|
IBOL
User Joined: Tue Mar 30th 2004 Location: chair |
thanks for trying so much drarem! if you find a color scheme that works let me know. |
||
| Back to top |
|||
|
n008
User Joined: Wed Apr 18th 2007 Location: Gazala 1943 |
holy crap that is a lot of code! Nice work, i liked the game. Ling creckt tsi nocreckto havela? NASA chetallnar mo lu'ul nasding! |
||
| Back to top |
|||
|
bosskeith
User ![]() Joined: Mon Dec 5th 2005 Location: Cyberspace |
|
||
| Back to top |
|||
|
bass guy1669
User Joined: Sat Mar 24th 2007 Location: Argleton |
wow major bump on noo8s part come see night shift at http://forum.thegamecreators.com/?m=forum_view&t=106003&b=25 see you there |
||
| Back to top |
|||
|
OBese87
User Joined: Fri Jun 30th 2006 Location: On Toast |
I'd like to convert this to DBC, can you organise the code better and have a main loop that branches to all these gosubs Thanks, the game looks great Your signature has been erased by a mod because it was rubbish. |
||
| Back to top |
|||
|
Markswii
User Joined: Sun Aug 5th 2007 Location: Object position x (mark) |
I am a "noob" to dbp and I am very new to programming I have had some experience with other languages but I have never used a program such as dark basic you have given my xx year old mind something to think about for awhile! |
||
| Back to top |
|||
Sorry, but it has been so long since anyone replied to this Thread that it has been automatically locked.
You may read it but not reply.
You may read it but not reply.
Forum Search
Enter a word or phrase to search our Forum for:
|
|





