Guest User

Untitled

a guest
May 20th, 2018
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. Public Class Form1
  2. Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click
  3. If btnStart.Text = "Start" Then
  4. Timer1.Enabled = True
  5. btnStart.Text = "Koniec"
  6. Else
  7.  
  8. btnStart.Text = "Start"
  9. Timer1.Enabled = False
  10. Timer2.Enabled = False
  11. samolot.Left = 43
  12. samolot.Top = 136
  13.  
  14. End If
  15. End Sub
  16.  
  17.  
  18. Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
  19. If samolot.Top < liniamiejsceladowania.Y2 - 15 And samolot.Left < liniamiejsceladowania.X2 _
  20. Then
  21.  
  22. samolot.Top = samolot.Top + 2
  23. samolot.Left = samolot.Left + 3
  24. Else
  25. Timer1.Enabled = False
  26. Timer2.Enabled = True
  27. End If
  28. End Sub
  29.  
  30. Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
  31. If samolot.Left < liniamiejscezatrzymania.X1 Then
  32. samolot.Left = samolot.Left + 2
  33. Else
  34. Timer2.Enabled = False
  35. End If
  36. End Sub
  37. End Class
Add Comment
Please, Sign In to add comment