mirror of
https://github.com/deater/dos33fsprogs.git
synced 2025-01-12 15:30:55 +00:00
ksp: getting closer
This commit is contained in:
parent
0c9399f52a
commit
403d69ba9d
86
ksp/ksp.bas
86
ksp/ksp.bas
@ -1,13 +1,11 @@
|
||||
7 TEXT:HOME
|
||||
10 REM PRINT CHR$(4);"BLOAD GLOBE.HGR,A$2000"
|
||||
20 AN$="ZURGTROYD"
|
||||
90 S=3
|
||||
20 AN$="ZURGTROYD":S=3
|
||||
95 G=-9.8
|
||||
100 EN(1)=1:ST(1)=1:FT(1)=1
|
||||
101 EN(2)=2:ST(2)=2:FT(2)=1
|
||||
102 EN(3)=3:ST(3)=3:FT(3)=1
|
||||
103 LN=0
|
||||
104 CQ=0
|
||||
103 LN=0:CQ=0:OM=0
|
||||
110 HIMEM:7925
|
||||
120 POKE 232,245:POKE 233,30
|
||||
130 FOR L=7925 TO 8175: READ B:POKE L,B:NEXT L
|
||||
@ -26,65 +24,52 @@
|
||||
1040 DV(I)=270*-G*LOG(TM(I)/(TM(I)-FM(I)))
|
||||
1050 TW(I)=TH(I)/(TM(I)*-G)
|
||||
1055 FF(I)=TH(I)/(270*-G)
|
||||
1990 PRINT "STAGE: ";I
|
||||
1990 PRINT "STAGE: ";4-I
|
||||
1991 PRINT " TANKS=";ST(I)*FT(I);" ENGINES=";EN(I)
|
||||
1992 PRINT " STAGE MASS=";SM(I);" TOTAL MASS=";TM(I)
|
||||
1993 PRINT " DELTAV=";DV(I)
|
||||
1995 PRINT " TWR=";TW(I)
|
||||
2000 NEXT I
|
||||
2999 GET A$
|
||||
3000 AN=0
|
||||
3012 GX=0:GY=-9.8:GA=0
|
||||
3013 V=0:VX=0:VY=0
|
||||
3014 AX=0:AY=0
|
||||
3015 KR=600000
|
||||
3016 RX=0:RY=KR+10
|
||||
3017 RA=KR+10
|
||||
3018 TR=0:T=0
|
||||
3000 AN=0:GX=0:GY=-9.8:GA=0:V=0:VX=0:VY=0:AX=0:AY=0:KR=600000
|
||||
3016 RX=0:RY=KR+10:RA=KR+10:TR=0:T=0
|
||||
3020 HGR:ROT=0:SCALE=2:H=0
|
||||
3030 REM ** LAUNCHPAD **
|
||||
3035 PRINT:PRINT CHR$(4);"BLOAD LAUNCHPAD.HGR,A$2000"
|
||||
3038 HCOLOR=1:HPLOT 1,80 TO 132,80: HPLOT 148,80 TO 247,80
|
||||
3039 HCOLOR=3:HPLOT 110,110 TO 110,60:HPLOT TO 130,60: HPLOT 110,70 TO 130,70
|
||||
4000 REM
|
||||
4001 IF LN=0 GOTO 5032
|
||||
4003 IF (RA-KR)>1800 THEN GOTO 4012
|
||||
3040 XDRAW 1+((S-1)*2)+TR AT 140,80
|
||||
4000 REM ** LOOP **
|
||||
4002 IF LN=0 GOTO 5032
|
||||
4003 RR=RA-KR
|
||||
4004 IF RR>1800 THEN GOTO 4012
|
||||
4005 HCOLOR=0:HPLOT 1,80+H TO 132,80+H:HPLOT 148,80+H TO 247,80+H
|
||||
4010 H=(RA-KR)/20:HCOLOR=1:HPLOT 1,80+H TO 132,80+H:HPLOT 148,80+H TO 247,80+H
|
||||
4012 IF (RA-KR)<10000 AND CQ<>0 THEN GOSUB 7600
|
||||
4014 IF (RA-KR)<10000 GOTO 4018
|
||||
4016 IF (RA-KR)>10000 AND CQ<>1 THEN GOSUB 7700
|
||||
4010 H=RR/20:HCOLOR=1:HPLOT 1,80+H TO 132,80+H:HPLOT 148,80+H TO 247,80+H
|
||||
4012 IF RR<40000 AND CQ<>0 THEN GOSUB 7600
|
||||
4014 IF RR<40000 GOTO 4018
|
||||
4016 IF RR>40000 AND CQ<>1 THEN GOSUB 7700
|
||||
4018 FL=FM(S)*100/SF(S)
|
||||
4020 IF TR<>1 THEN GOTO 4050
|
||||
4025 IF FM(S)<0.1 THEN FM(S)=0:AX=0:AY=0:GOTO 4050
|
||||
4030 AX=(TH(S)/TM(S))*SIN(AN)
|
||||
4035 AY=(TH(S)/TM(S))*COS(AN)
|
||||
4040 FM(S)=FM(S)-FF(S)
|
||||
4045 TM(S)=TM(S)-FF(S)
|
||||
4030 AX=(TH(S)/TM(S))*SIN(AN):AY=(TH(S)/TM(S))*COS(AN)
|
||||
4040 FM(S)=FM(S)-FF(S):TM(S)=TM(S)-FF(S)
|
||||
4047 GOTO 4060
|
||||
4050 REM NOT THRUSTING
|
||||
4055 AX=0:AY=0
|
||||
4060 GA=ATN(RX/RY)
|
||||
4062 REM PRINT "GA=";GA;" AY=";AY
|
||||
4065 IF RY<0 THEN GA=GA+3.14
|
||||
4070 GY=COS(GA)*G
|
||||
4075 GX=SIN(GA)*G
|
||||
4080 AY=AY+GY
|
||||
4085 AX=AX+GX
|
||||
4090 ZX=VX
|
||||
4095 ZY=VY
|
||||
5000 VY=ZY+AY
|
||||
5005 VX=ZX+AX
|
||||
4070 GY=COS(GA)*G:GX=SIN(GA)*G
|
||||
4080 AY=AY+GY:AX=AX+GX
|
||||
4090 ZX=VX:ZY=VY
|
||||
5000 VY=ZY+AY:VX=ZX+AX
|
||||
5010 V=SQR(VX*VX+VY*VY)
|
||||
5012 RY=RY+0.5*(ZY+VY)
|
||||
5014 RX=RX+0.5*(ZX+VX)
|
||||
5012 RY=RY+0.5*(ZY+VY):RX=RX+0.5*(ZX+VX)
|
||||
5018 RA=SQR(RX*RX+RY*RY)
|
||||
5020 IF RA<KR THEN PRINT "CRASH": END
|
||||
5020 IF RA<KR THEN GOTO 8000
|
||||
5030 G=-9.8/((RA/KR)*(RA/KR))
|
||||
5031 REM PRINT "-------------------------"
|
||||
5032 VTAB 21
|
||||
5040 PRINT "TIME: ";T,"STAGE: ";S;" ";AN$
|
||||
5045 PRINT "ALT: ";INT((RA-KR)/1000);"KM "
|
||||
5040 PRINT "TIME: ";T,"STAGE: ";4-S;" ";AN$
|
||||
5045 PRINT "ALT: ";INT((RA-KR)/1000);"KM ";AN;" "
|
||||
5060 PRINT "VEL: ";INT(V);"M/S","FUEL: ";INT(FL);"% "
|
||||
5080 REM PRINT "GRAVANGLE ";GA*180/3.14
|
||||
5090 REM PRINT "X: ";RX;" Y: ";RY
|
||||
@ -92,22 +77,23 @@
|
||||
5110 REM PRINT "ANGLE: ";AN
|
||||
5112 REM PRINT "AX: ";AX;"AY: ";AY
|
||||
5113 XDRAW 1+((S-1)*2)+TR AT 140,80
|
||||
5115 GET A$
|
||||
5115 Q=PEEK(-16384):IF Q<128 THEN GOTO 6080
|
||||
6000 A$=CHR$(Q-128):POKE 49168,0
|
||||
6060 IF A$="Q" THEN END
|
||||
6061 XDRAW 1+((S-1)*2)+TR AT 140,80
|
||||
6062 IF A$="A" THEN R=R-8
|
||||
6063 IF A$="D" THEN R=R+8
|
||||
6064 IF A$="C" THEN GOTO 8000
|
||||
6065 IF A$="Z" THEN TH=1
|
||||
6066 IF A$="V" THEN RA=RA+100
|
||||
6067 IF A$="X" THEN TH=0
|
||||
6061 IF A$="A" THEN R=R-8:AN=AN-0.7853
|
||||
6062 IF A$="D" THEN R=R+8:AN=AN+0.7853
|
||||
6063 IF A$="C" THEN GOTO 8000
|
||||
6064 IF A$="Z" THEN TH=1
|
||||
6065 IF A$="V" THEN RA=RA+100
|
||||
6066 IF A$="X" THEN TH=0
|
||||
6068 IF A$=" " AND LN=1 THEN S=S-1:XX=PEEK(-16336)
|
||||
6069 IF A$=" " AND LN=0 THEN GOSUB 7500
|
||||
6070 IF A$="E" THEN GOSUB 8100
|
||||
6073 IF R=64 THEN R=0
|
||||
6073 IF R=64 THEN R=0:AN=0
|
||||
6074 IF R=-8 THEN R=56
|
||||
6075 IF S<0 THEN S=0
|
||||
6080 ROT=R
|
||||
6090 XDRAW 1+((S-1)*2)+TR AT 140,80
|
||||
6118 T=T+1
|
||||
6200 GOTO 4000
|
||||
6500 REM ** ORBIT MODE **
|
||||
@ -148,12 +134,12 @@
|
||||
7535 GOSUB 8220
|
||||
7540 RETURN
|
||||
7600 REM *** GROUND ***
|
||||
7610 PRINT CHR$(4);"BLOAD LAUNCHPAD.HGR,A$2000"
|
||||
7610 HOME:PRINT:PRINT CHR$(4);"BLOAD LAUNCHPAD.HGR,A$2000"
|
||||
7615 XDRAW 1+((S-1)*2)+TR AT 140,80
|
||||
7620 CQ=0
|
||||
7650 RETURN
|
||||
7700 REM *** SPACE_UP ***
|
||||
7710 PRINT CHR$(4);"BLOAD ORBIT_TOP.HGR,A$2000"
|
||||
7710 HOME:PRINT:PRINT CHR$(4);"BLOAD ORBIT_TOP.HGR,A$2000"
|
||||
7715 XDRAW 1+((S-1)*2)+TR AT 140,80
|
||||
7720 CQ=1
|
||||
7750 RETURN
|
||||
|
Loading…
x
Reference in New Issue
Block a user