QB64 Phoenix Edition
Chase in ASCII - Printable Version

+- QB64 Phoenix Edition (https://qb64phoenix.com/forum)
+-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1)
+--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3)
+---- Forum: Games (https://qb64phoenix.com/forum/forumdisplay.php?fid=57)
+---- Thread: Chase in ASCII (/showthread.php?tid=3950)



Chase in ASCII - SierraKen - 09-20-2025

I got this idea from a 1990's Pac-Man type clone I made back then that has no walls. But this time I didn't make any power-ups either, just yellow coins to collect while running away from the monsters. And this entire game is in ASCII symbols and letters. Every other level is the same, so 2 different looking ones. The only thing I wish was better is that it's often hard to use the keys. It probably has to do with the GOSUBs after the keys are hit to make them work instantly, I might work with that more. It's a fairly hard game. It seems easy at first, but once the last few coins are left in a level, it's hard to get away from the monsters. The trick is to keep going past the sides of the window to end up on the other side. The monsters can't do that. 

I hope you have some fun with this. I know it's not much, but this might be one of the first times I've ever used a two dimensional string array without any help with it. The main help I got from Chatgpt was the idea of using RND with the monsters so they don't constantly follow you. It also gave me the KEYHIT numbers for WASD key movement and arrow keys (both work).  

-Ken

Code: (Select All)

'Chase In ASCII by SierraKen
'Sept. 19, 2025
'Use the arrow keys or WASD keys to move your green happy face to collect yellow coins without getting hit by the monsters.


_Title "Chase In ASCII by SierraKen - Use arrow keys to collect coins."

Dim dot$(100, 100)
Screen _NewImage(600, 600, 32)
Cls
m = 5
p$ = ""
b$ = "@"
b2$ = "@"
b3$ = "@"
b4$ = "@"
level = 1
score = 0
Print: Print: Print
Print "                        C H A S E  in........."
Print
_Delay 2
Print: Print: Print: Print: Print
Print "                            A ";: Sound 400, 4, , , 4: Print "S ";: Sound 500, 4, , , 4: Print "C ";: Sound 600, 4, , , 4: Print "I ";: Sound 700, 4, , , 4: Print "I"
Print: Print: Print
Print "                          By SierraKen"
Print: Print: Print: Print
Print "    Use the arrow keys (or WASD keys) to move your tiny happy face ";: Color _RGB32(0, 255, 0): Print p$: Color _RGB32(255, 255, 255)
Print "    around to collect coins ";: Color _RGB32(255, 255, 11): Print "o": Color _RGB32(255, 255, 255)
Print "    Without getting hit by a monster ";: Color _RGB32(255, 0, 0): Print b$: Color _RGB32(255, 255, 255)
Print "    To quit anytime, press Esc."
Print
Print "    Hint: If you go past any side of the screen,"
Print "    you will end up on the other side of the screen."
Print: Print: Print
Input "                    Press Enter to begin.", st$
begin:
t = 0
For dx = 3 To 73
    For dy = 4 To 34
        dot$(dx, dy) = ""
    Next dy
Next dx

If level / 2 = Int(level / 2) Then
    For dx = 3 To 73 Step 2
        For dy = 4 To 34 Step 5
            dot$(dx, dy) = "o"
            t = t + 1
        Next dy
    Next dx
    GoTo start
End If


For dx = 3 To 73 Step 5
    For dy = 4 To 34 Step 2
        dot$(dx, dy) = "o"
        t = t + 1
    Next dy
Next dx

start:
Cls
Color _RGB32(0, 255, 0)
Locate 1, 5: Print "Score: " + Str$(score) + "          Level: " + Str$(level) + "          Lives: " + Str$(m)
Locate 2, 5: Print "Coins To Get: " + Str$(t) + "    "
Color _RGB32(255, 255, 11)
For dx = 3 To 73
    For dy = 4 To 34
        If dot$(dx, dy) = "o" Then Locate dy, dx: Print dot$(dx, dy)
    Next dy
Next dx
x = 35
y = 15
xx = 1
yy = 1
xx2 = 73
yy2 = 1
xx3 = 73
yy3 = 34
xx4 = 1
yy4 = 34

dir = 0
Do
    k& = _KeyHit
    Select Case k&
        Case 18432 'Up arrow
            dir = 4
            k& = 0
        Case 20480 'Down arrow
            dir = 3
            k& = 0
        Case 19200 'Left arrow
            dir = 1
            k& = 0
        Case 19712 'Right arrow
            dir = 2
            k& = 0
        Case 87
            dir = 4 'W
            k& = 0
        Case 65
            dir = 1 'A
            k& = 0
        Case 83
            dir = 3 'S
            k& = 0
        Case 68
            dir = 2 'D
            k& = 0
    End Select
    If k& = 27 Then End ' ESC to quit
    If dir = 1 Then
        Locate y, x: Print " "
        GoSub checkyou
        x = x - 1
        GoSub checkborder
    End If
    If dir = 2 Then
        Locate y, x: Print " "
        GoSub checkyou
        x = x + 1
        GoSub checkborder
    End If
    If dir = 3 Then
        Locate y, x: Print " "
        GoSub checkyou
        y = y + 1
        GoSub checkborder
    End If
    If dir = 4 Then
        Locate y, x: Print " "
        GoSub checkyou
        y = y - 1
        GoSub checkborder
    End If

    If Rnd < 0.5 Then
        Locate yy, xx: Print " "
        GoSub checkenemy
        ' move X if possible
        If x > xx Then xx = xx + 1 Else If x < xx Then xx = xx - 1
    Else
        Locate yy, xx: Print " "
        GoSub checkenemy
        ' move Y if possible
        If y > yy Then yy = yy + 1 Else If y < yy Then yy = yy - 1
    End If

    If Rnd < 0.5 Then
        Locate yy2, xx2: Print " "
        GoSub checkenemy2
        ' move X if possible
        If x > xx2 Then xx2 = xx2 + 1 Else If x < xx2 Then xx2 = xx2 - 1
    Else
        Locate yy2, xx2: Print " "
        GoSub checkenemy2
        ' move Y if possible
        If y > yy2 Then yy2 = yy2 + 1 Else If y < yy2 Then yy2 = yy2 - 1
    End If

    If Rnd < 0.5 Then
        Locate yy3, xx3: Print " "
        GoSub checkenemy3
        ' move X if possible
        If x > xx3 Then xx3 = xx3 + 1 Else If x < xx3 Then xx3 = xx3 - 1
    Else
        Locate yy3, xx3: Print " "
        GoSub checkenemy3
        ' move Y if possible
        If y > yy3 Then yy3 = yy3 + 1 Else If y < yy3 Then yy3 = yy3 - 1
    End If

    If Rnd < 0.5 Then
        Locate yy4, xx4: Print " "
        GoSub checkenemy4
        ' move X if possible
        If x > xx4 Then xx4 = xx4 + 1 Else If x < xx4 Then xx4 = xx4 - 1
    Else
        Locate yy4, xx4: Print " "
        GoSub checkenemy4
        ' move Y if possible
        If y > yy4 Then yy4 = yy4 + 1 Else If y < yy4 Then yy4 = yy4 - 1
    End If

    If xx < 1 Then
        Locate yy, xx: Print " "
        GoSub checkenemy
        xx = 73
    End If
    If yy < 1 Then
        Locate yy, xx: Print " "
        GoSub checkenemy
        yy = 34
    End If
    If xx2 < 1 Then
        Locate yy2, xx2: Print " "
        GoSub checkenemy2
        xx2 = 73
    End If

    If yy2 < 1 Then
        Locate yy2, xx2: Print " "
        GoSub checkenemy2
        yy2 = 34
    End If
    If xx3 < 1 Then
        Locate yy3, xx3: Print " "
        GoSub checkenemy3
        xx3 = 73
    End If

    If yy3 < 1 Then
        Locate yy3, xx3: Print " "
        GoSub checkenemy3
        yy3 = 34
    End If
    If xx4 < 1 Then
        Locate yy4, xx4: Print " "
        GoSub checkenemy4
        xx4 = 73
    End If
    If yy4 < 1 Then
        Locate yy4, xx4: Print " "
        GoSub checkenemy4
        yy4 = 34
    End If

    Color _RGB32(255, 0, 0)
    Locate yy, xx: Print b$
    Locate yy2, xx2: Print b2$
    Locate yy3, xx3: Print b3$
    Locate yy4, xx4: Print b4$

    If x = xx And y = yy Then
        m = m - 1
        For snd = 700 To 400 Step -10
            Sound snd, .5
        Next snd
        Locate y, x: Print " "
        GoSub checkenemy
        If m = 0 Then End
        GoTo start
    End If

    If x = xx2 And y = yy2 Then
        m = m - 1
        For snd = 700 To 400 Step -10
            Sound snd, .5
        Next snd
        Locate y, x: Print " "
        GoSub checkenemy2
        If m = 0 Then End
        GoTo start
    End If

    If x = xx3 And y = yy3 Then
        m = m - 1
        For snd = 700 To 400 Step -10
            Sound snd, .5
        Next snd
        Locate y, x: Print " "
        GoSub checkenemy3
        If m = 0 Then End
        GoTo start
    End If

    If x = xx4 And y = yy4 Then
        m = m - 1
        For snd = 700 To 400 Step -10
            Sound snd, .5
        Next snd
        Locate y, x: Print " "
        GoSub checkenemy4
        If m = 0 Then End
        GoTo start
    End If
    Locate y, x: Color _RGB32(0, 255, 0): Print p$
    _Delay .1
    _Display
Loop

checkenemy:

For dx = 3 To 73
    For dy = 4 To 34
        If dx = xx And dy = yy And dot$(dx, dy) = "o" Then
            Color _RGB32(255, 255, 11)
            Locate dy, dx: Print dot$(dx, dy)
        End If
        If dx = xx And dy = yy And dot$(dx, dy) = " " Then
            Locate dy, dx: Print dot$(dx, dy)
        End If
    Next dy
Next dx
Return

checkenemy2:
For dx = 3 To 73
    For dy = 4 To 34
        If dx = xx2 And dy = yy2 And dot$(dx, dy) = "o" Then
            Color _RGB32(255, 255, 11)
            Locate dy, dx: Print dot$(dx, dy)
        End If
        If dx = xx2 And dy = yy2 And dot$(dx, dy) = " " Then
            Locate dy, dx: Print dot$(dx, dy)
        End If
    Next dy
Next dx
Return

checkenemy3:
For dx = 3 To 73
    For dy = 4 To 34
        If dx = xx3 And dy = yy3 And dot$(dx, dy) = "o" Then
            Color _RGB32(255, 255, 11)
            Locate dy, dx: Print dot$(dx, dy)
        End If
        If dx = xx3 And dy = yy3 And dot$(dx, dy) = " " Then
            Locate dy, dx: Print dot$(dx, dy)
        End If
    Next dy
Next dx
Return

checkenemy4:
For dx = 3 To 73
    For dy = 4 To 34
        If dx = xx4 And dy = yy4 And dot$(dx, dy) = "o" Then
            Color _RGB32(255, 255, 11)
            Locate dy, dx: Print dot$(dx, dy)
        End If
        If dx = xx4 And dy = yy4 And dot$(dx, dy) = " " Then
            Locate dy, dx: Print dot$(dx, dy)
        End If
    Next dy
Next dx
Return

checkyou:
For dx = 3 To 73
    For dy = 4 To 34
        If dx = x And dy = y And dot$(dx, dy) = "o" Then
            dot$(dx, dy) = " "
            Sound 600, 1, , , 4
            score = score + 10
            t = t - 1
            Locate 2, 5: Print "Coins To Get: " + Str$(t) + "    "
            Locate 1, 5: Print "Score: " + Str$(score) + "          Level: " + Str$(level) + "          Lives: " + Str$(m)
            If t = 0 Then
                level = level + 1
                _Delay 1
                Sound 400, 4, , , 4
                Sound 500, 4, , , 4
                Sound 600, 4, , , 4
                Sound 700, 4, , , 4
                GoTo begin
            End If
            Return
        End If
    Next dy
Next dx
Return

checkborder:
If x > 73 Then
    Locate y, x: Print " "
    dot$(x, y) = " "
    GoSub checkyou
    x = 3
End If
If y > 34 Then
    Locate y, x: Print " "
    dot$(x, y) = " "
    GoSub checkyou
    y = 4
End If
If x < 3 Then
    Locate y, x: Print " "
    dot$(x, y) = " "
    GoSub checkyou
    x = 73
End If
If y < 4 Then
    Locate y, x: Print " "
    dot$(x, y) = " "
    GoSub checkyou
    y = 34
End If
Return



RE: Chase in ASCII - ukdave74 - 09-20-2025

That's a fun little game. I tried writing something similar on my mate's Speccy back in the 80s. Never got it to work, though, as I had Commodores.


RE: Chase in ASCII - SierraKen - 09-20-2025

Thanks ukdave74! Smile


RE: Chase in ASCII - NakedApe - 09-20-2025

I like your game, Ken. It reminds me of an ASCII game I wrote a loooong time ago. This uses loops for pauses and lots of old school junk, but seems to run fine on QB64PE.  

Code: (Select All)
Randomize Timer
On Error GoTo ErrorHandler
On Key(11) GoSub UpArrow '          UP
On Key(12) GoSub LeftArrow '        LEFT
On Key(13) GoSub RightArrow '          RIGHT
On Key(14) GoSub DownArrow '          DOWN

Key(11) On
Key(12) On
Key(13) On
Key(14) On

Key (15), Chr$(0) + Chr$(2) '                            NUMERIC KEYPAD #1
Key (16), Chr$(0) + Chr$(4) '                            NUMERIC KEYPAD #3

On Key(15) GoSub ShootLeft
On Key(16) GoSub ShootRight

Key(15) On
Key(16) On

_MouseHide
_FullScreen


DataBase1:
Data 65,8,97,4,22000,1,65,3,97,18,19000,1,'          BA BUH BA BUHHHHHHHHH  SOUNDS

l$ = Chr$(29): r$ = Chr$(28) '              left, right, up and down moves
u$ = Chr$(30): d$ = Chr$(31)
esc$ = Chr$(27)

oldmove$ = r$
move$ = l$


1

Rem ***********************************  RESTART POINT                          MOVING BOMBS!!?        THEY REARRANGE TO FORM A WALL?

Rem
Rem                                                                MAKE A NEW THREAT!! AT LEVEL FIVE!!        MAYBE ALL THE SQUAGGLERS MOVE IN UNISON, WRITE A SCRIPT FOR THEM?!
Rem                                                                              OR THEY ALL NO LONGER HAVE THE RANDOM STEPPING, THEY ALL TURN INTO ASSASSINS?
Rem
Rem                                                                        MAKE BAD WALLS THAT ZAP YOU!    RED WALLS OF DEATH
Rem  >>>>>>>>>>>>**********>>>>>>>>>>
Rem

Quick$ = ""
counter = 0
z% = 0
i$ = ""
firstOne$ = "y"
Dumped$ = "n"
Snagged1$ = "y": Snagged2$ = "y": Snagged3$ = "y"
Bombed$ = "n"
Deployed$ = "n"
Exploded1$ = "y": Exploded2$ = "y": Exploded3$ = "y": Exploded4$ = "y": Exploded5$ = "y": Exploded6$ = "y"
Tcolor% = 14 '                                                                                                        30 is blinking yellow
AttackMode$ = "n"
health% = 100
IntroDone$ = "n"
gamespeed = 4600000 '                                          DEFAULT SPEED = FAST      SLOW SPEED SET IN INTROSCREEN
level% = 1
score% = 0
kills% = 0
JewelCounter% = 0
Splatted$ = "n"
AssMoves% = 0
DeployedCounter% = 0
Released$ = "n"
HelperY% = 1000
Jewels% = 0
Blocker1$ = "n": Blocker2$ = "n": Blocker3$ = "n"
blocker1% = 0: blocker2% = 0: blocker3% = 0
Toggle1$ = "on"



Rem *********************************** BEGIN AGAIN      / RESUME GAME WITH SCORING VARIABLES INTACT

2
Cls

YouXpos% = Int(78 * Rnd + 1): YouYpos% = Int(17 * Rnd + 7)
Xpos% = Int(78 * Rnd + 1): Ypos% = Int(23 * Rnd + 1)
X2pos% = Int(78 * Rnd + 1): Y2pos% = Int(23 * Rnd + 1)
X3pos% = Int(78 * Rnd + 1): Y3pos% = Int(23 * Rnd + 1)


GoSub MakeDots
GoSub MakeWalls

10


Rem ******                                                                        ******  MAIN  MAIN  MAIN  ******

20


counter = counter + 1

If IntroDone$ = "n" Then GoSub IntroScreen


If gamespeed > 1200000 Then If AttackMode$ = "y" Then If level% > 1 Then gamespeed = gamespeed - 450 '                                  ****** GAMESPEED ******



If HelperY% = YouYpos% And HelperX% = YouXpos% Then GoSub HelperHealth '                                              new new NEW new new


wildcard% = Int(Rnd * 120)
If level% > 2 Then If wildcard% = 50 Then If Deployed$ = "n" Then GoSub DeployAssassin '                                                  ASSASSIN TRIGGERS
If Deployed$ = "y" Then GoSub MoveAssassin


If JewelCounter% = 9 Then GoSub ChangeLevel

Rem IF JewelCounter% = 6 AND Toggle1$ = "on" THEN GOSUB MakeDots: Toggle1$ = "off" '            NEEDED?                                                          new NEW new



If IntroDone$ = "y" Then GoSub DrawWalls '                                    WALL PERSISTANCE


If health% <= 0 Then GoTo 105



If YouYpos% = Bomb1Y% Then If YouXpos% = Bomb1X% Then If Exploded1$ = "n" Then Exploded1$ = "y": GoSub BlewUp1 '                BOMB ZONE
If YouYpos% = Bomb2Y% Then If YouXpos% = Bomb2X% Then If Exploded2$ = "n" Then Exploded2$ = "y": GoSub BlewUp2
If YouYpos% = Bomb3Y% Then If YouXpos% = Bomb3X% Then If Exploded3$ = "n" Then Exploded3$ = "y": GoSub BlewUp3
If YouYpos% = Bomb4Y% Then If YouXpos% = Bomb4X% Then If Exploded4$ = "n" Then Exploded4$ = "y": GoSub BlewUp4
If YouYpos% = Bomb5Y% Then If YouXpos% = Bomb5X% Then If Exploded5$ = "n" Then Exploded5$ = "y": GoSub BlewUp5
If YouYpos% = Bomb6Y% Then If YouXpos% = Bomb6X% Then If Exploded6$ = "n" Then Exploded6$ = "y": GoSub BlewUp6


If Bombed1$ = "y" Then If Bombed2$ = "y" Then If Bombed3$ = "y" Then If Bombed4$ = "y" Then If Bombed5$ = "y" Then If Bombed6$ = "y" Then Bombed$ = "n" '                                          RESET BOMBS

Serendipity2% = Int(Rnd * 40 + 1)
If Serendipity2% = 15 Then If level% > 1 Then If Bombed$ = "n" Then GoSub DropBombs

If Bombed$ = "y" Then If Exploded1$ = "n" Then Locate Bomb1Y%, Bomb1X%: Color Bcolor1%: Print Chr$(157);: Color 7 '                    Bomb  PERSISTENCE
If Bombed$ = "y" Then If Exploded2$ = "n" Then Locate Bomb2Y%, Bomb2X%: Color Bcolor2%: Print Chr$(240);: Color 7
If Bombed$ = "y" Then If Exploded3$ = "n" Then Locate Bomb3Y%, Bomb3X%: Color Bcolor3%: Print Chr$(240);: Color 7
If Bombed$ = "y" Then If Exploded4$ = "n" Then Locate Bomb4Y%, Bomb4X%: Color Bcolor4%: Print Chr$(240);: Color 7
If Bombed$ = "y" Then If Exploded5$ = "n" Then Locate Bomb5Y%, Bomb5X%: Color Bcolor5%: Print Chr$(240);: Color 7
If Bombed$ = "y" Then If Exploded6$ = "n" Then Locate Bomb6Y%, Bomb6X%: Color Bcolor6%: Print Chr$(240);: Color 7


If YouYpos% = TreasY% Then If YouXpos% = TreasX% Then If Snagged1$ = "n" Then Snagged1$ = "y": GoSub GotTreasure '          TREASURE ZONE
If YouYpos% = Treas2Y% Then If YouXpos% = Treas2X% Then If Snagged2$ = "n" Then Snagged2$ = "y": GoSub GotTreasure
If YouYpos% = Treas3Y% Then If YouXpos% = Treas3X% Then If Snagged3$ = "n" Then Snagged3$ = "y": GoSub GotTreasure

If Snagged1$ = "y" Then If Snagged2$ = "y" Then If Snagged3$ = "y" Then Dumped$ = "n"

Serendip% = Int(Rnd * 18 + 1)
If Serendip% = 15 Or Serendip% = 5 Then If Dumped$ = "n" Then If IntroDone$ = "y" Then GoSub DumpTreasure

If Dumped$ = "y" Then If Snagged1$ = "n" Then Locate TreasY%, TreasX%: Color Tcolor%: Print Chr$(248);: Color 7 '                    Treasure  PERSISTENCE
If Dumped$ = "y" Then If Snagged2$ = "n" Then Locate Treas2Y%, Treas2X%: Color Tcolor%: Print Chr$(248);: Color 7
If Dumped$ = "y" Then If Snagged3$ = "n" Then Locate Treas3Y%, Treas3X%: Color Tcolor%: Print Chr$(248);: Color 7



If health% < 60 Then If level% > 1 Then If Serendipity2% = 18 Then If Released$ = "n" Then GoSub ReleaseHelper '                                HEALTH HELPER ZONE
If Released$ = "y" Then GoSub MoveHelper

If HelperY% = YouYpos% And HelperX% = YouXpos% Then GoSub HelperHealth



If counter < 200 And IntroDone$ = "y" Then Color 18
If counter >= 200 Then Color 2



Locate 6, 1: Print "S";
Locate 7, 1: Print "A";
Locate 8, 1: Print "F";
Locate 9, 1: Print "E";
Locate 12, 1: Print "Z";
Locate 13, 1: Print "O";
Locate 14, 1: Print "N";
Locate 15, 1: Print "E";

Color 7


Locate YouYpos%, YouXpos%
Color 4 '                                                                                              YOU PERSISTANCE
If IntroDone$ = "n" Then Color 2
If YouXpos% <= 2 Then Color 2
If health% <= 20 Then Color 20
Print Chr$(219);
Color 7


If i$ = "a" Or i$ = "s" Or i$ = "w" Or i$ = "d" Or Quick$ = "u" Or Quick$ = "d" Or Quick$ = "l" Or Quick$ = "r" Then GoSub YouMove



If Blocker1$ = "y" Then blocker1% = blocker1% + 1: GoSub pause2
If blocker1% > 50 Then blocker1% = 0: Blocker1$ = "n"
If Blocker1$ = "n" Then GoSub move1

If YouYpos% = TreasY% Then If YouXpos% = TreasX% Then If Snagged$ = "n" Then GoSub GotTreasure '              NEEDED?


If Blocker2$ = "y" Then blocker2% = blocker2% + 1: GoSub pause2
If blocker2% > 50 Then blocker2% = 0: Blocker2$ = "n"
If Blocker2$ = "n" Then GoSub move2


If Blocker3$ = "y" Then blocker3% = blocker3% + 1: GoSub pause2
If blocker3% > 50 Then blocker3% = 0: Blocker3$ = "n"
If Blocker3$ = "n" Then GoSub move3


If i$ = "a" Or i$ = "s" Or i$ = "w" Or i$ = "d" Or Quick$ = "u" Or Quick$ = "d" Or Quick$ = "l" Or Quick$ = "r" Then GoSub YouMove

If firstOne$ = "y" Then GoSub YouMove

i$ = InKey$: If i$ <> "" Then GoTo 100 '      GET USER  INPUT

firstOne$ = "n"

If Dumped$ = "y" Then If Snagged1$ = "n" Then Locate TreasY%, TreasX%: Color Tcolor%: Print Chr$(248);: Color 7 '                    Treasure  PERSISTENCE REDUX
If Dumped$ = "y" Then If Snagged2$ = "n" Then Locate Treas2Y%, Treas2X%: Color Tcolor%: Print Chr$(248);: Color 7
If Dumped$ = "y" Then If Snagged3$ = "n" Then Locate Treas3Y%, Treas3X%: Color Tcolor%: Print Chr$(248);: Color 7


Color 15 '                                                                                                                SCOREBOARD  ZONE

Locate 1, 4: Print "Level: "; l$; level%;


Locate 1, 18: Print "Score:"; score%;


If health% <= 20 Then Color 30 Else Color 14

Locate 1, 35: Print "Health:"; health%; l$; "% ";

Color 11
Locate 1, 53: Print "Jewels:"; Jewels%;

Color 12
Locate 1, 69: Print "Kills:"; kills%;



Color 7
Locate 25, 2: Print "<";: Color 15: Print "esc";: Color 7: Print "> key to quit, <";: Color 15: Print "p";: Color 7: Print "> to pause ";


GoTo 20 '                                                                      BOTTOM OF MAIN LOOP

100

If i$ = "p" Then Sleep: GoTo 20
If i$ = esc$ Then GoTo 105

GoTo 20 '                                                                        BOTTOM OF TRAP ZONE


105

Rem                                                                                                            EXIT OPTION ZONE

Color 14
If health% < 0 Then health% = 0
Locate 1, 35: Print "Health:"; health%; l$; "% ";: Color 7

Locate 12, 24
Print "<Play again? ";: Color 15: Print "y";: Color 7: Print "/";: Color 15: Print "n";: Color 7: Print "> or <Resume? ";: Color 15: Print "r";: Color 7: Print ">";
115 z$ = Input$(1)


If z$ <> "y" Then If z$ <> "n" Then If z$ <> "r" Then GoTo 115

If z$ = "y" Then GoSub HighScore: GoTo 1
If z$ = "r" Then If health% > 0 Then Locate 12, 21: Color 8: Print ".............................................";: GoTo 20

Cls: GoSub HighScore '                          SHOW SCORE BOARD AT CLOSE


120

System


Rem                                                                        ******  SUBROUTINES  ******



move1:
Locate Ypos%, Xpos%

GoSub pause1

Print l$;
Print " "; l$;

GoSub Check4Wall


GoSub PickDirection '              INITIAL PICK OF DIRECTION


If move$ = r$ And oldmove$ = l$ Then GoSub PickDirectionNOTright
If move$ = l$ And oldmove$ = r$ Then GoSub PickDirectionNOTleft
If move$ = u$ And oldmove$ = d$ Then GoSub PickDirectionNOTup
If move$ = d$ And oldmove$ = u$ Then GoSub PickDirectionNOTdown


Luck% = Int(2 * Rnd + 1)
If AttackMode$ = "y" Then If Luck% = 1 Then GoSub getCloser1



If Ypos% >= 25 Then move$ = u$ '
If Ypos% <= 1 Then move$ = d$
If Xpos% >= 79 Then move$ = l$ ' was 79
If Xpos% <= 3 Then move$ = r$


If move$ = u$ Then Ypos% = Ypos% - 1
If move$ = d$ Then Ypos% = Ypos% + 1
If move$ = l$ Then Xpos% = Xpos% - 1
If move$ = r$ Then Xpos% = Xpos% + 1


Locate Ypos%, (Xpos% - 1): Color 11: Print Chr$(145);: Color 7 '


If Ypos% = 25 Then Sound 2000, .02: BottomHits% = BottomHits% + 1
If Ypos% = 1 Then Sound 4000, .02: TopHits% = TopHits% + 1
If Xpos% <= 3 Then Sound 6000, .02: LeftHits% = LeftHits% + 1
If Xpos% = 80 Then Sound 8000, .02: RightHits% = RightHits% + 1

oldmove$ = move$

Rem GOSUB pause2 '


Return


move2:

Locate Y2pos%, X2pos%

GoSub pause1

Print l$;
Print " "; l$;

GoSub Check4Wall


GoSub PickDirection '                                                            INITIAL PICK OF DIRECTION


If move$ = r$ And oldmove2$ = l$ Then GoSub PickDirectionNOTright
If move$ = l$ And oldmove2$ = r$ Then GoSub PickDirectionNOTleft
If move$ = u$ And oldmove2$ = d$ Then GoSub PickDirectionNOTup
If move$ = d$ And oldmove2$ = u$ Then GoSub PickDirectionNOTdown


Luck% = Int(2 * Rnd + 1)
If AttackMode$ = "y" Then If Luck% = 2 Then GoSub getCloser2


If Y2pos% >= 25 Then move$ = u$ '
If Y2pos% <= 1 Then move$ = d$
If X2pos% >= 80 Then move$ = l$ ' was 79
If X2pos% <= 3 Then move$ = r$


If move$ = u$ Then Y2pos% = Y2pos% - 1
If move$ = d$ Then Y2pos% = Y2pos% + 1
If move$ = l$ Then X2pos% = X2pos% - 1
If move$ = r$ Then X2pos% = X2pos% + 1



Locate Y2pos%, (X2pos% - 1): Color 12: Print Chr$(232);: Color 7


If Y2pos% = 25 Then Sound 2000, .02: BottomHits% = BottomHits% + 1
If Y2pos% = 1 Then Sound 4000, .02: TopHits% = TopHits% + 1
If X2pos% = 3 Then Sound 6000, .02: LeftHits% = LeftHits% + 1
If X2pos% = 80 Then Sound 8000, .02: RightHits% = RightHits% + 1

oldmove2$ = move$

Rem GOSUB pause2 '

Return



move3:

Locate Y3pos%, X3pos%

GoSub pause1

Print l$;
Print " "; l$; '                                      ERASE FIRST TO STOP BLINKING

GoSub Check4Wall


GoSub PickDirection '              INITIAL PICK OF DIRECTION


If move$ = r$ And oldmove3$ = l$ Then GoSub PickDirectionNOTright
If move$ = l$ And oldmove3$ = r$ Then GoSub PickDirectionNOTleft
If move$ = u$ And oldmove3$ = d$ Then GoSub PickDirectionNOTup
If move$ = d$ And oldmove3$ = u$ Then GoSub PickDirectionNOTdown


Luck% = Int(2 * Rnd + 1)
If AttackMode$ = "y" Then If Luck% = 1 Then GoSub getCloser3



If Y3pos% >= 25 Then move$ = u$
If Y3pos% <= 1 Then move$ = d$
If X3pos% >= 80 Then move$ = l$
If X3pos% <= 3 Then move$ = r$



If move$ = u$ Then Y3pos% = Y3pos% - 1
If move$ = d$ Then Y3pos% = Y3pos% + 1
If move$ = l$ Then X3pos% = X3pos% - 1
If move$ = r$ Then X3pos% = X3pos% + 1


Locate Y3pos%, (X3pos% - 1): Color 13: Print Chr$(236);: Color 7 '


If Y3pos% >= 25 Then Sound 2000, .02
If Y3pos% = 1 Then Sound 4000, .02
If X3pos% = 3 Then Sound 6000, .02
If X3pos% = 80 Then Sound 8000, .02

oldmove3$ = move$

Rem GOSUB pause2

Return


pause1:

For donkey1 = 1 To gamespeed '                                        slows the game

Next donkey1

Return

pause2: '                                                            half as slow

For donkey1 = 1 To (gamespeed / 2)

Next donkey1

Return

pause3: '                                                            USED BY THE ASSASSIN

For donkey = 1 To (gamespeed / 18)

Next donkey

Return


PickDirection:

Wacko% = Int(8 * Rnd + 1)

If Wacko% = 1 Then move$ = u$
If Wacko% = 2 Then move$ = d$
If Wacko% = 3 Then move$ = l$
If Wacko% = 4 Then move$ = r$
If Wacko% = 5 Then move$ = l$
If Wacko% = 6 Then move$ = r$
If Wacko% = 7 Then move$ = l$
If Wacko% = 8 Then move$ = r$
If Wacko% = 9 Then move$ = l$

Return


PickDirectionNOTright:

Wacko% = Int(5 * Rnd + 1)

If Wacko% = 1 Then move$ = u$
If Wacko% = 2 Then move$ = d$
If Wacko% = 3 Then move$ = l$
If Wacko% = 4 Then move$ = l$
If Wacko% >= 5 Then move$ = l$

Return


PickDirectionNOTleft:

Wacko% = Int(5 * Rnd + 1)

If Wacko% = 1 Then move$ = u$
If Wacko% = 2 Then move$ = d$
If Wacko% = 3 Then move$ = r$
If Wacko% = 4 Then move$ = r$
If Wacko% >= 5 Then move$ = r$

Return


PickDirectionNOTup:

Wacko% = Int(5 * Rnd + 1)

If Wacko% = 1 Then move$ = r$
If Wacko% = 2 Then move$ = d$
If Wacko% = 3 Then move$ = l$
If Wacko% = 4 Then move$ = l$
If Wacko% >= 5 Then move$ = l$

Return


PickDirectionNOTdown:

Wacko% = Int(4 * Rnd + 1)

If Wacko% = 1 Then move$ = u$
If Wacko% = 2 Then move$ = r$
If Wacko% = 3 Then move$ = l$
If Wacko% >= 4 Then move$ = r$

Return



YouMove:

Locate YouYpos%, YouXpos% '                                                                        YOU MOVE
Print " "; l$;

If i$ = "a" Then YouMove$ = l$
If i$ = "d" Then YouMove$ = r$
If i$ = "w" Then YouMove$ = u$
If i$ = "s" Then YouMove$ = d$


If YouYpos% >= 25 Then YouMove$ = u$
If YouYpos% <= 1 Then YouMove$ = d$
If YouXpos% >= 80 Then YouMove$ = l$
If YouXpos% <= 1 Then YouMove$ = r$


If YouMove$ = u$ Then YouYpos% = YouYpos% - 1
If YouMove$ = d$ Then YouYpos% = YouYpos% + 1
If YouMove$ = l$ Then YouXpos% = YouXpos% - 1
If YouMove$ = r$ Then YouXpos% = YouXpos% + 1

If Quick$ = "l" Then YouXpos% = YouXpos% - 9
If Quick$ = "r" Then YouXpos% = YouXpos% + 9
If Quick$ = "u" Then YouYpos% = YouYpos% - 5
If Quick$ = "d" Then YouYpos% = YouYpos% + 5


If Quick$ = "l" Then If YouXpos% < 10 Then YouXpos% = 1
If Quick$ = "r" Then If YouXpos% > 73 Then YouXpos% = 79
If Quick$ = "u" Then If YouYpos% < 2 Then YouYpos% = 1
If Quick$ = "d" Then If YouYpos% > 23 Then YouYpos% = 24


Locate YouYpos%, YouXpos%
Color 4 '      RED NORMALLY

If IntroDone$ = "n" Then Color 2

If YouXpos% <= 2 Then Color 2
If health% <= 20 Then Color 20
Print Chr$(219); '                                                                                  PRINT THE RED BLOCK (YOU)
Color 7


If YouYpos% = 25 Then Sound 2600, .02
If YouYpos% = 1 Then Sound 4600, .02
If YouXpos% = 1 Then Sound 6600, .02
If YouXpos% = 80 Then Sound 8800, .02


i$ = "": YouMove$ = "": Quick$ = ""

GoSub dumpusershots '                      REACTIVATED

Rem *******************************************************************************

If level% > 1 Then If YouYpos% >= (TreasY% - 2) And YouYpos% <= (TreasY% + 2) Then If YouXpos% >= (TreasX% - 2) And YouXpos% <= (TreasX% + 2) Then GoSub RunAway1 '  RUNAWAY CHECKS
If level% > 1 Then If YouYpos% >= (Treas2Y% - 2) And YouYpos% <= (Treas2Y% + 2) Then If YouXpos% >= (Treas2X% - 2) And YouXpos% <= (Treas2X% + 2) Then GoSub RunAway2
If level% > 1 Then If YouYpos% >= (Treas3Y% - 2) And YouYpos% <= (Treas3Y% + 2) Then If YouXpos% >= (Treas3X% - 2) And YouXpos% <= (Treas3X% + 2) Then GoSub RunAway3

Rem ******************************************************************************


If YouYpos% = HelperY% And YouXpos% = HelperX% Then GoSub HelperHealth


Return


dumpusershots:
For T% = 1 To 2: X$ = InKey$: Next T%
i$ = ""
Return


getCloser1:

If Ypos% = YouYpos% Then If Xpos% = YouXpos% Then GoSub Fried: health% = health% - 4
If YouYpos% < Ypos% Then move$ = u$
If YouYpos% > Ypos% Then move$ = d$
If YouXpos% > Xpos% Then move$ = r$
If YouXpos% < Xpos% Then move$ = l$

GoSub pause1

Return


getCloser2:

If Y2pos% = YouYpos% Then If X2pos% = YouXpos% Then GoSub Fried: health% = health% - 4
If YouYpos% < Y2pos% Then move$ = u$
If YouYpos% > Y2pos% Then move$ = d$
If YouXpos% > X2pos% Then move$ = r$
If YouXpos% < X2pos% Then move$ = l$

GoSub pause1

Return


getCloser3:

If Y3pos% = YouYpos% Then If X3pos% = YouXpos% Then GoSub Fried: health% = health% - 4
If YouYpos% < Y3pos% Then move$ = u$
If YouYpos% > Y3pos% Then move$ = d$
If YouXpos% > X3pos% Then move$ = r$
If YouXpos% < X3pos% Then move$ = l$

GoSub pause1


Return


DrawWalls:

Open filename$ For Input As #2 'opens a file to read it

Color 9

For q% = 1 To 2
    For p% = 1 To 5
        Input #2, WallY%, WallX%
        Locate WallY%, WallX%
        Print Chr$(219);

    Next p%
Next q%

Close #2

Color 7

Return


Check4Wall:

Open filename$ For Input As #2

For q% = 1 To 2
    For p% = 1 To 4

        Input #2, WallY%, WallX%

        If Ypos% = WallY% And Xpos% = WallX% Then Locate Ypos%, Xpos%: Print l$; " "; l$;: Ypos% = Int(23 * Rnd + 1): Xpos% = Int(76 * Rnd + 1): Close #2: GoSub Grumble: Blocker1$ = "y": Return
        If Y2pos% = WallY% And X2pos% = WallX% Then Locate Y2pos%, X2pos%: Print l$; " "; l$;: Y2pos% = Int(23 * Rnd + 1): X2pos% = Int(76 * Rnd + 1): Close #2: GoSub Grumble: Blocker2$ = "y": Return
        If Y3pos% = WallY% And X3pos% = WallX% Then Locate Y3pos%, X3pos%: Print l$; " "; l$;: Y3pos% = Int(23 * Rnd + 1): X3pos% = Int(76 * Rnd + 1): Close #2: GoSub Grumble: Blocker3$ = "y": Return


    Next p%
Next q%

Rem LOCATE Ypos%, Xpos%: PRINT l$; " ";: LOCATE Y2pos%, X2pos%: PRINT l$; " ";: LOCATE Y3pos%, X3pos%: PRINT l$; " "; ' ERASE AGAIN DUE TO ARTIFACTS      - NO!

Close #2

Return


MakeWalls:

filename$ = "wall1.dat"


Open filename$ For Output As #1 'opens and clears an existing file or creates new empty file

StartY% = Int(16 * Rnd + 4): StartX% = Int(60 * Rnd + 18)


For e% = 1 To 5

    Write #1, StartY%, StartX%
    StartY% = StartY% + 1


Next e%


StartY2% = Int(16 * Rnd + 4): StartX2% = Int(60 * Rnd + 18)

For f% = 1 To 5

    Write #1, StartY2%, StartX2%
    StartY2% = StartY2% + 1


Next f%


Close #1

Return


EraseWalls:

Open filename$ For Input As #2

Color 7

For q% = 1 To 2
    For p% = 1 To 5

        Input #2, WallY%, WallX%
        Locate WallY%, WallX%
        Print " ";

    Next p%
Next q%

Close #2

Return


IntroScreen:

Locate 4, 25: Print "<Press ";: Color 15: Print "k";: Color 7: Print " for";: Color 10: Print " FAST ";: Color 7: Print "or ";: Color 15: Print "l";: Color 7: Print " for ";: Color 14: Print "SLOW>";

Locate 6, 28: Color 7: Print "<Press";: Color 15: Print " i ";: Color 7: Print "for Instructions>";

If i$ = "i" Then GoSub Instructions

If i$ = "k" Then IntroDone$ = "y": AttackMode$ = "y": health% = 100: GoSub Banner: GoTo 2
If i$ = "l" Then IntroDone$ = "y": AttackMode$ = "y": health% = 110: gamespeed = 7900000: GoSub Banner: GoTo 2

kills% = 0

Return


Fried:

For num% = 1200 To 1300 Step 100
    Sound num%, .5
Next num%

Return


Grumble:

For num% = 600 To 400 Step -50
    Sound num%, .5
Next num%

Locate Ypos%, Xpos%: Print l$; " ";: Locate Y2pos%, X2pos%: Print l$; " ";: Locate Y3pos%, X3pos%: Print l$; " "; '                                    NEEDED? MAYBE?

kills% = kills% + 1

Return


DumpTreasure:

Dumped$ = "y"

TreasY% = Int(Rnd * 21 + 3)
TreasX% = Int(Rnd * 75 + 4)

Treas2Y% = Int(Rnd * 21 + 3)
Treas2X% = Int(Rnd * 75 + 4)

Treas3Y% = Int(Rnd * 21 + 3)
Treas3X% = Int(Rnd * 75 + 4)


Color Tcolor%
Locate TreasY%, TreasX%: Print Chr$(248);
Locate Treas2Y%, Treas2X%: Print Chr$(248);
Locate Treas3Y%, Treas3X%: Print Chr$(248);

Color 7

For num% = 1000 To 1100 Step 10
    Sound num%, .5
Next num%

Snagged1$ = "n": Snagged2$ = "n": Snagged3$ = "n"

GoSub MakeDots


Return


GotTreasure:

For num% = 2000 To 2100 Step 20
    Sound num%, .5
Next num%

score% = score% + 20
If health% < 90 Then health% = health% + 1 '            changed this cuz too many health points accrued w/o qualifier
Jewels% = Jewels% + 1
JewelCounter% = JewelCounter% + 1


Return


ChangeLevel:

level% = level% + 1
Toggle1$ = "on"

Locate TreasY%, TreasX%: Print " ";: Locate Treas2Y%, Treas2X%: Print " ";: Locate Treas3Y%, Treas3X%: Print " "; '  ERASE TREASURES

GoSub EraseWalls

Color 15 '                                                                                                                SCOREBOARD  ZONE

Locate 1, 4: Print "Level: "; l$; level%;


Locate 1, 18: Print "Score:"; score%;


If health% <= 20 Then Color 30 Else Color 14

Locate 1, 35: Print "Health:"; health%; l$; "% ";

Color 11
Locate 1, 53: Print "Jewels:"; Jewels%;

Color 12
Locate 1, 69: Print "Kills:"; kills%;


Restore DataBase1
For z% = 1 To 5: Read s%, d%: Sound s%, d%: Next z% '                                                                      TA TUM TA TUM

Color 7
Locate 12, 28: Print "Hey, you've reached Level "; l$; level%; l$; "!";
Color 29
If level% > 2 Then Color 7

Sleep 2
Locate 15, 22: Print "Prepare to receive bonus points and health..."
Color 8

Sleep 3
Locate 12, 28: Print ".............................................";
Locate 15, 18: Print "...................................................."; '                        phew

Color 15

Y% = (Jewels% * 9) + kills% '        SCORING FORMULA

noise% = 300
For z% = 1 To Y%
    Locate 1, 18: Print "Score:"; score%;
    score% = score% + 1: noise% = noise% + 1
    Sound noise%, .1
    For g = 1 To 1400000: Next g
Next z%

Color 7

If level% > 2 Then health% = health% + 5 '                      CHANGED THIS TO 5 - TOO MANY HEALTH POINTS WERE ACCRUING


Snagged1$ = "y": Snagged2$ = "y": Snagged3$ = "y"


gamespeed = gamespeed - 200000 '                                  SPEED HER UP @ EACH LEVEL

Sleep 2

If level% > 2 Then GoSub EraseBombs

JewelCounter% = 0

GoTo 2

Return


RunAway1:

Sound 500, .5

Locate TreasY%, TreasX%: Print " ";

If TreasY% > YouYpos% Then If TreasY% < 23 Then TreasY% = TreasY% + 1
If TreasY% < YouYpos% Then If TreasY% > 1 Then TreasY% = TreasY% - 1



If Dumped$ = "y" Then If Snagged1$ = "n" Then Locate TreasY%, TreasX%: Color Tcolor%: Print Chr$(248);: Color 7 '                  NEW        Treasure  PERSISTENCE



Return

RunAway2:

Sound 700, .5

Locate Treas2Y%, Treas2X%: Print " ";

If Treas2Y% > YouYpos% Then If Treas2Y% < 23 Then Treas2Y% = Treas2Y% + 1
If Treas2Y% < YouYpos% Then If Treas2Y% > 1 Then Treas2Y% = Treas2Y% - 1


If Dumped$ = "y" Then If Snagged2$ = "n" Then Locate Treas2Y%, Treas2X%: Color Tcolor%: Print Chr$(248);: Color 7 '


Return


RunAway3:

Sound 900, .5

Locate Treas3Y%, Treas3X%: Print " ";

If Treas3X% > YouXpos% Then If Treas3X% < 79 Then Treas3X% = Treas3X% + 1
If Treas3X% < YouXpos% Then If Treas3X% > 1 Then Treas3X% = Treas3X% - 1

If Dumped$ = "y" Then If Snagged3$ = "n" Then Locate Treas3Y%, Treas3X%: Color Tcolor%: Print Chr$(248);: Color 7 '

Return



DropBombs:

Bombed$ = "y"

Bomb1Y% = Int(Rnd * 20 + 2)
Bomb1X% = Int(Rnd * 75 + 4)

Bomb2Y% = Int(Rnd * 20 + 2)
Bomb2X% = Int(Rnd * 75 + 4)

Bomb3Y% = Int(Rnd * 20 + 2)
Bomb3X% = Int(Rnd * 75 + 4)

Bomb4Y% = Int(Rnd * 20 + 2)
Bomb4X% = Int(Rnd * 75 + 4)

Bomb5Y% = Int(Rnd * 20 + 2)
Bomb5X% = Int(Rnd * 75 + 4)

Bomb6Y% = Int(Rnd * 20 + 2)
Bomb6X% = Int(Rnd * 75 + 4)


Bcolor1% = 29
Bcolor2% = 12
Bcolor3% = 12
Bcolor4% = 12
Bcolor5% = 12
Bcolor6% = 12


Rem
Locate Bomb1Y%, Bomb1X%: Color Bcolor1%: Print Chr$(157);
Locate Bomb2Y%, Bomb2X%: Color Bcolor2%: Print Chr$(240);
Locate Bomb3Y%, Bomb3X%: Color Bcolor3%: Print Chr$(240);
Locate Bomb4Y%, Bomb4X%: Color Bcolor4%: Print Chr$(240);
Locate Bomb5Y%, Bomb5X%: Color Bcolor5%: Print Chr$(240);
Locate Bomb6Y%, Bomb6X%: Color Bcolor6%: Print Chr$(240);


Color 7

For num% = 3000 To 3100 Step 20
    Sound num%, .5
Next num%

Exploded1$ = "n": Exploded2$ = "n": Exploded3$ = "n": Exploded4$ = "n": Exploded5$ = "n": Exploded6$ = "n"

Return



EraseBombs:

Locate Bomb1Y%, Bomb1X%: Print " ";
Locate Bomb2Y%, Bomb2X%: Print " ";
Locate Bomb3Y%, Bomb3X%: Print " ";
Locate Bomb4Y%, Bomb4X%: Print " ";
Locate Bomb5Y%, Bomb5X%: Print " ";
Locate Bomb6Y%, Bomb6X%: Print " ";


Exploded1$ = "y": Exploded2$ = "y": Exploded3$ = "y": Exploded4$ = "y": Exploded5$ = "y": Exploded6$ = "y"

Bombed1$ = "n": Bombed2$ = "n": Bombed3$ = "n": Bombed4$ = "n": Bombed5$ = "n": Bombed6$ = "n"

Bombed$ = "n"

Return



BlewUp1: '                                                                                    BIG BAD BOMB BLEW YOU UP

Exploded1$ = "y"


For num% = 4000 To 4200 Step 40
    Sound num%, .5
Next num%

score% = score% - 200
health% = health% - 10


GoSub YouExplode

Sound 200, 3
Locate YouYpos%, (YouXpos% - 8): Color 7: Print "Ouch, that really hurt!": Sleep 1 '
Locate YouYpos%, (YouXpos% - 8): Color 8: Print "......................."

Return


BlewUp2:

Exploded2$ = "y"

For num% = 900 To 300 Step -30
    Sound num%, .5
Next num%

score% = score% - 100
health% = health% - 10

Locate YouYpos%, YouXpos%: Color 7: Print "Ouch!": Sleep 1
Locate YouYpos%, YouXpos%: Color 8: Print ".....": Sleep 1

Return


BlewUp3:

Exploded3$ = "y"

For num% = 900 To 300 Step -30
    Sound num%, .5
Next num%

score% = score% - 100
health% = health% - 10

Locate YouYpos%, YouXpos%: Color 7: Print "Ouch!": Sleep 1
Locate YouYpos%, YouXpos%: Color 8: Print ".....": Sleep 1

Return


BlewUp4:

Exploded4$ = "y"

For num% = 900 To 300 Step -30
    Sound num%, .5
Next num%

score% = score% - 100
health% = health% - 10

Locate YouYpos%, YouXpos%: Color 7: Print "Ouch!": Sleep 1
Locate YouYpos%, YouXpos%: Color 8: Print ".....": Sleep 1

Return

BlewUp5:

Exploded5$ = "y"

For num% = 900 To 300 Step -30
    Sound num%, .5
Next num%

score% = score% - 100
health% = health% - 10

Locate YouYpos%, YouXpos%: Color 7: Print "Ouch!": Sleep 1
Locate YouYpos%, YouXpos%: Color 8: Print ".....": Sleep 1

Return


BlewUp6:

Exploded6$ = "y"

For num% = 900 To 300 Step -30
    Sound num%, .5
Next num%

score% = score% - 100
health% = health% - 10

Locate YouYpos%, YouXpos%: Color 7: Print "Ouch!": Sleep 1
Locate YouYpos%, YouXpos%: Color 8: Print ".....": Sleep 1

Return


YouExplode:


If YouYpos% <= 20 And YouYpos% >= 4 Then If YouXpos% <= 76 And YouXpos% >= 4 Then GoSub Splat: Splatted$ = "y"

If YouYpos% > 20 Then YouYpos% = 20
If YouYpos% < 4 Then YouYpos% = 4
If YouXpos% > 76 Then YouXpos% = 76
If YouXpos% < 4 Then YouXpos% = 4

If Splatted$ = "n" Then GoSub Splat

Splatted$ = "n"

Return


Splat: '

Rem SLEEP 2

Color 12
Locate YouYpos%, YouXpos%: Print Chr$(176);

For a% = 800 To 100 Step -40 '                                            DEFLATOR
    Sound a%, 1

Next a%

For b% = 1 To 3


    Locate YouYpos% + b%, YouXpos%: Print Chr$(176);
    Locate YouYpos% - b%, YouXpos% - b%: Print Chr$(176);
    Locate YouYpos% + b%, YouXpos% + b%: Print Chr$(176);

    Locate YouYpos% + b%, YouXpos% - b%: Print Chr$(176);
    Locate YouYpos% - b%, YouXpos% + b%: Print Chr$(176);


    Locate YouYpos%, YouXpos% + b%: Print Chr$(176);
    Locate YouYpos% - b%, YouXpos%: Print Chr$(176);
    Locate YouYpos%, YouXpos% - b%: Print Chr$(176);

    Sleep 1

Next b%

Sleep 1

Color 8

For d% = -3 To 3
    Locate YouYpos% + d%, YouXpos% - 5: Print ".........";
Next d%

Annoying$ = "y" '

Return



DeployAssassin: '                                                                *********    ASSASSIN ZONE    *******

DeployedCounter% = DeployedCounter% + 1


Rem                                                                                                        WHAT HAPPENS AFTER THE 3RD ASSASSIN???!!!!!!****************

Deployed$ = "y"

For C% = 1 To 2 '                                                                  MILD DANGER
    For a% = 80 To 100 Step 2
        Sound a%, 1
    Next a%
    For b% = 120 To 100 Step -2
        Sound b%, 1
    Next b%
Next C%

Do
    AssY% = Int(Rnd * 21 + 2)
Loop Until AssY% < YouYpos% - 5 Or AssY% > YouYpos% + 5 '              DONE SO ASSASSIN CAN'T APPEAR RIGHT NEXT TO YOU!


Do
    AssX% = Int(Rnd * 74 + 3)
Loop Until AssX% < YouXpos% - 8 Or AssX% > YouXpos% + 8


Sound 0, 0

Return


MoveAssassin: '                                                                                            ****    MOVE ASSASSIN  ****

If AssMoves% < 16 Then AssMoves% = AssMoves% + 1

If AssMoves% = 14 Then Locate 9, 30: Print "You can shoot the Assassins!";: Sleep 5: Sound 3200, 2: Locate 9, 30: Color 8: Print ".............................";


Locate AssY%, AssX%

GoSub pause3

Print l$;
Print " "; l$;

Rem GOSUB Check4Wall '                                                                          OR NOT?!


If Deployed$ = "y" Then GoSub GetCloserAss


If Annoying$ <> "y" Then If health% > 0 Then If AssY% >= (YouYpos% - 3) And AssY% <= (YouYpos% + 3) Then If AssX% >= (YouXpos% - 5) And AssX% <= (YouXpos% + 5) Then If YouXpos% >= 3 Then GoSub Oscillate '  sound the ALARM '                              ******  NEW  *******

Annoying$ = "n"

If AssY% >= 25 Then Amove$ = u$ '    was 25
If AssY% <= 1 Then Amove$ = d$
If AssX% >= 79 Then Amove$ = l$ ' was 79
If AssX% <= 3 Then Amove$ = r$


If Amove$ = u$ Then AssY% = AssY% - 1
If Amove$ = d$ Then AssY% = AssY% + 1
If Amove$ = l$ Then AssX% = AssX% - 1
If Amove$ = r$ Then AssX% = AssX% + 1


Locate AssY%, (AssX% - 1): Color 12: Print Chr$(143);: Color 7 '            PRINT ASS COLOR


If AssY% = 25 Then Sound 2000, .02
If AssY% = 1 Then Sound 4000, .02
If AssX% <= 3 Then Sound 6000, .02
If AssX% = 80 Then Sound 8000, .02

Return



AssassinDestroyed:

For b% = 1 To 2 '                                          PAC MAN
    For a% = 200 To 800 Step 50
        Sound a%, .5
    Next a%
Next b%

Deployed$ = "n"

Locate AssY%, AssX%: Print l$; " "; l$;

Sound 0, 0

score% = score% + 10: kills% = kills% + 1

Return


KilledByAssassin:

Sound 270, 2

Sleep 1

GoSub YouExplode

health% = 0

Locate 9, 20: Color 7: Print "Ouch, the Assassin got you! Sorry, duder.";: Color 7

GoTo 105

Rem                                                                                          resume play after death
Return



GetCloserAss:

If AssY% = YouYpos% Then If AssX% = YouXpos% Then GoSub AssassinDestroyed: GoSub KilledByAssassin
If YouYpos% < AssY% Then Amove$ = u$
If YouYpos% > AssY% Then Amove$ = d$
If YouXpos% > AssX% Then Amove$ = r$
If YouXpos% < AssX% Then Amove$ = l$
If YouYpos% > AssY% And YouXpos% = AssX% Then Amove$ = d$
If YouYpos% < AssY% And YouXpos% = AssX% Then Amove$ = u$


GoSub pause3 '

z% = Int(Rnd * 12 + 1)
If Amove$ = r$ Or Amove$ = l$ Then If z% = 7 Then If level% > 3 Then AssY% = AssY% - 1 '

If Amove$ = r$ Or Amove$ = l$ Then If z% = 2 Then If level% > 3 Then AssY% = AssY% + 1

Locate AssY%, AssX%: Print l$; " "; l$;

Return


UpArrow:

Quick$ = "u"

Return

DownArrow:

Quick$ = "d"

Return

LeftArrow:

Quick$ = "l"

Return

RightArrow:

Quick$ = "r"

Return

ShootLeft:

LStartY% = YouYpos%: LStartX% = YouXpos%: LShotY% = YouYpos%: LShotX% = YouXpos%

For z% = 500 To 1500 Step 200: Sound z%, .1: Next z%

For T% = 1 To (LStartX% - 1)

    Locate LStartY%, (LStartX% - T%)
    Print "*";
    GoSub pause3
    Print l$; " ";
    LShotX% = LShotX% - 1


    If Ypos% = LShotY% And Xpos% = LShotX% Then Ypos% = Int(23 * Rnd + 1): Xpos% = Int(76 * Rnd + 1): kills% = kills% + 1: Blocker1$ = "y": GoSub Grumble
    If Y2pos% = LShotY% And X2pos% = LShotX% Then Y2pos% = Int(23 * Rnd + 1): X2pos% = Int(76 * Rnd + 1): kills% = kills% + 1: Blocker2$ = "y": GoSub Grumble
    If Y3pos% = LShotY% And X3pos% = LShotX% Then Y3pos% = Int(23 * Rnd + 1): X3pos% = Int(76 * Rnd + 1): kills% = kills% + 1: Blocker3$ = "y": GoSub Grumble

    If AssY% = LShotY% And AssX% = LShotX% Then GoSub AssassinDestroyed: Sound 0, 0


Next T%


Locate Ypos%, Xpos%: Print l$; " ";: Locate Y2pos%, X2pos%: Print l$; " ";: Locate Y3pos%, X3pos%: Print l$; " ";


Return



ShootRight:

RStartY% = YouYpos%: RStartX% = YouXpos%: RShotY% = YouYpos%: RshotX% = YouXpos%

For z% = 300 To 1100 Step 160: Sound z%, .1: Next z%

For T% = 1 To (79 - RStartX%)

    Locate RStartY%, (RStartX% + T%)
    Print "*";
    GoSub pause3
    Print l$; " ";
    RshotX% = RshotX% + 1



    If Ypos% = RShotY% And Xpos% = RshotX% Then Ypos% = Int(23 * Rnd + 1): Xpos% = Int(76 * Rnd + 1): kills% = kills% + 1: Blocker1$ = "y": GoSub Grumble
    If Y2pos% = RShotY% And X2pos% = RshotX% Then Y2pos% = Int(23 * Rnd + 1): X2pos% = Int(76 * Rnd + 1): kills% = kills% + 1: Blocker2$ = "y": GoSub Grumble
    If Y3pos% = RShotY% And X3pos% = RshotX% Then Y3pos% = Int(23 * Rnd + 1): X3pos% = Int(76 * Rnd + 1): kills% = kills% + 1: Blocker3$ = "y": GoSub Grumble

    If AssY% = RShotY% And AssX% = RshotX% Then GoSub AssassinDestroyed: Sound 0, 0



Next T%

Locate Ypos%, Xpos%: Print l$; " ";: Locate Y2pos%, X2pos%: Print l$; " ";: Locate Y3pos%, X3pos%: Print l$; " ";



Return


Oscillate:

For d% = 1 To 1 '                                      OSCILLATOR


    For a% = 1500 To 1400 Step -50
        Sound a%, .5
    Next a%
    For C% = 1500 To 1600 Step 40
        Sound C%, .5
    Next C%
Next d%

Sound 0, 0

Annoying$ = "y"


Return


MakeDots:

For var1% = 2 To 24

    Locate var1%, 1: Color 2: Print "~~": Color 8: Print "................................................................................";

Next var1%

Color 7

Return


Instructions:

Cls
Locate 1, 3: Color 7: Print "Bad Guys: ";: Color 11: Print Chr$(145); " ";: Color 12: Print Chr$(232); " ";: Color 13: Print Chr$(236);: Color 7: Print " (They'll come after you.)";
Locate 2, 3: Color 7: Print "Good Guys: ";: Color 4: Print Chr$(219);: Color 7: Print " You (in danger)  ";: Color 2: Print Chr$(219);: Color 7: Print " You (in a safe zone)";
Locate 3, 3: Color 7: Print "Walls of Safety (mostly): ";: Color 9: Print Chr$(219); d$; l$; Chr$(219); d$; l$; Chr$(219); " (Hide inside walls to avoid Bad Guys!)";
Locate 5, 3: Color 7: Print "Jewels for the Taking: ";: Color 14: Print Chr$(248);
Locate 6, 3: Color 7: Print "Bombs to Avoid:  ";: Color 29: Print Chr$(157); "  ";: Color 12: Print Chr$(240); "  "; Chr$(240);
Locate 7, 3: Color 7: Print "The Assassin:  ";: Color 12: Print Chr$(143);: Color 7: Print "  Walls don't stop her! Beware, she's fast! ";

Locate 9, 4: Color 7: Print "Collect (snag) jewels for points and to move to the next level.": Print "  Shoot at and vanquish Bad Guys & Assassins to increase 'Kills.'";
Locate 11, 4: Color 7: Print "Hide inside walls to lure Bad Guys to get zapped to also increase 'Kills.'";

Locate 13, 3: Color 7: Print "Use the A S W and D keys to move one space at a time to gather jewels.";
Locate 14, 3: Color 7: Print "Use the Arrow keys to move many spaces at a time.";
Locate 15, 3: Color 7: Print "Use the 1 and 3 keys on the numeric keypad to shoot guns left and right.";

Locate 18, 4: Color 7: Print "Sometimes a Jewel and a Bomb will occupy the same spot";: Locate 19, 6: Print " & then the Bomb becomes hidden...  Sorry.  Smile";

Locate 22, 25: Color 7: Print "<Press any key to continue>";

Sleep

i$ = ""

GoTo 2

Return



HighScore: '                                                                                                  HIGH SCORE ZONE

Sound 0, 0

Open "hiscore.sng" For Input As #1
For position% = 1 To 5
    Input #1, NameFromFile$, LevelFromFile%, KillsFromFile%, ScoreFromFile%
    If level% >= LevelFromFile% Then If score% > ScoreFromFile% Then Close #1: GoTo 2000
Next position%

Close #1

GoTo 3500

2000
Rem GOSUB dumpusershots
If i$ <> "n" Then GoSub MakeDots
Rem                                                                        MAKE A FANCIER HIGH SCORE PAGE        ???




Locate 16, 10: Print "You have made it to the HIGH SCORE BOARD!"
Locate 18, 10: Input "Please enter your name (11 letter max) >> ", NewName$

Locate 16, 9: Print "                                              "
Locate 18, 9: Print "                                                          "

Open "hiscore.sng" For Input As #1
Open "newscore.sng" For Output As #2

On position% GOTO Num1, Num2, Num3, Num4, Num5

Num1:
Write #2, NewName$, level%, kills%, score%

For Y% = 1 To 4
    Input #1, NameFromFile$, LevelFromFile%, KillsFromFile%, ScoreFromFile%
    Write #2, NameFromFile$, LevelFromFile%, KillsFromFile%, ScoreFromFile%
Next Y%

GoTo 3000

Num2:
Input #1, NameFromFile$, LevelFromFile%, KillsFromFile%, ScoreFromFile%
Write #2, NameFromFile$, LevelFromFile%, KillsFromFile%, ScoreFromFile%
Write #2, NewName$, level%, kills%, score%

For Y% = 1 To 3
    Input #1, NameFromFile$, LevelFromFile%, KillsFromFile%, ScoreFromFile%
    Write #2, NameFromFile$, LevelFromFile%, KillsFromFile%, ScoreFromFile%
Next Y%

GoTo 3000

Num3:
Input #1, NameFromFile$, LevelFromFile%, KillsFromFile%, ScoreFromFile%
Write #2, NameFromFile$, LevelFromFile%, KillsFromFile%, ScoreFromFile%
Input #1, NameFromFile$, LevelFromFile%, KillsFromFile%, ScoreFromFile%
Write #2, NameFromFile$, LevelFromFile%, KillsFromFile%, ScoreFromFile%

Write #2, NewName$, level%, kills%, score%

For Y% = 1 To 2
    Input #1, NameFromFile$, LevelFromFile%, KillsFromFile%, ScoreFromFile%
    Write #2, NameFromFile$, LevelFromFile%, KillsFromFile%, ScoreFromFile%
Next Y%

GoTo 3000

Num4:
For Y% = 1 To 3
    Input #1, NameFromFile$, LevelFromFile%, KillsFromFile%, ScoreFromFile%
    Write #2, NameFromFile$, LevelFromFile%, KillsFromFile%, ScoreFromFile%
Next Y%
Write #2, NewName$, level%, kills%, score%


Input #1, NameFromFile$, LevelFromFile%, KillsFromFile%, ScoreFromFile%
Write #2, NameFromFile$, LevelFromFile%, KillsFromFile%, ScoreFromFile%


GoTo 3000

Num5:
For Y% = 1 To 4
    Input #1, NameFromFile$, LevelFromFile%, KillsFromFile%, ScoreFromFile%
    Write #2, NameFromFile$, LevelFromFile%, KillsFromFile%, ScoreFromFile%
Next Y%
Write #2, NewName$, level%, kills%, score%


3000

Close #2: Close #1

Kill "hiscore.sng"

Name "newscore.sng" As "hiscore.sng"

3500

Locate 7, 33: Color 31: Print "GAME OVER";: Color 15

For z% = 1 To 7: Locate 14 + z%, 9: For Y% = 1 To 60: Print " ";
Next Y%: Next z%

Color 15 '*** BOX ***
Locate 14, 8
Print Chr$(201);: For z% = 1 To 60: Print Chr$(205);: Next z%
Print Chr$(187); d$; l$;
For z% = 1 To 7: Print Chr$(186); l$; d$;: Next z%
Print Chr$(188);
Locate 22, 8
Print Chr$(200);
For z% = 1 To 60: Print Chr$(205);: Next z%
Locate 15, 8
For z% = 1 To 7: Print Chr$(186); l$; d$;: Next z%

Color 7

Open "hiscore.sng" For Input As #1
Locate 15, 30: Print "HIGH SCORE BOARD:"

For z% = 1 To 5
    Input #1, NameFromFile$, LevelFromFile%, KillsFromFile%, ScoreFromFile%
    Locate 16 + z%, 11: Print z%; l$; ". ";
    Print Using "\        \"; NameFromFile$;
    Print "  Level: ";
    Print Using "#"; LevelFromFile%;
    Print "  Kills: ";
    Print Using "###"; KillsFromFile%;
    Print " "; "  Score:"; '
    Print Using "####"; ScoreFromFile%;
Next z%

Close #1

4000

Return


ErrorHandler:

Select Case Err

    Case 53
        Open "hiscore.sng" For Output As #3
        For z% = 1 To 5
            Write #3, "<><><><><>", 0, 0, 0
        Next z%
        Close #3
        Resume 0
        End

    Case 55
        Print "Oy... File already open -- how??!!"
        Resume Next
        End

    Case 6
        Print "Variable overflow, how can this be?!"
        Resume Next
        End

    Case 11
        Print "Yo!"
        Resume Next
        End

    Case 13
        Print "Type mismatch, feh!"
        Resume Next
        End

    Case 57
        Print "Device I/O error!"
        Resume Next
        End

    Case Else
        Sound 7000, 5
        Resume Next
        End


End Select


ReleaseHelper:

Released$ = "y"

For b% = 1 To 4 '                                                HIGH CHIRP ALARM
    For a% = 2000 To 1600 Step -100
        Sound a%, .7
    Next a%
Next b%

HelperY% = Int(Rnd * 21 + 2): HelperX% = Int(Rnd * 74 + 3)


Return


MoveHelper:

Locate HelperY%, HelperX%

GoSub pause2

Print l$;
Print " "; l$;

GoSub PickDirection

Hmove$ = move$


If HelperY% >= 25 Then Hmove$ = u$ '    was 25
If HelperY% <= 1 Then Hmove$ = d$
If HelperX% >= 79 Then Hmove$ = l$ ' was 79
If HelperX% <= 3 Then Hmove$ = r$


If Hmove$ = u$ Then HelperY% = HelperY% - 1
If Hmove$ = d$ Then HelperY% = HelperY% + 1
If Hmove$ = l$ Then HelperX% = HelperX% - 1
If Hmove$ = r$ Then HelperX% = HelperX% + 1


Locate HelperY%, (HelperX% - 1): Color 10: Print "H";: Color 7 '            PRINT ASS COLOR



If HelperY% = YouYpos% And HelperX% = YouXpos% Then GoSub HelperHealth '                                    TURN THIS INTO A RANGE INSTEAD OF EQUALS!!!!!!!!!!************

If (HelperY% = (YouYpos% + 1) Or HelperY% = YouYpos% Or HelperY% = (YouYpos% - 1)) And (HelperX% = (YouXpos% - 1) Or HelperX% = YouXpos% Or HelperX% = (YouXpos% + 1)) Then GoSub HelperHealth

Rem                                                                                                        NEW!!!!!

If HelperY% = 25 Then Sound 2000, .02
If HelperY% = 1 Then Sound 4000, .02
If HelperX% <= 3 Then Sound 6000, .02
If HelperX% = 80 Then Sound 8000, .02


Return



HelperHealth:

For b% = 1000 To 1100 Step 25: Sound b%, 1: Next b%

health% = health% + 15
Released$ = "n"

Locate HelperY%, (HelperX% - 1): Print " "; l$;

Return


Banner:

count% = 1

Restore DataBase2

Cls

Read DataY%, DataX%: DataX% = DataX% + 19

For Y% = 1 To 12

    Sound 45, 1

    For X% = 1 To 80

        Locate Y%, X%
        Color 7
        Print Chr$(219);
        GoSub Paws
        Print l$; " ";
        Col% = Int(Rnd * 15 + 1): Color Col%
        If Y% = DataY% And X% = DataX% Then Print l$; Chr$(219);: If count% < 104 Then Read DataY%, DataX%: DataX% = DataX% + 19: count% = count% + 1

        i$ = InKey$
        If i$ = Chr$(27) Then GoTo 2

    Next X%

Next Y%

Sound 45, 1
Sound 0, 0

Color 15

Locate 2, 14
Print Chr$(201); ' Upper Left Corner

For a% = 1 To 50
    Print Chr$(205); '  Horizontal line to right
    GoSub Paws
Next a%

Print Chr$(187); ' Upper Right Corner

For a% = 1 To 9
    Print l$; d$; Chr$(186); ' Vertical Line Down

    GoSub Paws
Next a%

Print l$; Chr$(188); ' Lower Right Corner

For a% = 1 To 51
    Print l$; l$; Chr$(205); '  Horizontal Line to Left
    GoSub Paws
Next a%

Print l$; Chr$(200); ' Lower Left Corner

For a% = 1 To 8
    Print l$; u$; Chr$(186); ' Vertical Line Up
    GoSub Paws
Next a%

Sleep 1
Locate 4, 62: Print Chr$(15);
Sound 2300, 3


Sleep 1

222

Color 15: Sound 6000, 2: Sound 5000, 1

Locate 3, 62: Print "|";: GoSub Paws2: GoSub Paws2: Print l$; " ";
Locate 3, 63: Print "/";: GoSub Paws2: GoSub Paws2: Print l$; " ";
Locate 4, 63: Print "-";: GoSub Paws2: GoSub Paws2: Print l$; " ";
Locate 5, 63: Print "\";: GoSub Paws2: GoSub Paws2: Print l$; " ";
Locate 5, 62: Print "|";: GoSub Paws2: GoSub Paws2: Print l$; " ";
Locate 5, 61: Print "/";: GoSub Paws2: GoSub Paws2: Print l$; " ";
Locate 4, 61: Print "-";: GoSub Paws2: GoSub Paws2: Print l$; " ";
Locate 3, 61: Print "\";: GoSub Paws2: GoSub Paws2: Print l$; " ";
Locate 3, 62: Print "|";: GoSub Paws2: GoSub Paws2:: GoSub Paws2: GoSub Paws2: Print l$; " ";


Sleep 1

Return

DataBase2:
Data 4,1,4,2,4,3,4,4,4,7,4,10,4,13,4,14,4,15,4,16,4,19,4,20,4,21,4,22,4,25,4,26,4,27,4,28,4,31,4,32,4,33,4,34,4,37,4,38,4,39,4,40
Data 5,1,5,7,5,8,5,10,5,13,5,16,5,19,5,25,5,31,5,37,5,40
Data 6,1,6,7,6,9,6,10,6,13,6,14,6,15,6,16,6,19,6,25,6,31,6,37,6,38,6,39,6,40
Data 7,1,7,2,7,3,7,4,7,7,7,10,7,13,7,16,7,19,7,21,7,22,7,25,7,27,7,28,7,31,7,32,7,37,7,39
Data 8,4,8,7,8,10,8,13,8,16,8,19,8,22,8,25,8,28,8,31,8,37,8,40
Data 9,1,9,2,9,3,9,4,9,7,9,10,9,13,9,16,9,19,9,20,9,21,9,22,9,25,9,26,9,27,9,28,9,31,9,32,9,33,9,34,9,37,9,40


Paws:
For c = 1 To 1200000: Next c
Return

Paws2:
For c = 1 To 3000000: Next c
Return




















RE: Chase in ASCII - SierraKen - 09-20-2025

Thanks NakedApe! Yours is pretty cool! I noticed that the WASD keys on yours are needed to play though, because the arrow keys skip many places at once, unless maybe they are for warping? Good job!

Mine use the WASD keys also or arrow keys, both work. Eventually I might use mine as a template to make more sophisticated games. Smile


RE: Chase in ASCII - NakedApe - 09-20-2025

Yes, it's two-handed game. WASD for single moves and arrow keys for bigger jumps. Glad you like.