Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Stunt Jumper
#3
Out of boredom I changed the program. Maybe this needs a new set of stunt jumpers so they jump the other way LOL. Otherwise I was forced to remove that part of the code. In its place now there are "helping birds". Notice the birds flying in the distance. Then use that information so a giant bird suddenly swoops just above the buildings able to carry the jumper in horizontal direction for a short time.

Maybe I should convert this game into some kind of tournament mode in which there are 10 paratroopers all waiting to die vying to see who could get on the bird and make the landing successfully. Then use that meme on him which had that ugly guy being an Olympic medalist next to that blonde who brought him the awards... ROFL.

EDIT: made a change to the program but delayed posting it here.

Code: (Select All)
'by mnrvovrfc 17-July-2023
OPTION _EXPLICIT
DIM SHARED sp3 AS STRING
DIM nm$(1 TO 7), histogram(1 TO 80) AS INTEGER
DIM AS INTEGER i, j, h, v, w, z, numtiles, numthalf, thresh
DIM AS INTEGER x, y, px, py, fuel, recede, planecolor
DIM AS INTEGER birds, bx, by, bh, kount
DIM ke$, handl$, jumped AS _BYTE, die AS INTEGER, carrybird AS _BYTE, carry AS _BYTE
DIM sp10 AS STRING

nm$(1) = "murderflower"
nm$(2) = "jumpdaplain"
nm$(3) = "sinusister"
nm$(4) = "quakefear"
nm$(5) = "adrenald"
nm$(6) = "houston"
nm$(7) = "rebare"

sp3 = SPACE$(3)
sp10 = SPACE$(10)

PRINT "Welcome to Stunt Paratrooper!"
PRINT: PRINT "Please choose who do you want to be. Press any number key from [1] to [7]."
FOR i = 1 TO 7
PRINT "("; _TRIM$(STR$(i)); ") "; nm$(i)
NEXT
DO
DO: ke$ = INKEY$: LOOP WHILE ke$ = ""
IF ke$ = CHR$(27) THEN END
v = VAL(ke$)
LOOP UNTIL v > 0 AND v < 8
handl$ = nm$(v)
v = UBOUND(nm$) - v + 4

RANDOMIZE v + 100

numtiles = 400
numthalf = numtiles \ 2
thresh = 5
CLS

DO
FOR i = 1 TO 80
histogram(i) = 0
NEXT

FOR i = 1 TO numthalf
j = Random1(80)
histogram(j) = histogram(j) + 1
NEXT
h = 0
FOR i = 1 TO 80
IF histogram(i) > h THEN h = histogram(i)
NEXT
FOR i = 1 TO numthalf
kount = 0
DO
j = Random1(80)
kount = kount + 1
LOOP UNTIL ABS(histogram(j) - h) <= thresh OR kount > 1000
histogram(j) = histogram(j) + 1
NEXT
h = 0
FOR i = 1 TO 80
IF histogram(i) > h THEN
h = histogram(i)
w = i
END IF
IF histogram(i) = 0 THEN histogram(i) = 1
NEXT
IF w = 80 THEN
z = 80
w = 78
ELSE
z = w + 2
END IF
LOOP UNTIL w > 25
histogram(w + 1) = 0

COLOR 6
LOCATE 25, 1: PRINT STRING$(79, 46);
LOCATE 24, 1: PRINT STRING$(80, 46);
COLOR 8
FOR i = 1 TO 80
y = 24
FOR j = histogram(i) TO 1 STEP -1
LOCATE y, i
PRINT CHR$(177);
y = y - 1
IF y < 11 THEN EXIT FOR
NEXT
NEXT

COLOR 4
LOCATE 1, 1: PRINT handl$;
COLOR 3
PRINT " you have to hit the grass between those buildings! Good luck!"
COLOR 5
LOCATE 2, 1: PRINT "Press [ESC] to quit. Press spacebar to jump out of plane."

fuel = 6
recede = fuel - 1
jumped = 0
carrybird = 0
carry = 0
x = 1
y = 5
planecolor = 7
birds = Random1(5) + 4

DO: ke$ = INKEY$: LOOP UNTIL ke$ = ""

DO
COLOR planecolor
LOCATE y, x: PRINT "|_^";
IF x MOD 4 = 0 THEN
displaybirds birds, 1
END IF
FOR i = 1 TO 10
_DELAY 0.05
ke$ = INKEY$
IF ke$ <> "" THEN
IF ke$ = CHR$(27) THEN SYSTEM
IF ke$ = CHR$(32) THEN
jumped = 1
EXIT FOR
END IF
END IF
NEXT
LOCATE y, x: PRINT sp3;
IF x MOD 4 = 0 THEN
displaybirds birds, 0
END IF
x = x + 1
IF x > 78 THEN
x = 1
IF y < 8 THEN y = y + 1
fuel = fuel - 1
IF fuel < 1 THEN EXIT DO
IF fuel < 3 THEN
COLOR 4
LOCATE 1, 1: PRINT SPACE$(80);
LOCATE 1, 1: PRINT handl$; " you need to jump now, I'm running out of fuel!"
END IF
END IF
IF fuel < 3 THEN
IF planecolor = 7 THEN planecolor = 8 ELSE planecolor = 7
END IF
LOOP UNTIL jumped

