Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Click The Button Game
#1
I'm sure many of you have already made this game, but I wanted to see if I could do it without any help. Smile 
You got 120 seconds to see how many times you can use the mouse to click the button. Plus there's the option to start over. 



Code: (Select All)

Screen _NewImage(800, 600, 32)
begin:
score = 0
buttonx = 370
buttony = 300
text$ = "Click"
_Title "Click The Button Game by SierraKen"

c = 10
For bb = 0 To 30
    c = c + 10
    Line (buttonx + bb, buttony + bb)-(buttonx2 - bb, buttony2 - bb), _RGB32(100 + c, 100 + c, 100 + c), B
Next bb
Color _RGB32(0, 0, 0)
_PrintString (buttonx + 32, buttony + 17), text$

dir = 1
t = Timer
Do

    _Limit 350
    buttonx2 = buttonx + 100
    buttony2 = buttony + 50
    ti = Timer - t
    c = 10
    For bb = 0 To 30
        c = c + 10
        Line (buttonx + bb, buttony + bb)-(buttonx2 - bb, buttony2 - bb), _RGB32(100 + c, 100 + c, 100 + c), B
    Next bb
    Color _RGB32(0, 0, 0), _RGB32(255, 255, 255)
    _PrintString (buttonx + 32, buttony + 17), text$
    Color _RGB32(255, 255, 255), _RGB32(0, 0, 0)
    Locate 1, 1: Print "Score: "; score
    Locate 2, 1: Print "Time Left: "; Int(120 - ti)
    If Int(120 - ti) < 1 Then
        Locate 30, 50
        Print "The End"
        Locate 34, 50
        Input "Again (Y/N)"; ag$
        If Left$(ag$, 1) = "y" Or Left$(ag$, 1) = "Y" Then GoTo begin:
        End
    End If
    While _MouseInput: Wend
    mousex = _MouseX
    mousey = _MouseY
    mouseLeftButton = _MouseButton(1)

    If mouseLeftButton Then
        Clear_MB 1
        If mousex > buttonx And mousex < buttonx2 And mousey > buttony And mousey < buttony2 Then

            c = 110
            _AutoDisplay
            For bb = 0 To 30
                c = c - 10
                Line (buttonx + bb, buttony + bb)-(buttonx2 - bb, buttony2 - bb), _RGB32(100 + c, 100 + c, 100 + c), B
            Next bb
            _Delay .1

            For bb = 0 To 30
                c = c + 10
                Line (buttonx + bb, buttony + bb)-(buttonx2 - bb, buttony2 - bb), _RGB32(100 + c, 100 + c, 100 + c), B
            Next bb
            _Delay .05

            c = 10
            For bb = 0 To 30
                c = c + 10
                Line (buttonx + bb, buttony + bb)-(buttonx2 - bb, buttony2 - bb), _RGB32(100 + c, 100 + c, 100 + c), B
            Next bb

            _Delay .1
            Color _RGB32(0, 0, 0), _RGB32(255, 255, 255)
            _PrintString (buttonx + 32, buttony + 17), text$
            Sound 900, 1, , , 6
            score = score + 1
            Color _RGB32(255, 255, 255), _RGB32(0, 0, 0)
            Locate 1, 1: Print "Score: "; score
            buttonx = Int(Rnd * 650) + 49
            buttony = Int(Rnd * 500) + 19
        End If
    End If

    changedir = Int(Rnd * 100) + 1
    If changedir > 95 Then
        dir = Int(Rnd * 8) + 1
    End If
    If dir = 1 Then buttony = buttony + 1
    If dir = 2 Then buttony = buttony - 1
    If dir = 3 Then buttonx = buttonx + 1
    If dir = 4 Then buttonx = buttonx - 1

    If dir = 5 Then buttony = buttony + 1: buttonx = buttonx + 1
    If dir = 6 Then buttony = buttony - 1: buttonx = buttonx - 1
    If dir = 7 Then buttonx = buttonx + 1: buttony = buttony + 1
    If dir = 8 Then buttonx = buttonx - 1: buttony = buttony - 1

    If buttonx > 700 And dir = 3 Then dir = 4
    If buttonx > 700 And dir = 7 Then dir = 8
    If buttonx < 50 And dir = 4 Then dir = 3
    If buttonx < 50 And dir = 8 Then dir = 7

    If buttony > 520 And dir = 1 Then dir = 2
    If buttony > 520 And dir = 5 Then dir = 6
    If buttony < 50 And dir = 2 Then dir = 1
    If buttony < 50 And dir = 8 Then dir = 7
    _Display
    Cls , _RGB32(0, 0, 0)


