ahmadfononi
معاونت انجمن
Dim TD As Integer
Dim speed As Integer
Private Sub Command1_Click()
tmrArrow.Enabled = True
End Sub
Private Sub Form_Load()
TD = 1
speed = 50
End Sub
Private Sub Form_Resize()
sibl.Left = Form1.ScaleWidth - 200
arrow.Left = 100
arrow.Top = Form1.ScaleHeight \ 2
scrSibl.Max = Form1.ScaleWidth - 100
scrSibl.Value = scrSibl.Max
End Sub
Private Sub Option1_Click()
speed = 20
End Sub
Private Sub Option2_Click()
speed = 50
End Sub
Private Sub Option3_Click()
speed = 100
End Sub
Private Sub scrSibl_Change()
sibl.Left = scrSibl.Value
End Sub
Private Sub scrSibl_Scroll()
sibl.Left = scrSibl.Value
End Sub
Private Sub tmrArrow_Timer()
x = sibl.Height \ 5
arrow.Left = arrow.Left + 50
If arrow.Left + arrow.Width > sibl.Left And _
arrow.Left + arrow.Width < sibl.Left + sibl.Width Then
If arrow.Top > sibl.Top Then
If arrow.Top < sibl.Top + sibl.Height Then
'MsgBox "YOU WIN"
If arrow.Top > sibl.Top And arrow.Top < sibl.Top + x Then
score = 1
ElseIf arrow.Top > sibl.Top + x And arrow.Top < sibl.Top + 2 * x Then
score = 5
ElseIf arrow.Top > sibl.Top + 2 * x And arrow.Top < sibl.Top + 3 * x Then
score = 10
ElseIf arrow.Top > sibl.Top + 3 * x And arrow.Top < sibl.Top + 4 * x Then
score = 5
ElseIf arrow.Top > sibl.Top + 4 * x And arrow.Top < sibl.Top + 5 * x Then
score = 1
End If
MsgBox score
tmrArrow.Enabled = False
Call Form_Resize
End If
End If
End If
If arrow.Left > Form1.ScaleWidth Then
MsgBox "YOU LOSE!"
tmrArrow.Enabled = False
Call Form_Resize
End If
End Sub
Private Sub tmrSibl_Timer()
If TD = 1 And sibl.Top + sibl.Height < Form1.ScaleHeight Then
sibl.Top = sibl.Top + speed
Else
TD = 2
End If
If TD = 2 And sibl.Top > Form1.Top Then
sibl.Top = sibl.Top - speed
Else
TD = 1
End If
End Sub
Dim speed As Integer
Private Sub Command1_Click()
tmrArrow.Enabled = True
End Sub
Private Sub Form_Load()
TD = 1
speed = 50
End Sub
Private Sub Form_Resize()
sibl.Left = Form1.ScaleWidth - 200
arrow.Left = 100
arrow.Top = Form1.ScaleHeight \ 2
scrSibl.Max = Form1.ScaleWidth - 100
scrSibl.Value = scrSibl.Max
End Sub
Private Sub Option1_Click()
speed = 20
End Sub
Private Sub Option2_Click()
speed = 50
End Sub
Private Sub Option3_Click()
speed = 100
End Sub
Private Sub scrSibl_Change()
sibl.Left = scrSibl.Value
End Sub
Private Sub scrSibl_Scroll()
sibl.Left = scrSibl.Value
End Sub
Private Sub tmrArrow_Timer()
x = sibl.Height \ 5
arrow.Left = arrow.Left + 50
If arrow.Left + arrow.Width > sibl.Left And _
arrow.Left + arrow.Width < sibl.Left + sibl.Width Then
If arrow.Top > sibl.Top Then
If arrow.Top < sibl.Top + sibl.Height Then
'MsgBox "YOU WIN"
If arrow.Top > sibl.Top And arrow.Top < sibl.Top + x Then
score = 1
ElseIf arrow.Top > sibl.Top + x And arrow.Top < sibl.Top + 2 * x Then
score = 5
ElseIf arrow.Top > sibl.Top + 2 * x And arrow.Top < sibl.Top + 3 * x Then
score = 10
ElseIf arrow.Top > sibl.Top + 3 * x And arrow.Top < sibl.Top + 4 * x Then
score = 5
ElseIf arrow.Top > sibl.Top + 4 * x And arrow.Top < sibl.Top + 5 * x Then
score = 1
End If
MsgBox score
tmrArrow.Enabled = False
Call Form_Resize
End If
End If
End If
If arrow.Left > Form1.ScaleWidth Then
MsgBox "YOU LOSE!"
tmrArrow.Enabled = False
Call Form_Resize
End If
End Sub
Private Sub tmrSibl_Timer()
If TD = 1 And sibl.Top + sibl.Height < Form1.ScaleHeight Then
sibl.Top = sibl.Top + speed
Else
TD = 2
End If
If TD = 2 And sibl.Top > Form1.Top Then
sibl.Top = sibl.Top - speed
Else
TD = 1
End If
End Sub