- #1
Marghk
- 20
- 0
Just have to get a picture box to move around a screen, I'm running the program by a timer. I'll show set integers below.
Timer = Timer1
Picture Box = Robot
Dim Robotpace as integer
Basically, when you click on the start button it enables the timer. Here's the coding.
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
RobotPace = 8
Robot.Left -= RobotPace
If Robot.Left <= 1 Then
Robot.Left = False
Robot.Top -= RobotPace
If Robot.Top <= 1 Then
Robot.Top = False
+ Robot.Left += RobotPace
+ If Robot.Left <= 1 Then
+ Robot.Left = False
End If
End If
End Sub
The lines with the (+'s) at the start of them are the beginning of the error. At this point, I'm aware that the timer mistakes the + and - statements in the Robot.Left movements and it completely glitches.
I just can't fix this.
Timer = Timer1
Picture Box = Robot
Dim Robotpace as integer
Basically, when you click on the start button it enables the timer. Here's the coding.
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
RobotPace = 8
Robot.Left -= RobotPace
If Robot.Left <= 1 Then
Robot.Left = False
Robot.Top -= RobotPace
If Robot.Top <= 1 Then
Robot.Top = False
+ Robot.Left += RobotPace
+ If Robot.Left <= 1 Then
+ Robot.Left = False
End If
End If
End Sub
The lines with the (+'s) at the start of them are the beginning of the error. At this point, I'm aware that the timer mistakes the + and - statements in the Robot.Left movements and it completely glitches.
I just can't fix this.