Loop until Inkey$ = CHR$(27)


Sub Clear_MB (var As Integer)

    Do Until Not _MouseButton(var)
        While _MouseInput: Wend
    Loop

End Sub 'Clear_MB
Reply
#2
Here is a much more fun version. Every time you click the button, the game speeds up by 10 _LIMIT numbers. I've tried it once so far and got a score of 45. Smile 
Try it out!

Code: (Select All)

Screen _NewImage(800, 600, 32)
begin:
score = 0
speed = 0
buttonx = 370
buttony = 300
text$ = "Click"
_Title "Click The Button Game by SierraKen"

c = 10
For bb = 0 To 30
    c = c + 10
    Line (buttonx + bb, buttony + bb)-(buttonx2 - bb, buttony2 - bb), _RGB32(100 + c, 100 + c, 100 + c), B
Next bb
Color _RGB32(0, 0, 0)
_PrintString (buttonx + 32, buttony + 17), text$

dir = 1
t = Timer
Do

    _Limit 300 + speed
    buttonx2 = buttonx + 100
    buttony2 = buttony + 50
    ti = Timer - t
    c = 10
    For bb = 0 To 30
        c = c + 10
        Line (buttonx + bb, buttony + bb)-(buttonx2 - bb, buttony2 - bb), _RGB32(100 + c, 100 + c, 100 + c), B
    Next bb
    Color _RGB32(0, 0, 0), _RGB32(255, 255, 255)
    _PrintString (buttonx + 32, buttony + 17), text$
    Color _RGB32(255, 255, 255), _RGB32(0, 0, 0)
    Locate 1, 1: Print "Score: "; score
    Locate 2, 1: Print "Time Left: "; Int(120 - ti)
    If Int(120 - ti) < 1 Then
        Locate 30, 50
        Print "The End"
        Locate 34, 50
        Input "Again (Y/N)"; ag$
        If Left$(ag$, 1) = "y" Or Left$(ag$, 1) = "Y" Then GoTo begin:
        End
    End If
    While _MouseInput: Wend
    mousex = _MouseX
    mousey = _MouseY
    mouseLeftButton = _MouseButton(1)

    If mouseLeftButton Then
        Clear_MB 1
        If mousex > buttonx And mousex < buttonx2 And mousey > buttony And mousey < buttony2 Then

            c = 110
            _AutoDisplay
            For bb = 0 To 30
                c = c - 10
                Line (buttonx + bb, buttony + bb)-(buttonx2 - bb, buttony2 - bb), _RGB32(100 + c, 100 + c, 100 + c), B
            Next bb
            _Delay .1

            For bb = 0 To 30
                c = c + 10
                Line (buttonx + bb, buttony + bb)-(buttonx2 - bb, buttony2 - bb), _RGB32(100 + c, 100 + c, 100 + c), B
            Next bb
            _Delay .05

            c = 10
            For bb = 0 To 30
                c = c + 10
                Line (buttonx + bb, buttony + bb)-(buttonx2 - bb, buttony2 - bb), _RGB32(100 + c, 100 + c, 100 + c), B
            Next bb

            _Delay .1
            Color _RGB32(0, 0, 0), _RGB32(255, 255, 255)
            _PrintString (buttonx + 32, buttony + 17), text$
            Sound 900, 1, , , 6
            score = score + 1
            Color _RGB32(255, 255, 255), _RGB32(0, 0, 0)
            Locate 1, 1: Print "Score: "; score
            buttonx = Int(Rnd * 650) + 49
            buttony = Int(Rnd * 500) + 19
            speed = speed + 10
        End If
    End If

    changedir = Int(Rnd * 100) + 1
    If changedir > 95 Then
        dir = Int(Rnd * 8) + 1
    End If
    If dir = 1 Then buttony = buttony + 1
    If dir = 2 Then buttony = buttony - 1
    If dir = 3 Then buttonx = buttonx + 1
    If dir = 4 Then buttonx = buttonx - 1

    If dir = 5 Then buttony = buttony + 1: buttonx = buttonx + 1
    If dir = 6 Then buttony = buttony - 1: buttonx = buttonx - 1
    If dir = 7 Then buttonx = buttonx + 1: buttony = buttony + 1
    If dir = 8 Then buttonx = buttonx - 1: buttony = buttony - 1

    If buttonx > 700 And dir = 3 Then dir = 4
    If buttonx > 700 And dir = 7 Then dir = 8
    If buttonx < 50 And dir = 4 Then dir = 3
    If buttonx < 50 And dir = 8 Then dir = 7

    If buttony > 520 And dir = 1 Then dir = 2
    If buttony > 520 And dir = 5 Then dir = 6
    If buttony < 50 And dir = 2 Then dir = 1
    If buttony < 50 And dir = 8 Then dir = 7
    _Display
    Cls , _RGB32(0, 0, 0)


