8-Bit Software Online Conversion
Orbit Game - Listing
10REM Program ORBIT
20REM Version B2.0
30REM Author Cliff Blake
40REM BEEBUG March 1993
50REM Program subject to copyright
60:
100MODE7:*FX11
110PROCinfo:g%=GET
120MODE0:VDU5
130REPEAT
140quit%=FALSE
150CLS:PROCplanet:PROCspaceship
160REPEAT
170rerun%=FALSE
180PROCmove:PROCaltitude
190PROCgravity:PROCthrust
200PROCflags
210UNTIL rerun%
220UNTIL quit%
230VDU4:*FX12
240CLS:*FX21
250END
260:
1000DEF PROCmove
1010MOVE Xs,Ys:PRINT CHR$64
1020ENDPROC
1030:
1040DEF PROCaltitude
1050Xd=640-Xs:Yd=512-Ys
1060Rds=Xd*Xd+Yd*Yd:Rd=SQR(Rds)
1070alt%=INT(.2*Rd)
1080VDU4:PRINT TAB(55,2)"ALTITUDE: ";al
t%;",000 km";SPC3:VDU5
1090ENDPROC
1100:
1110DEF PROCgravity
1120Xg=20000*Xd/Rd/Rds:Yg=20000*Yd/Rd/R
ds
1130Xv=Xv+Xg:Yv=Yv+Yg
1140Rvs=Xv*Xv+Yv*Yv:Rv=SQR(Rvs)
1150vel%=INT(.85*Rv)
1160VDU4:PRINT TAB(55,4)"VELOCITY: ";ve
l%;",000 km/h";SPC3:VDU5
1170ENDPROC
1180:
1190DEF PROCthrust
1200Xt=0.05*Xv/Rv:Yt=0.05*Yv/Rv
1210IF INKEY(-103) THEN Xv=Xv-Xt:Yv=Yv-
Yt:SOUND0,-7,6,4
1220IF INKEY(-104) THEN Xv=Xv+Xt:Yv=Yv+
Yt:SOUND0,-7,6,4
1230Xs=Xs+Xv:Ys=Ys+Yv
1240ENDPROC
1250:
1260DEF PROCflags
1270IF INKEY(-52) THEN rerun%=TRUE
1280IF INKEY(-17) THEN rerun%=TRUE:quit
%=TRUE
1290ENDPROC
1300:
1310DEF PROCplanet
1320Ca=COS(PI/40):Sa=SIN(PI/40)
1330CA=1:SA=0:MOVE 640+40,512
1340FOR A=1 TO 80
1350Cp=CA:Sp=SA
1360CA=Cp*Ca-Sp*Sa:SA=Sp*Ca+Cp*Sa
1370x=40*CA+640:y=40*SA+512
1380MOVE 640,512:PLOT 85,x,y
1390NEXT A
1400ENDPROC
1410:
1420DEF PROCspaceship
1430VDU23,64,192,0,0,0,0,0,0,0
1440Xs=640:Ys=900
1450Xv=3.5:Yv=0
1460ENDPROC
1470:
1480DEF PROCinfo
1490y$=CHR$131:c$=CHR$134:w$=CHR$135
1500PRINT TAB(10,2)y$+"SATELLITE ORBIT"
1510PRINT'c$+"A spaceship is in ellipti
cal orbit"
1520PRINT c$+"around a planet. Try usin
g its"
1530PRINT c$+"propulsion and retro brak
ing units"
1540PRINT c$+"to make the orbit circula
r."
1550PRINT'w$+"Gently holding down the <
key will"
1560PRINT w$+"fire the retro unit to sl
ow the ship."
1570PRINT'w$+"Gently holding down the >
key will"
1580PRINT w$+"fire the drive to acceler
ate the ship."'
1590PRINT c$+"The smaller the variation
s in"
1600PRINT c$+"altitude and velocity, th
e more"
1610PRINT c$+"circular the orbit."
1620PRINT'w$+"Press any key to start."
1630PRINT'w$+"Press R to clear the scre
en & Repeat."
1640PRINT'w$+"Press Q to Quit."
1650ENDPROC