IF jumped THEN
COLOR 4
LOCATE 1, 1: PRINT SPACE$(80);
LOCATE 2, 1: PRINT SPACE$(80);
LOCATE 1, 1
PRINT handl$; " has jumped!"
px = x + 1
py = y
bx = 1
by = x
bh = fuel + v - 2
DO WHILE v
IF carrybird THEN
carrybird = carrybird - 1
IF carrybird < 1 THEN EXIT DO
ELSE
py = py + 1
END IF
px = px + 1
IF px > 80 THEN
die = 2
EXIT DO
END IF
IF bx > 0 THEN
IF carrybird THEN bx = bx + 1 ELSE bx = bx + 5
IF bx > 71 THEN bx = -1
IF bh > 0 THEN
bh = bh - 1
by = by + 1
IF by > 10 THEN by = 10
END IF
IF (py = by) AND (px >= bx) AND (px < bx + 10) AND carry = 0 THEN
carry = 1
carrybird = birds
END IF
END IF
x = x + 1
IF x > 78 THEN x = 1
COLOR 7
LOCATE y, x: PRINT "|_^";
IF bx > 0 THEN
COLOR 6
LOCATE by, bx: PRINT "}===|\==:>"
END IF
COLOR 12
LOCATE py, px: PRINT CHR$(2);
IF carry = 0 THEN v = v - 1
IF (py = by) AND (px >= bx) AND (px < bx + 10) AND carry = 0 THEN
carry = 1
carrybird = birds
END IF
_DELAY 0.5
COLOR 7
LOCATE py, px: PRINT " ";
LOCATE y, x: PRINT sp3;
IF bx > 0 THEN
LOCATE by, bx: PRINT sp10;
END IF
LOOP
IF die = 0 THEN
DO
'this should not need screen bounds checking
py = py + 1
h = SCREEN(py, px)
IF h = 46 THEN die = 0: EXIT DO
IF h = 177 THEN die = 1: EXIT DO
x = x + 1
IF x > 78 THEN x = 1
IF bx > 0 THEN
bx = bx + 5
IF bx > 71 THEN bx = -1
IF bh > 0 THEN
bh = bh - 1
by = by + 1
IF by > 10 THEN by = 10
END IF
END IF
IF bx > 0 THEN
COLOR 6
LOCATE by, bx: PRINT "}===|\==:>"
END IF
COLOR 7
LOCATE y, x: PRINT "|_^";
COLOR 12
LOCATE py, px: PRINT CHR$(2);
_DELAY 0.5
LOCATE py, px: PRINT " ";
LOCATE y, x: PRINT sp3;
IF bx > 0 THEN
LOCATE by, bx: PRINT sp10;
END IF
LOOP
END IF
COLOR 5
LOCATE 2, 1
SELECT CASE die
CASE 0
PRINT "GOOD JOB "; handl$; "!!! You have landed on the grass."
CASE 1
PRINT "You crashed into a building! OUCH!!!"
CASE 2
PRINT "Sorry but you went out of bounds which is not the purpose of this game. Wink"
END SELECT
END
ELSE
COLOR 4
LOCATE 1, 1: PRINT SPACE$(80);
LOCATE 1, 1: PRINT "Sorry but you have lost.";
COLOR 7
DO UNTIL y > 23
LOCATE y, x: PRINT sp3;
y = y + 1
LOCATE y, x: PRINT "|_^";
_DELAY 0.25
LOOP
COLOR 4
FOR i = 1 TO 10
LOCATE y, x: PRINT "#*#";
_DELAY 0.125
LOCATE y, x
IF i > 7 THEN
PRINT ".+.";
ELSE
PRINT "*#*";
END IF
_DELAY 0.125
NEXT
LOCATE y, x: PRINT sp3;
_DELAY 1
END IF
SYSTEM


SUB displaybirds (howmany AS INTEGER, moad AS _BYTE)
DIM i AS INTEGER, ch AS STRING * 1
COLOR 6
IF moad THEN ch = "^" ELSE ch = " "
SELECT CASE howmany
CASE 5
LOCATE 3, 72: PRINT ch; sp3; ch;
LOCATE 4, 70: PRINT ch; sp3; ch; sp3; ch;
CASE 6
LOCATE 2, 75: PRINT ch; " "; ch;
LOCATE 3, 74: PRINT ch; sp3; ch;
LOCATE 4, 75: PRINT ch; " "; ch;
CASE 7
LOCATE 1, 80: PRINT ch;
LOCATE 2, 79: PRINT ch;
LOCATE 3, 78: PRINT ch;
LOCATE 4, 77: PRINT ch;
LOCATE 5, 78: PRINT ch;
LOCATE 6, 79: PRINT ch;
LOCATE 7, 80: PRINT ch;
CASE 8
LOCATE 2, 73: PRINT ch; " "; ch; " "; ch;
LOCATE 3, 72: PRINT ch; sp3; sp3; ch;
LOCATE 4, 75: PRINT ch; " "; ch; " "; ch;
CASE 9
LOCATE 3, 64: PRINT ch; sp3; ch; sp3; ch; sp3; ch;
LOCATE 4, 62: PRINT ch; sp3; ch; sp3; ch; sp3; ch; sp3; ch;
END SELECT
END SUB


FUNCTION Random1& (maxvaluu&)
DIM sg AS INTEGER
sg% = SGN(maxvaluu&)
IF sg% = 0 THEN
Random1& = 0
ELSE
IF sg% = -1 THEN maxvaluu& = maxvaluu& * -1
Random1& = INT(RND * maxvaluu& + 1) * sg%
END IF
END FUNCTION
Reply


Messages In This Thread
Stunt Jumper - by mnrvovrfc - 07-17-2023, 12:09 AM
RE: Stunt Jumper - by bplus - 07-17-2023, 12:46 AM
RE: Stunt Jumper - by mnrvovrfc - 07-17-2023, 02:36 AM
RE: Stunt Jumper - by bplus - 07-18-2023, 06:35 PM
RE: Stunt Jumper - by mnrvovrfc - 07-18-2023, 08:26 PM



Users browsing this thread: 3 Guest(s)