Loop Until InKey$ = Chr$(27)


Sub Clear_MB (var As Integer)

    Do Until Not _MouseButton(var)
        While _MouseInput: Wend
    Loop

End Sub 'Clear_MB
Reply
#3
(03-24-2025, 01:44 AM)SierraKen Wrote: Here is a much more fun version. Every time you click the button, the game speeds up by 10 _LIMIT numbers. I've tried it once so far and got a score of 45. Smile 
Try it out!

Code: (Select All)

Screen _NewImage(800, 600, 32)
begin:
score = 0
speed = 0
buttonx = 370
buttony = 300
text$ = "Click"
_Title "Click The Button Game by SierraKen"

c = 10
For bb = 0 To 30
    c = c + 10
    Line (buttonx + bb, buttony + bb)-(buttonx2 - bb, buttony2 - bb), _RGB32(100 + c, 100 + c, 100 + c), B
Next bb
Color _RGB32(0, 0, 0)
_PrintString (buttonx + 32, buttony + 17), text$

dir = 1
t = Timer
Do

    _Limit 300 + speed
    buttonx2 = buttonx + 100
    buttony2 = buttony + 50
    ti = Timer - t
    c = 10
    For bb = 0 To 30
        c = c + 10
        Line (buttonx + bb, buttony + bb)-(buttonx2 - bb, buttony2 - bb), _RGB32(100 + c, 100 + c, 100 + c), B
    Next bb
    Color _RGB32(0, 0, 0), _RGB32(255, 255, 255)
    _PrintString (buttonx + 32, buttony + 17), text$
    Color _RGB32(255, 255, 255), _RGB32(0, 0, 0)
    Locate 1, 1: Print "Score: "; score
    Locate 2, 1: Print "Time Left: "; Int(120 - ti)
    If Int(120 - ti) < 1 Then
        Locate 30, 50
        Print "The End"
        Locate 34, 50
        Input "Again (Y/N)"; ag$
        If Left$(ag$, 1) = "y" Or Left$(ag$, 1) = "Y" Then GoTo begin:
        End
    End If
    While _MouseInput: Wend
    mousex = _MouseX
    mousey = _MouseY
    mouseLeftButton = _MouseButton(1)

    If mouseLeftButton Then
        Clear_MB 1
        If mousex > buttonx And mousex < buttonx2 And mousey > buttony And mousey < buttony2 Then

            c = 110
            _AutoDisplay
            For bb = 0 To 30
                c = c - 10
                Line (buttonx + bb, buttony + bb)-(buttonx2 - bb, buttony2 - bb), _RGB32(100 + c, 100 + c, 100 + c), B
            Next bb
            _Delay .1

            For bb = 0 To 30
                c = c + 10
                Line (buttonx + bb, buttony + bb)-(buttonx2 - bb, buttony2 - bb), _RGB32(100 + c, 100 + c, 100 + c), B
            Next bb
            _Delay .05

            c = 10
            For bb = 0 To 30
                c = c + 10
                Line (buttonx + bb, buttony + bb)-(buttonx2 - bb, buttony2 - bb), _RGB32(100 + c, 100 + c, 100 + c), B
            Next bb

            _Delay .1
            Color _RGB32(0, 0, 0), _RGB32(255, 255, 255)
            _PrintString (buttonx + 32, buttony + 17), text$
            Sound 900, 1, , , 6
            score = score + 1
            Color _RGB32(255, 255, 255), _RGB32(0, 0, 0)
            Locate 1, 1: Print "Score: "; score
            buttonx = Int(Rnd * 650) + 49
            buttony = Int(Rnd * 500) + 19
            speed = speed + 10
        End If
    End If

    changedir = Int(Rnd * 100) + 1
    If changedir > 95 Then
        dir = Int(Rnd * 8) + 1
    End If
    If dir = 1 Then buttony = buttony + 1
    If dir = 2 Then buttony = buttony - 1
    If dir = 3 Then buttonx = buttonx + 1
    If dir = 4 Then buttonx = buttonx - 1

    If dir = 5 Then buttony = buttony + 1: buttonx = buttonx + 1
    If dir = 6 Then buttony = buttony - 1: buttonx = buttonx - 1
    If dir = 7 Then buttonx = buttonx + 1: buttony = buttony + 1
    If dir = 8 Then buttonx = buttonx - 1: buttony = buttony - 1

    If buttonx > 700 And dir = 3 Then dir = 4
    If buttonx > 700 And dir = 7 Then dir = 8
    If buttonx < 50 And dir = 4 Then dir = 3
    If buttonx < 50 And dir = 8 Then dir = 7

    If buttony > 520 And dir = 1 Then dir = 2
    If buttony > 520 And dir = 5 Then dir = 6
    If buttony < 50 And dir = 2 Then dir = 1
    If buttony < 50 And dir = 8 Then dir = 7
    _Display
    Cls , _RGB32(0, 0, 0)


