Stunt Jumper
#4
@mnrvovrfc did you try names above number 3? For some reason the code blanks out for me for any name above 3.

Here is the essence of this game in < 25 LOC, plenty of double parking though (use of colons for multiple statements on one line of code).

Code: (Select All)
_Title "Drop Bomb into hole, pressing spacebar" ' b+ 2023-07-18
restart: ' 80 X 25 Ascii screen
targetC = Int(Rnd * 51) + 15 'set target between 15 and 65 inclusive
shipC = 1: shipR = 2: bombR = 1: dropBomb = 0: done$ = ""
Do
    Cls
    For row = 24 To 25 ' draw ground
        For col = 1 To 80
            If col <> targetC Then Locate row, col: Print Chr$(178);
        Next
    Next
    shipC = shipC + 1
    Locate shipR, shipC: Print "< O >";
    If InKey$ = " " And dropBomb = 0 Then dropBomb = 1: bombC = shipC + 1
    If dropBomb Then bombC = bombC + 1: bombR = bombR * 2
    If bombR > 16 Then
        bombR = 24
        If bombC = targetC Then done$ = "Hit!" Else done$ = "Miss"
    End If
    If dropBomb Then Locate bombR + 1, bombC: Print "o";
    _Limit 5
Loop While done$ = ""
Locate 10, 38: Print done$; " ZZZ...": Sleep: _KeyClear
If done$ <> "Hit!" Then GoTo restart Else Locate 12, 37: Print "Finally ;-))": End

Here is miss:
   

Here is what we are aiming for, a hit!
   
b = b + ...
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: 1 Guest(s)