Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Click The Button Game
#11
A very simple game concept. Nicely implemented, Ken.

I have arrived at a disturbing conclusion... Either my "game playing" skills are quite feeble or that "button" of yours is demon-possessed.... Moo Ha Ha Ha....

Big Grin
May your journey be free of incident. Live long and prosper.
Reply
#12
Thanks, it is hard for me too, so I made it slower. Here you go: 

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 100 + 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 + 1
            If speed > 500 Then speed = 500
        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
#13
Thank you... I think... With my luck, even if the button was stationary, I would probably still loose... lol

I would probably recommend that, for those that enjoy the challenge, use the previous version... lol

Thank you for sharing.

J
May your journey be free of incident. Live long and prosper.
Reply
#14
LOL well, it does speed up during the game. Smile
Reply
#15
Cool game! You should make a second, faster floating button that floats in the front of the first one. When people accidentally click it they'll lose 2 points instead of gaining 1.
Reply
#16
I got an 86. Is that good? Fun stuff.
Reply
#17
I cheated! Just hold the mouse button down to stop the button dead in its tracks then hover, click, and depress to do the same with the next button. It's like shooting Clippy in a barrel. Hey, I like fish!

Pete Big Grin
Shoot first and shoot people who ask questions, later.
Reply




Users browsing this thread: 1 Guest(s)