Loop Until InKey$ = Chr$(27)


Sub Clear_MB (var As Integer)

    Do Until Not _MouseButton(var)
        While _MouseInput: Wend
    Loop

End Sub 'Clear_MB

Nice! Quite challenging to score (for me) .
I found I can "cheat" by holding mouse button down, moving to button, then release and click
Of all the places on Earth, and all the planets in the Universe, I'd rather live here (Perth, W.A.) Big Grin
Please visit my Website at: http://oldendayskids.blogspot.com/
Reply
#4
Thanks for playing Phil. I didn't know about that cheat. But I just removed the SUB access and it was even easier to cheat. So I'm not sure how to fix that, or if there is a way. 

Here is a video of the game: 

Reply
#5
(03-24-2025, 02:19 AM)SierraKen Wrote: Thanks for playing Phil. I didn't know about that cheat. But I just removed the SUB access and it was even easier to cheat. So I'm not sure how to fix that, or if there is a way. 

Here is a video of the game: 


No sweat, Ken. The game is meant for fun, and if someone wants to cheat, well, who are they cheating?
Of all the places on Earth, and all the planets in the Universe, I'd rather live here (Perth, W.A.) Big Grin
Please visit my Website at: http://oldendayskids.blogspot.com/
Reply
#6
LOL yep, thanks Phil.
Reply
#7
Since I use Timer, which resets at midnight, I decided to just have the game stop at midnight and ask the player to restart. Since the game only lasts 2 minutes, it should be fine. I also put a limit on the speed of the game, which would have to be if you clicked 100 times, which I can't even do half that amount so far. Smile 

Edit: Speed increase slowed down to make the game a little easier. 

Code: (Select All)

Screen _NewImage(800, 600, 32)
begin:
score = 0
speed = 0
buttonx = 370
buttony = 300
text$ = "Click"
_Title "Click The Button Game by SierraKen"

c = 10
For bb = 0 To 30
    c = c + 10
    Line (buttonx + bb, buttony + bb)-(buttonx2 - bb, buttony2 - bb), _RGB32(100 + c, 100 + c, 100 + c), B
Next bb
Color _RGB32(0, 0, 0)
_PrintString (buttonx + 32, buttony + 17), text$

