Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Smallish Games
#13
here is game carlos brought to my attention at the other place
Code: (Select All)
_Title "Old SHMUP game"
Screen 0: Width 80: Color 15

Dim sk As String
Dim b$, m$, a$
Dim x, y, mx, my, ax, ay

x = 37
y = 23
b$ = " ÜÛÜ  "
aa = 0
a$ = "*"
ma = 0
m$ = "|"

Do
    If Inp(&H60) = 75 Then
        x = x - 1
    End If
    If Inp(&H60) = 77 Then
        x = x + 1
    End If

    If x < 1 Then x = 1
    If x > 75 Then x = 75

    If aa = 0 Then
        ax = Int(Rnd(1) * 76) + 2
        ay = Int(Rnd(1) * y)
        aa = 1
        Locate ay, ax
        Print a$
    End If

    If Inp(&H60) = 57 And ma = 0 Then
        mx = x + 2
        my = y - 1
        ma = 1
    End If

    Locate y, x
    Print b$

    If ma = 1 Then
        Locate my, mx
        Print " "
        my = my - 1

        If my < 1 Then
            ma = 0
        Else
            Locate my, mx
            If mx = ax And my = ay Then
                aa = 0
                ma = 0
                Locate ay, ax
                Print " "
                ax = Int(Rnd(1) * 76) + 2
                ay = Int(Rnd(1) * y)
            Else
                Print m$
            End If
        End If
    End If
    _Display
    _Limit 20
Loop Until InKey$ = Chr$(27) ' Pressionar a tecla Esc para sair

he wanted to build a character editor to change the shape of canon. i showed how he might do that without building character editor (for screen 0 chars, which i'm not sure how to do, graphics screen easy but changing screen 0, don't know...) I went on to make over the whole game, kinda cute


SHMUP mod b+


Code: (Select All)
Option _Explicit
_Title "SHMUP mod 1 b+ 2024-05-02"
Screen 0: Width 80: Color 15

Dim cannon1$, cannon2$, missile$, alien$
Dim As Integer cannonX, cannonY, missileX, missileY, missileActive
Dim As Integer alienX, alienY, alienActive, invaded, repelled, frame
Dim As Long kh
cannonX = 37
cannonY = 23
cannon1$ = " ÜÛÜ " 'this works better
cannon2$ = "ÛÛ ÛÛ"
alienActive = 0
alien$ = "<" + Chr$(233) + ">"
missileActive = 0
missile$ = "|"
'invaded = 60
Do
    Cls
    kh = _KeyHit
    If kh = 19200 Then 'LEFT
        cannonX = cannonX - 1
    ElseIf kh = 19712 Then ' RIGHT
        cannonX = cannonX + 1
    ElseIf kh = 32 And missileActive = 0 Then
        missileX = cannonX + 2
        missileY = cannonY
        missileActive = 1
    End If

    If cannonX < 1 Then cannonX = 1
    If cannonX > 75 Then cannonX = 75

    If alienActive = 0 Then
        alienX = Int(Rnd * 76) + 2 - 1
        alienY = 1
        alienActive = 1
        frame = 0
    Else
        frame = frame + 1
        If frame = 15 Then alienY = alienY + 1: frame = 0
        If alienY = 23 Then
            invaded = invaded + 1
            alienActive = 0
        End If
    End If
    Locate alienY, alienX 'draw invader
    Print alien$

    Locate cannonY, cannonX 'draw canon
    Print cannon1$;
    Locate cannonY + 1, cannonX
    Print cannon2$;

    If missileActive = 1 Then ' handle missile
        missileY = missileY - 1
        If missileY < 1 Then
            missileActive = 0
        Else
            Locate missileY, missileX
            If missileX = alienX + 1 And missileY = alienY Then ' hit
                alienActive = 0
                missileActive = 0
                Locate alienY, alienX
                Print " * "
                repelled = repelled + 1
                _Display
                _Delay .1
                alienX = Int(Rnd(1) * 76) + 2 + 1 'new alien
                alienY = Int(Rnd(1) * cannonY)
            Else
                Print missile$
            End If
        End If
    End If
    _Title "Shumps   Invaded:" + Str$(invaded) + "  Repelled:" + Str$(repelled)
    _Display
    _Limit 60
    If Abs(invaded - repelled) > 25 Then Exit Do
Loop Until InKey$ = Chr$(27) ' Pressionar a tecla Esc para sair
If invaded - repelled > 25 Then
    Locate 12, 27: Print "Game over Aliens took over ;("
ElseIf repelled - invaded > 25 Then
    Locate 12, 28: Print "Game over Aliens defeated :)"
End If
_Display
End
b = b + ...
Reply


Messages In This Thread
Smallish Games - by bplus - 04-25-2022, 10:55 PM
Smallish Games - by bplus - 06-12-2022, 12:01 AM
RE: Smallish Games - by johnno56 - 06-12-2022, 07:43 AM
RE: Smallish Games - by bplus - 01-12-2023, 11:48 PM
RE: Smallish Games - by PhilOfPerth - 01-13-2023, 01:25 AM
RE: Smallish Games - by bplus - 01-13-2023, 03:08 AM
RE: Smallish Games - by bplus - 03-01-2023, 05:19 AM
RE: Smallish Games - by PhilOfPerth - 03-01-2023, 06:49 AM
RE: Smallish Games - by bplus - 03-01-2023, 03:54 PM
RE: Smallish Games - by bplus - 07-14-2023, 08:11 PM
RE: Smallish Games - by bplus - 07-14-2023, 08:27 PM
RE: Smallish Games - by mnrvovrfc - 07-14-2023, 09:47 PM
RE: Smallish Games - by bplus - 05-03-2024, 06:35 PM
RE: Smallish Games - by bplus - 05-30-2024, 12:57 PM
RE: Smallish Games - by JRace - 05-31-2024, 03:44 AM
RE: Smallish Games - by bplus - 05-31-2024, 10:07 AM
RE: Smallish Games - by bplus - 07-17-2024, 05:24 PM
RE: Smallish Games - by Pete - 07-17-2024, 06:51 PM
RE: Smallish Games - by bplus - 09-12-2024, 07:09 PM
RE: Smallish Games - by bplus - 09-13-2024, 09:47 AM



Users browsing this thread: 3 Guest(s)