More comments for every line:
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
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 + ...