dir = 1
t = Timer
Do

    _Limit 300 + speed
    buttonx2 = buttonx + 100
    buttony2 = buttony + 50
    ti = Timer - t
    If Timer < 2 Then
        Locate 20, 10
        Print "Game Cannot Play Through 12:00:00 Midnight, Please Start Over."
        Locate 24, 10
        Input "Again (Y/N)"; ag$
        If Left$(ag$, 1) = "y" Or Left$(ag$, 1) = "Y" Then GoTo begin:
        End
    End If
    c = 10
    For bb = 0 To 30
        c = c + 10
        Line (buttonx + bb, buttony + bb)-(buttonx2 - bb, buttony2 - bb), _RGB32(100 + c, 100 + c, 100 + c), B
    Next bb
    Color _RGB32(0, 0, 0), _RGB32(255, 255, 255)
    _PrintString (buttonx + 32, buttony + 17), text$
    Color _RGB32(255, 255, 255), _RGB32(0, 0, 0)
    Locate 1, 1: Print "Score: "; score
    Locate 2, 1: Print "Time Left: "; Int(120 - ti)
    If Int(120 - ti) < 1 Then
        Locate 20, 50
        Print "The End"
        Locate 24, 50
        Input "Again (Y/N)"; ag$
        If Left$(ag$, 1) = "y" Or Left$(ag$, 1) = "Y" Then GoTo begin:
        End
    End If
    While _MouseInput: Wend
    mousex = _MouseX
    mousey = _MouseY
    mouseLeftButton = _MouseButton(1)

    If mouseLeftButton Then
        Clear_MB 1
        If mousex > buttonx And mousex < buttonx2 And mousey > buttony And mousey < buttony2 Then

            c = 110
            _AutoDisplay
            For bb = 0 To 30
                c = c - 10
                Line (buttonx + bb, buttony + bb)-(buttonx2 - bb, buttony2 - bb), _RGB32(100 + c, 100 + c, 100 + c), B
            Next bb
            _Delay .1

            For bb = 0 To 30
                c = c + 10
                Line (buttonx + bb, buttony + bb)-(buttonx2 - bb, buttony2 - bb), _RGB32(100 + c, 100 + c, 100 + c), B
            Next bb
            _Delay .05

            c = 10
            For bb = 0 To 30
                c = c + 10
                Line (buttonx + bb, buttony + bb)-(buttonx2 - bb, buttony2 - bb), _RGB32(100 + c, 100 + c, 100 + c), B
            Next bb

            _Delay .1
            Color _RGB32(0, 0, 0), _RGB32(255, 255, 255)
            _PrintString (buttonx + 32, buttony + 17), text$
            Sound 900, 1, , , 6
            score = score + 1
            Color _RGB32(255, 255, 255), _RGB32(0, 0, 0)
            Locate 1, 1: Print "Score: "; score
            buttonx = Int(Rnd * 650) + 49
            buttony = Int(Rnd * 500) + 19
            speed = speed + 2
            If speed > 1000 Then speed = 1000
        End If
    End If

    changedir = Int(Rnd * 100) + 1
    If changedir > 95 Then
        dir = Int(Rnd * 8) + 1
    End If
    If dir = 1 Then buttony = buttony + 1
    If dir = 2 Then buttony = buttony - 1
    If dir = 3 Then buttonx = buttonx + 1
    If dir = 4 Then buttonx = buttonx - 1

    If dir = 5 Then buttony = buttony + 1: buttonx = buttonx + 1
    If dir = 6 Then buttony = buttony - 1: buttonx = buttonx - 1
    If dir = 7 Then buttonx = buttonx + 1: buttony = buttony + 1
    If dir = 8 Then buttonx = buttonx - 1: buttony = buttony - 1

    If buttonx > 700 And dir = 3 Then dir = 4
    If buttonx > 700 And dir = 7 Then dir = 8
    If buttonx < 50 And dir = 4 Then dir = 3
    If buttonx < 50 And dir = 8 Then dir = 7

    If buttony > 520 And dir = 1 Then dir = 2
    If buttony > 520 And dir = 5 Then dir = 6
    If buttony < 50 And dir = 2 Then dir = 1
    If buttony < 50 And dir = 8 Then dir = 7
    _Display
    Cls , _RGB32(0, 0, 0)


Loop Until InKey$ = Chr$(27)


Sub Clear_MB (var As Integer)

    Do Until Not _MouseButton(var)
        While _MouseInput: Wend
    Loop

End Sub 'Clear_MB
Reply
#8
I just fixed the midnight overlapping issue with TIMER with help from ChatGPT. It's only a few lines so I believe it will work, but I haven't tested it. I would change my computer clock to test it but the last time I did that it messed up some things on my computer. Maybe next time I stay up until midnight I'll remember to test it. lol
I also slowed down the speed increase to make it a tiny bit easier, I got 53 this time for my score. 
Enjoy the game!

Well, I just tested it and it messed up at midnight, so please use my last post instead, sorry about that. 

(Code Deleted)
Reply
#9
Just added timer to my Tesla Breath session app. For midnight problem I did this:

If started## > Timer Then started## = started## - 86400 ' midnight problem fix

started## is the Timer when you started timing.
b = b + ...
Reply
#10
Awesome!

Here is the game with the Timer midnight fix problem solved. Thanks @bplus !

Code: (Select All)

Screen _NewImage(800, 600, 32)
begin:
score = 0
speed = 0
buttonx = 370
buttony = 300
text$ = "Click"
_Title "Click The Button Game by SierraKen"

c = 10
For bb = 0 To 30
    c = c + 10
    Line (buttonx + bb, buttony + bb)-(buttonx2 - bb, buttony2 - bb), _RGB32(100 + c, 100 + c, 100 + c), B
