- Home
·
- Games
·
- How move picture or object using the timer Como mover um objeto usando timer
How move picture or object using the timer Como mover um objeto usando timer
How move picture or object using the timer Como mover um objeto usando timer
API Declarations
Dim lef As Boolean
Dim rig As Boolean
Rate How move picture or object using the timer Como mover um objeto usando timer
(1(1 Vote))
lef = False
rig = False
picture1.TabIndex = 0 'important
End Sub
Private Sub PadMover_Timer()
If lef = True Then picture1.Left = picture1.Left - 400 'move left
If rig = True Then picture1.Left = picture1.Left + 400 'move right
End Sub
Private Sub picture1_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case vbKeyLeft
lef = True
Case vbKeyRight
rig = True
End Select
End Sub
' esse codigo retorna false , quando voçê solta a tecla
' this codigo return false when you unfasten the key
Private Sub picture1_KeyUp(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case vbKeyLeft
lef = False
Case vbKeyRight
rig = False
End Select
End Sub
How move picture or object using the timer Como mover um objeto usando timer Comments
No comments yet — be the first to post one!
Post a Comment