Mouse Help Needed
#7
More comments for every line:
Code: (Select All)
go:
_Display ' update screen !!! sure like to know if my turn or not after computer
fired = 0 ' signal the you fired is off
While _MouseInput: Wend
mx = _MouseX: my = _MouseY: mb = _MouseButton(1) ' this updates the mouse x, y and button status save to variable because they change
If mb Then ' do not do anything until mouse is clicked
    If mx >= 60 And my <= 260 Then ' is x in range of the boxes
        If my >= 40 And my < 70 Then ' y inside power
            vel = (mx - 60) / 200 * 100 ' converts place in box to 0 to 100

            Line (61, 41)-(259, 69), _RGB32(156, 210, 237), BF ' clear old line
            Line (61, 41)-(mx, 69), _RGB32(255, 0, 1), BF ' draw new

            'vel = Int(vel2)
            'vel$ = Str$(vel)
            'Line (61, 41)-(vel2, 69), _RGB32(255, 0, 1), BF
            Color _RGB32(0, 0, 0), _RGB32(255, 0, 0)
            _PrintString (265, 50), Str$(vel) ' show power as number
            _Display
            _Delay .25 'wait for release of mouse button
            GoTo go
        ElseIf my >= 70 And my < 100 Then ' y inside angle
            a = (mx - 60) / 200 * 90 ' converts place in box to 0 to 90
            'If a2 > 259 Then a2 = 259
            Line (61, 71)-(259, 99), _RGB32(156, 210, 237), BF ' clear old box
            Line (61, 71)-(mx, 99), _RGB32(0, 255, 1), BF ' draw in new angle
            'a = Int(a2 / 3)
            'aaa$ = Str$(a)
            'Line (61, 71)-(a2, 99), _RGB32(0, 255, 1), BF
            Color _RGB32(0, 0, 0), _RGB32(0, 255, 0)
            _PrintString (265, 80), Str$(a) ' show angle number
            _Display
            _Delay .25 'wait for release of mouse button
            GoTo go
        ElseIf my >= 100 And my < 130 Then ' y inside fire!
            fired = 1 ' you fired!
            _Delay .25 'wait for release of mouse button   <<<<<<< EDIT add this line
            GoTo going
        End If
    End If
End If
If fired = 0 Then GoTo go '  need?  yes try again


OH put a delay after fire too!

crap this dang editor!  insert this after fired = 1

_Delay .25  ' make sure we wait after a mouseclick to give time to user to release the button
_Delay .25 'wait for release of mouse button
b = b + ...
Reply


Messages In This Thread
Mouse Help Needed - by SierraKen - 05-02-2022, 01:30 AM
RE: Mouse Help Needed - by bplus - 05-02-2022, 01:56 AM
RE: Mouse Help Needed - by SierraKen - 05-02-2022, 02:03 AM
RE: Mouse Help Needed - by SierraKen - 05-02-2022, 02:11 AM
RE: Mouse Help Needed - by bplus - 05-02-2022, 02:48 AM
RE: Mouse Help Needed - by bplus - 05-02-2022, 03:54 AM
RE: Mouse Help Needed - by bplus - 05-02-2022, 04:03 AM
RE: Mouse Help Needed - by bplus - 05-02-2022, 04:22 AM
RE: Mouse Help Needed - by SierraKen - 05-02-2022, 04:26 AM
RE: Mouse Help Needed - by SierraKen - 05-02-2022, 04:25 AM
RE: Mouse Help Needed - by SierraKen - 05-02-2022, 04:30 AM
RE: Mouse Help Needed - by bplus - 05-02-2022, 04:32 AM
RE: Mouse Help Needed - by SierraKen - 05-02-2022, 04:33 AM
RE: Mouse Help Needed - by bplus - 05-02-2022, 04:37 AM
RE: Mouse Help Needed - by SierraKen - 05-02-2022, 04:52 AM
RE: Mouse Help Needed - by SierraKen - 05-02-2022, 05:09 AM
RE: Mouse Help Needed - by dcromley - 05-02-2022, 04:51 PM
RE: Mouse Help Needed - by bplus - 05-02-2022, 05:10 PM
RE: Mouse Help Needed - by OldMoses - 05-02-2022, 06:17 PM
RE: Mouse Help Needed - by bplus - 05-02-2022, 06:58 PM
RE: Mouse Help Needed - by OldMoses - 05-02-2022, 11:53 PM
RE: Mouse Help Needed - by SierraKen - 05-03-2022, 11:26 PM
RE: Mouse Help Needed - by SierraKen - 05-03-2022, 11:34 PM
RE: Mouse Help Needed - by OldMoses - 05-04-2022, 04:37 PM
RE: Mouse Help Needed - by bplus - 05-04-2022, 04:43 PM
RE: Mouse Help Needed - by OldMoses - 05-04-2022, 05:04 PM
RE: Mouse Help Needed - by bplus - 05-04-2022, 05:12 PM
RE: Mouse Help Needed - by OldMoses - 05-05-2022, 12:25 AM



Users browsing this thread: 2 Guest(s)