Next bb
Color _RGB32(0, 0, 0)
_PrintString (buttonx + 32, buttony + 17), text$

dir = 1
t = Timer
Do

    _Limit 300 + speed
    buttonx2 = buttonx + 100
    buttony2 = buttony + 50

    If t > Timer Then t = t - 86400 'Thank you Bplus for this Timer Midnight Fix Problem!


    ti = Timer - t

    c = 10
    For bb = 0 To 30
        c = c + 10
        Line (buttonx + bb, buttony + bb)-(buttonx2 - bb, buttony2 - bb), _RGB32(100 + c, 100 + c, 100 + c), B
    Next bb
    Color _RGB32(0, 0, 0), _RGB32(255, 255, 255)
    _PrintString (buttonx + 32, buttony + 17), text$
    Color _RGB32(255, 255, 255), _RGB32(0, 0, 0)
    Locate 1, 1: Print "Score: "; score
    Locate 2, 1: Print "Time Left: "; Int(120 - ti)
    If Int(120 - ti) < 1 Then
        Locate 20, 50
        Print "The End"
        Locate 24, 50
        Input "Again (Y/N)"; ag$
        If Left$(ag$, 1) = "y" Or Left$(ag$, 1) = "Y" Then GoTo begin:
        End
    End If
    While _MouseInput: Wend
    mousex = _MouseX
    mousey = _MouseY
    mouseLeftButton = _MouseButton(1)

    If mouseLeftButton Then
        Clear_MB 1
        If mousex > buttonx And mousex < buttonx2 And mousey > buttony And mousey < buttony2 Then

            c = 110
            _AutoDisplay
            For bb = 0 To 30
                c = c - 10
                Line (buttonx + bb, buttony + bb)-(buttonx2 - bb, buttony2 - bb), _RGB32(100 + c, 100 + c, 100 + c), B
            Next bb
            _Delay .1

            For bb = 0 To 30
                c = c + 10
                Line (buttonx + bb, buttony + bb)-(buttonx2 - bb, buttony2 - bb), _RGB32(100 + c, 100 + c, 100 + c), B
            Next bb
            _Delay .05

            c = 10
            For bb = 0 To 30
                c = c + 10
                Line (buttonx + bb, buttony + bb)-(buttonx2 - bb, buttony2 - bb), _RGB32(100 + c, 100 + c, 100 + c), B
            Next bb

            _Delay .1
            Color _RGB32(0, 0, 0), _RGB32(255, 255, 255)
            _PrintString (buttonx + 32, buttony + 17), text$
            Sound 900, 1, , , 6
            score = score + 1
            Color _RGB32(255, 255, 255), _RGB32(0, 0, 0)
            Locate 1, 1: Print "Score: "; score
            buttonx = Int(Rnd * 650) + 49
            buttony = Int(Rnd * 500) + 19
            speed = speed + 2
            If speed > 1000 Then speed = 1000
        End If
    End If

    changedir = Int(Rnd * 100) + 1
    If changedir > 95 Then
        dir = Int(Rnd * 8) + 1
    End If
    If dir = 1 Then buttony = buttony + 1
    If dir = 2 Then buttony = buttony - 1
    If dir = 3 Then buttonx = buttonx + 1
    If dir = 4 Then buttonx = buttonx - 1

    If dir = 5 Then buttony = buttony + 1: buttonx = buttonx + 1
    If dir = 6 Then buttony = buttony - 1: buttonx = buttonx - 1
    If dir = 7 Then buttonx = buttonx + 1: buttony = buttony + 1
    If dir = 8 Then buttonx = buttonx - 1: buttony = buttony - 1

    If buttonx > 700 And dir = 3 Then dir = 4
    If buttonx > 700 And dir = 7 Then dir = 8
    If buttonx < 50 And dir = 4 Then dir = 3
    If buttonx < 50 And dir = 8 Then dir = 7

    If buttony > 520 And dir = 1 Then dir = 2
    If buttony > 520 And dir = 5 Then dir = 6
    If buttony < 50 And dir = 2 Then dir = 1
    If buttony < 50 And dir = 8 Then dir = 7
    _Display
    Cls , _RGB32(0, 0, 0)


Loop Until InKey$ = Chr$(27)


Sub Clear_MB (var As Integer)

    Do Until Not _MouseButton(var)
        While _MouseInput: Wend
    Loop

End Sub 'Clear_MB
Reply




Users browsing this thread: 2 Guest(s)