'Flying - By SierraKen
'Made on May 31, 2020.
'V. 1.4 - Increased size of hills and made them not able to overlap, fixed display of compass, fixed Sun so it won't show up underground, increased speed.
DIM waterx
(500), watery
(500), shape
(500), watersz
(500) DIM hillx
(40000), hilly
(40000), hshape
(40000), hillsz
(40000), hcolor
(40000) DIM cloudx
(500), cloudy
(500), shapecl
(500), cloudsz
(500) DIM buildingx
(600), buildingy
(600), buildingsz1
(600), buildingsz2
(600), bcolor
(600) xs = 10
c = 0
e = 100
d = 0
_TITLE "Down arrow goes up. Up arrow goes down. + and - number pad keys are the accelerator. Left and Right keys turn."
IF a$
= CHR$(0) + CHR$(72) THEN d
= 6: e
= e
+ .5: b2
= 0 'Up arrow key flies down. IF a$
= CHR$(0) + CHR$(80) THEN d
= 5: e
= e
- .5: b2
= 0 'Down arrow key flies up. IF a$
= "+" THEN d
= 1: speed2
= speed2
+ 10 IF a$
= "-" THEN speed2
= speed2
- 10 IF speed2
<= 0 THEN speed
= 0: b2
= 1: d
= 0 IF d
= 1 THEN speed
= speed
+ 8: b2
= 0 v = v - 1
vv = vv - 2
stilt = speed2 / 100
tilt = tilt - stilt
v = v + 1
vv = vv + 2
stilt2 = speed2 / 100
tilt = tilt + stilt2
v = v - 1
vv = vv - 2
tilt = tilt - 3
speed = speed + 4
v = v + 1
vv = vv + 2
tilt = tilt + 3
speed = speed + 4
IF d
= 5 OR speed2
> 0 THEN speed
= speed
+ 1: b2
= 0 IF d
= 6 OR speed2
> 0 THEN speed
= speed
+ 1: b2
= 0
IF tilt
< -175 THEN tilt
= -175 elevation = e - 100
elevation = -elevation
elevation = elevation * 100
IF speed2
> 2000 THEN speed2
= 2000
grid:
LINE (0, bsky
- e
- tilt
)-(800, bsky
- e
+ tilt
), _RGB32(0, 0, bsky
) LINE (0, bsky
- e
- tilt
+ .125)-(800, bsky
- e
+ tilt
- .125), _RGB32(0, 0, bsky
) LINE (0, bsky
- e
- tilt
- .125)-(800, bsky
- e
+ tilt
+ .125), _RGB32(0, 0, bsky
)
IF ground
= INT(ground
) THEN ground2
= ground2
+ 1 LINE (0, ground
- e
- tilt
)-(800, ground
- e
+ tilt
), _RGB32(0, ground2
, 0) LINE (0, ground
- e
- tilt
+ .125)-(800, ground
- e
+ tilt
- .125), _RGB32(0, ground2
, 0) LINE (0, ground
- e
- tilt
- .125)-(800, ground
- e
+ tilt
+ .125), _RGB32(0, ground2
, 0)
ground2 = 0
'Sun
tilt3 = tilt / 50
oldtil = til
IF cc
< 315 AND tilt
< 0 AND tilt3
= oldtilt3
THEN sunx
= sunx
- 10: til
= til
- tilt3
IF cc
> 225 AND tilt
> 0 AND tilt3
= oldtilt3
THEN sunx
= sunx
+ 10: til
= til
+ tilt3
oldtilt3 = tilt3
sun:
nosun:
'Clouds
cl = cl + 1
cloudx
(cl
) = INT(RND * 799) + 1 cloudy(cl) = 180
cloudsz
(cl
) = INT(RND * 5) + 1 + e
/ 1.5 IF cloudsz
(cl
) < 10 THEN cloudsz
(cl
) = 10 IF shapecl
(cl
) < .4 THEN shapecl
(cl
) = .4 cloudy(cl2) = cloudy(cl2) - speed2 / 60
tilt6 = tilt / 5
IF tilt6
< 0 THEN tilt6
= -tilt6
cloudy(cl2) = cloudy(cl2) + tilt6 / 10
ttttilt = tilt / 10
IF ttttilt
> 6 THEN ttttilt
= 6 IF ttttilt
< -6 THEN ttttilt
= -6 cloudx(cl2) = cloudx(cl2) + ttttilt
IF cloudx
(cl2
) < -50 OR cloudx
(cl2
) > 850 THEN GOTO skipclouds:
IF cloudy
(cl2
) >= 175 THEN ccl
= 100 IF cloudy
(cl2
) < 175 AND cloudy
(cl2
) >= 150 THEN ccl
= 125 IF cloudy
(cl2
) < 150 AND cloudy
(cl2
) >= 125 THEN ccl
= 150 IF cloudy
(cl2
) < 125 AND cloudy
(cl2
) >= 100 THEN ccl
= 175 IF cloudy
(cl2
) < 100 AND cloudy
(cl2
) >= 75 THEN ccl
= 200 IF cloudy
(cl2
) < 75 AND cloudy
(cl2
) >= 50 THEN ccl
= 225 IF cloudy
(cl2
) < 50 THEN ccl
= 255 CIRCLE (cloudx
(cl2
), cloudy
(cl2
)), sz
, _RGB32(ccl
, ccl
, ccl
), , , shapecl
(cl2
) skipclouds:
skipclouds2:
'Water
w = w + 1
waterx
(w
) = INT(RND * 799) + 1 watery(w) = 310
watersz
(w
) = INT(RND * 5) + 1 + e
/ 1.5 IF shape
(w
) < .1 THEN shape
(w
) = .1 watery(ww) = watery(ww) + speed2 / 60
tilt4 = tilt / 5
IF tilt4
< 0 THEN tilt4
= -tilt4
watery(ww) = watery(ww) + tilt4 / 10
ttilt = tilt / 10
waterx(ww) = waterx(ww) + ttilt
IF waterx
(ww
) < -50 OR waterx
(ww
) > 850 THEN GOTO skipwater:
CIRCLE (waterx
(ww
), watery
(ww
)), sz
, _RGB32(100, 100, 255), , , shape
(ww
) skipwater:
skipwater2:
'Hills
h = h + 1
hilly(h) = 310
hillsz
(h
) = INT(RND * e
) + 50 + e
/ 1.5 hcolor
(h
) = INT(RND * 100) + 100hills:
IF speed2
> 0 THEN hilly
(hh
) = hilly
(hh
) + speed2
/ 60 tilt5 = tilt / 5
IF tilt5
< 0 THEN tilt5
= -tilt5
hilly(hh) = hilly(hh) + tilt5 / 10
tttilt = tilt / 10
IF tttilt
< -6 THEN tttilt
= -6 hillx(hh) = hillx(hh) + tttilt
FOR hx
= -hillsz
(hh
) TO hillsz
(hh
) CIRCLE (hillx
(hh
), hilly
(hh
)), sz
, _RGB32(hcolor
(hh
), hcolor
(hh
) + 44, 0), 2 * _PI, _PI, hshape
(hh
) skiphill:
skiphill2:
'Buildings
b = b + 1
buildingx
(b
) = INT(RND * 799) + 1 buildingy(b) = 310
buildingsz1
(b
) = INT(RND * 2) + 1 + e
/ 4.5 buildingsz2
(b
) = INT(RND * 2) + 1 + e
/ 4.5 bcolor
(b
) = INT(RND * 155) + 100 buildingy(bb) = buildingy(bb) + speed2 / 60
tilt7 = tilt / 5
IF tilt7
< 0 THEN tilt7
= -tilt7
buildingy(bb) = buildingy(bb) + tilt7 / 10
tttttilt = tilt / 10
IF tttttilt
> 6 THEN tttttilt
= 6 IF tttttilt
< -6 THEN tttttilt
= -6 buildingx(bb) = buildingx(bb) + tttttilt
IF buildingx
(bb
) < -50 OR buildingx
(bb
) > 850 THEN GOTO skipbuilding:
LINE (buildingx
(bb
), buildingy
(bb
))-(buildingx
(bb
) + buildingsz1
(bb
), buildingy
(bb
) + buildingsz2
(bb
)), _RGB32(150, bcolor
(bb
), bcolor
(bb
)), BF
'Building Windows
IF elevation
<= 1000 THEN ew
= 2 IF elevation
> 1000 AND elevation
< 2000 THEN ew
= 1
bwindowx1 = (buildingx(bb) + buildingsz1(bb)) - 5
bwindowy1 = (buildingy(bb) + buildingsz2(bb)) - 5
bwindowx2 = (buildingx(bb) + buildingsz1(bb)) - 10
bwindowy2 = (buildingy(bb) + buildingsz2(bb)) - 5
bwindowx3 = (buildingx(bb) + buildingsz1(bb)) - 15
bwindowy3 = (buildingy(bb) + buildingsz2(bb)) - 5
bwindowx4 = (buildingx(bb) + buildingsz1(bb)) - 20
bwindowy4 = (buildingy(bb) + buildingsz2(bb)) - 5
bwindowx5 = (buildingx(bb) + buildingsz1(bb)) - 5
bwindowy5 = (buildingy(bb) + buildingsz2(bb)) - 10
bwindowx6 = (buildingx(bb) + buildingsz1(bb)) - 10
bwindowy6 = (buildingy(bb) + buildingsz2(bb)) - 10
bwindowx7 = (buildingx(bb) + buildingsz1(bb)) - 15
bwindowy7 = (buildingy(bb) + buildingsz2(bb)) - 10
bwindowx8 = (buildingx(bb) + buildingsz1(bb)) - 20
bwindowy8 = (buildingy(bb) + buildingsz2(bb)) - 10
bwindowx9 = (buildingx(bb) + buildingsz1(bb)) - 5
bwindowy9 = (buildingy(bb) + buildingsz2(bb)) - 15
bwindowx10 = (buildingx(bb) + buildingsz1(bb)) - 10
bwindowy10 = (buildingy(bb) + buildingsz2(bb)) - 15
bwindowx11 = (buildingx(bb) + buildingsz1(bb)) - 15
bwindowy11 = (buildingy(bb) + buildingsz2(bb)) - 15
bwindowx12 = (buildingx(bb) + buildingsz1(bb)) - 20
bwindowy12 = (buildingy(bb) + buildingsz2(bb)) - 15
bwindowx13 = (buildingx(bb) + buildingsz1(bb)) - 5
bwindowy13 = (buildingy(bb) + buildingsz2(bb)) - 20
bwindowx14 = (buildingx(bb) + buildingsz1(bb)) - 10
bwindowy14 = (buildingy(bb) + buildingsz2(bb)) - 20
bwindowx15 = (buildingx(bb) + buildingsz1(bb)) - 15
bwindowy15 = (buildingy(bb) + buildingsz2(bb)) - 20
bwindowx16 = (buildingx(bb) + buildingsz1(bb)) - 20
bwindowy16 = (buildingy(bb) + buildingsz2(bb)) - 20
LINE (bwindowx1
, bwindowy1
)-(bwindowx1
+ ew
, bwindowy1
+ ew
), _RGB32(255, 255, 255), BF
LINE (bwindowx2
, bwindowy2
)-(bwindowx2
+ ew
, bwindowy2
+ ew
), _RGB32(255, 255, 255), BF
LINE (bwindowx3
, bwindowy3
)-(bwindowx3
+ ew
, bwindowy3
+ ew
), _RGB32(255, 255, 255), BF
LINE (bwindowx4
, bwindowy4
)-(bwindowx4
+ ew
, bwindowy4
+ ew
), _RGB32(255, 255, 255), BF
LINE (bwindowx5
, bwindowy5
)-(bwindowx5
+ ew
, bwindowy5
+ ew
), _RGB32(255, 255, 255), BF
LINE (bwindowx6
, bwindowy6
)-(bwindowx6
+ ew
, bwindowy6
+ ew
), _RGB32(255, 255, 255), BF
LINE (bwindowx7
, bwindowy7
)-(bwindowx7
+ ew
, bwindowy7
+ ew
), _RGB32(255, 255, 255), BF
LINE (bwindowx8
, bwindowy8
)-(bwindowx8
+ ew
, bwindowy8
+ ew
), _RGB32(255, 255, 255), BF
LINE (bwindowx9
, bwindowy9
)-(bwindowx9
+ ew
, bwindowy9
+ ew
), _RGB32(255, 255, 255), BF
LINE (bwindowx10
, bwindowy10
)-(bwindowx10
+ ew
, bwindowy10
+ ew
), _RGB32(255, 255, 255), BF
LINE (bwindowx11
, bwindowy11
)-(bwindowx11
+ ew
, bwindowy11
+ ew
), _RGB32(255, 255, 255), BF
LINE (bwindowx12
, bwindowy12
)-(bwindowx12
+ ew
, bwindowy12
+ ew
), _RGB32(255, 255, 255), BF
LINE (bwindowx13
, bwindowy13
)-(bwindowx13
+ ew
, bwindowy13
+ ew
), _RGB32(255, 255, 255), BF
LINE (bwindowx14
, bwindowy14
)-(bwindowx14
+ ew
, bwindowy14
+ ew
), _RGB32(255, 255, 255), BF
LINE (bwindowx15
, bwindowy15
)-(bwindowx15
+ ew
, bwindowy15
+ ew
), _RGB32(255, 255, 255), BF
LINE (bwindowx16
, bwindowy16
)-(bwindowx16
+ ew
, bwindowy16
+ ew
), _RGB32(255, 255, 255), BF
skipwindows:
skipbuilding:
skipbuilding2:
'Calculate Compass
tilt2 = tilt
IF tilt2
< 0 THEN tilt2
= -tilt2
IF tilt
< 0 THEN c
= c
- tilt2
/ 314 IF tilt
> 0 THEN c
= c
+ tilt2
/ 314 IF cc
>= 340 OR cc
< 25 THEN comp$
= "North" IF cc
>= 25 AND cc
< 65 THEN comp$
= "Northeast" IF cc
>= 115 AND cc
< 160 THEN comp$
= "Southeast" IF cc
>= 160 AND cc
< 205 THEN comp$
= "South" IF cc
>= 205 AND cc
< 250 THEN comp$
= "Southwest" IF cc
>= 250 AND cc
< 295 THEN comp$
= "West" IF cc
>= 295 AND cc
< 340 THEN comp$
= "Northwest"
elevation$
= STR$(elevation
)
xx = 0: xx2 = 0: xx3 = 0