📄 form1.frm
字号:
Height = 135
Left = 5400
Top = 600
Width = 255
End
Begin VB.Shape Shape1
BackStyle = 1 'Opaque
Height = 5055
Left = 5280
Top = 480
Width = 495
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public ValX As Integer
Public ValY As Integer
Public down As Boolean
Public vtop As Integer
Public vleft As Integer
Public Premier As Boolean
Public Player As Byte
Public Deuxieme As Boolean
Public Coup As Integer
Public Turn As Integer
Private Sub Command1_Click()
Dim tmp3 As Variant
If Deuxieme = True Then
Deuxieme = False
wav.Stop
wav.filename = App.Path & "\dingding.wav"
wav.Play
If Bar2.Left > 2760 And Bar1.Top < 2760 Then
Call Pts1
End If
If Bar2.Left > 2760 And Bar1.Top >= 2760 Then
Call Pts2
End If
If Bar2.Left <= 2760 And Bar1.Top >= 2760 Then
Call Pts3
End If
If Bar2.Left <= 2760 And Bar1.Top < 2760 Then
Call Pts4
End If
If Coup Mod 3 = 1 Then Form1.bitblttarget.Refresh
Call BitBltTarget_MouseMove(0, 0, (Bar2.Left - 680) / Screen.TwipsPerPixelY, (Bar1.Top - 680) / Screen.TwipsPerPixelX)
Coup = Coup + 1
If Coup Mod 3 = 1 Then
If Fleche = 0 Then
Fleche = 1
Else
Fleche = 0
Turn = Turn + 1
lblTurn.Caption = "Turn " & Turn
End If
If Fleche = 0 Then
Player = 1
lblPlayer.Caption = "PLAYER 1"
Else
Player = 2
lblPlayer.Caption = "PLAYER 2"
End If
End If
Exit Sub
End If
If Premier = True And Deuxieme = False Then
Premier = False
Deuxieme = True
End If
If Premier = False And Deuxieme = False Then Premier = True
End Sub
Private Sub Command2_Click()
Score(1) = 501
Score(2) = 501
Command3.Visible = False
Command2.Visible = False
cmdCriquet.Visible = False
Label1.Visible = False
Command1.Enabled = True
Label2.Visible = True
Label3.Visible = True
Score(2).Visible = True
Score(1).Visible = True
End Sub
Private Sub Command3_Click()
Score(1) = 301
Score(2) = 301
Command3.Visible = False
Command2.Visible = False
cmdCriquet.Visible = False
Label1.Visible = False
Command1.Enabled = True
Label2.Visible = True
Label3.Visible = True
Score(2).Visible = True
Score(1).Visible = True
End Sub
Private Sub Form_Load()
Coup = 1
Fleche = 0
Premier = False
vtop = 10
vleft = 10
Turn = 1
Deuxieme = False
Player = 1
End Sub
Private Sub Label2_Click()
If Label2.ForeColor = &H80000012 Then
Label2.ForeColor = &HFF&
Else: Label2.ForeColor = &H80000012
End If
End Sub
Private Sub Label3_Click()
If Label3.ForeColor = &H80000012 Then
Label3.ForeColor = &HFF&
Else: Label3.ForeColor = &H80000012
End If
End Sub
Private Sub Label4_Click()
If Label4.ForeColor = &H80000012 Then
Label4.ForeColor = &HFF&
Else: Label4.ForeColor = &H80000012
End If
End Sub
Private Sub Label5_Click()
If Label5.ForeColor = &H80000012 Then
Label5.ForeColor = &HFF&
Else: Label5.ForeColor = &H80000012
End If
End Sub
Private Sub Timer1_Timer()
If Premier = True Then
If Bar1.Top >= Shape1.Height - 100 Then
down = True
Else
If Bar1.Top <= Shape1.Top + 250 Then
down = False
End If
End If
If down = True Then
Bar1.Top = Bar1.Top - 150
Else: Bar1.Top = Bar1.Top + 150
End If
Else
If Deuxieme = True Then
If Bar2.Left <= Shape2.Left + 300 Then
down = True
Else
If Bar2.Left >= Shape2.Width Then
down = False
End If
End If
If down = True Then
Bar2.Left = Bar2.Left + 150
Else: Bar2.Left = Bar2.Left - 150
End If
End If
End If
End Sub
Public Sub Pts1()
tmp = (Bar2.Left) - 2760
tmp2 = 2760 - ((Bar1.Top))
tmp3 = Sqr((tmp ^ 2) + (tmp2 ^ 2))
If tmp < tmp2 Then
If (ASin(tmp / tmp3)) <= 9 Then TmpPts = 20
If (ASin(tmp / tmp3)) > 9 And (ASin(tmp / tmp3)) <= 27 Then TmpPts = 1
If (ASin(tmp / tmp3)) > 27 And (ASin(tmp / tmp3)) <= 45 Then TmpPts = 18
If (ASin(tmp / tmp3)) > 45 And (ASin(tmp / tmp3)) <= 63 Then TmpPts = 4
If (ASin(tmp / tmp3)) > 63 And (ASin(tmp / tmp3)) <= 81 Then TmpPts = 13
If (ASin(tmp / tmp3)) > 81 And (ASin(tmp / tmp3)) <= 99 Then TmpPts = 6
'MsgBox tmp & " " & tmp2 & " " & tmp3 & " - " & (ASin(tmp / tmp3))
Else
'MsgBox tmp & " " & tmp2 & " " & tmp3 & " - " & 90 - (ASin(tmp2 / tmp3))
If 90 - (ASin(tmp2 / tmp3)) > 0 And 90 - (ASin(tmp2 / tmp3)) <= 9 Then TmpPts = 20
If 90 - (ASin(tmp2 / tmp3)) > 9 And 90 - (ASin(tmp2 / tmp3)) <= 27 Then TmpPts = 1
If 90 - (ASin(tmp2 / tmp3)) > 27 And 90 - (ASin(tmp2 / tmp3)) <= 45 Then TmpPts = 18
If 90 - (ASin(tmp2 / tmp3)) > 45 And 90 - (ASin(tmp2 / tmp3)) <= 63 Then TmpPts = 4
If 90 - (ASin(tmp2 / tmp3)) > 63 And 90 - (ASin(tmp2 / tmp3)) <= 81 Then TmpPts = 13
If 90 - (ASin(tmp2 / tmp3)) > 81 And 90 - (ASin(tmp2 / tmp3)) <= 99 Then TmpPts = 6
End If
If tmp3 > 1956 Then Exit Sub
If tmp3 <= 1956 And tmp3 >= 1810 Then
Call Pts(TmpPts * 2)
Exit Sub
End If
If tmp3 <= 1340 And tmp3 >= 1205 Then
Pts (TmpPts * 3)
Exit Sub
End If
Pts (TmpPts)
End Sub
Public Sub Pts2()
tmp = (Bar2.Left) - 2760
tmp2 = ((Bar1.Top)) - 2760
tmp3 = Sqr((tmp ^ 2) + (tmp2 ^ 2))
If tmp < tmp2 Then
If (ASin(tmp / tmp3)) <= 9 Then TmpPts = 3
If (ASin(tmp / tmp3)) > 9 And (ASin(tmp / tmp3)) <= 27 Then TmpPts = 17
If (ASin(tmp / tmp3)) > 27 And (ASin(tmp / tmp3)) <= 45 Then TmpPts = 2
If (ASin(tmp / tmp3)) > 45 And (ASin(tmp / tmp3)) <= 63 Then TmpPts = 15
If (ASin(tmp / tmp3)) > 63 And (ASin(tmp / tmp3)) <= 81 Then TmpPts = 10
If (ASin(tmp / tmp3)) > 81 And (ASin(tmp / tmp3)) <= 99 Then TmpPts = 6
'MsgBox tmp & " " & tmp2 & " " & tmp3 & " - " & (ASin(tmp / tmp3))
Else
'MsgBox tmp & " " & tmp2 & " " & tmp3 & " - " & 90 - (ASin(tmp2 / tmp3))
If 90 - (ASin(tmp2 / tmp3)) > 0 And 90 - (ASin(tmp2 / tmp3)) <= 9 Then TmpPts = 3
If 90 - (ASin(tmp2 / tmp3)) > 9 And 90 - (ASin(tmp2 / tmp3)) <= 27 Then TmpPts = 17
If 90 - (ASin(tmp2 / tmp3)) > 27 And 90 - (ASin(tmp2 / tmp3)) <= 45 Then TmpPts = 2
If 90 - (ASin(tmp2 / tmp3)) > 45 And 90 - (ASin(tmp2 / tmp3)) <= 63 Then TmpPts = 15
If 90 - (ASin(tmp2 / tmp3)) > 63 And 90 - (ASin(tmp2 / tmp3)) <= 81 Then TmpPts = 10
If 90 - (ASin(tmp2 / tmp3)) > 81 And 90 - (ASin(tmp2 / tmp3)) <= 99 Then TmpPts = 6
End If
If tmp3 > 1956 Then Exit Sub
If tmp3 <= 1956 And tmp3 >= 1810 Then
Call Pts(TmpPts * 2)
Exit Sub
End If
If tmp3 <= 1340 And tmp3 >= 1205 Then
Pts (TmpPts * 3)
Exit Sub
End If
Pts (TmpPts)
End Sub
Public Sub Pts3()
tmp = 2760 - (Bar2.Left)
tmp2 = ((Bar1.Top)) - 2760
tmp3 = Sqr((tmp ^ 2) + (tmp2 ^ 2))
If tmp < tmp2 Then
If (ASin(tmp / tmp3)) <= 9 Then TmpPts = 3
If (ASin(tmp / tmp3)) > 9 And (ASin(tmp / tmp3)) <= 27 Then TmpPts = 19
If (ASin(tmp / tmp3)) > 27 And (ASin(tmp / tmp3)) <= 45 Then TmpPts = 7
If (ASin(tmp / tmp3)) > 45 And (ASin(tmp / tmp3)) <= 63 Then TmpPts = 16
If (ASin(tmp / tmp3)) > 63 And (ASin(tmp / tmp3)) <= 81 Then TmpPts = 8
If (ASin(tmp / tmp3)) > 81 And (ASin(tmp / tmp3)) <= 99 Then TmpPts = 11
'MsgBox tmp & " " & tmp2 & " " & tmp3 & " - " & (ASin(tmp / tmp3))
Else
'MsgBox tmp & " " & tmp2 & " " & tmp3 & " - " & 90 - (ASin(tmp2 / tmp3))
If 90 - (ASin(tmp2 / tmp3)) > 0 And 90 - (ASin(tmp2 / tmp3)) <= 9 Then TmpPts = 3
If 90 - (ASin(tmp2 / tmp3)) > 9 And 90 - (ASin(tmp2 / tmp3)) <= 27 Then TmpPts = 19
If 90 - (ASin(tmp2 / tmp3)) > 27 And 90 - (ASin(tmp2 / tmp3)) <= 45 Then TmpPts = 7
If 90 - (ASin(tmp2 / tmp3)) > 45 And 90 - (ASin(tmp2 / tmp3)) <= 63 Then TmpPts = 16
If 90 - (ASin(tmp2 / tmp3)) > 63 And 90 - (ASin(tmp2 / tmp3)) <= 81 Then TmpPts = 8
If 90 - (ASin(tmp2 / tmp3)) > 81 And 90 - (ASin(tmp2 / tmp3)) <= 99 Then TmpPts = 11
End If
If tmp3 > 1956 Then Exit Sub
If tmp3 <= 1956 And tmp3 >= 1810 Then
Call Pts(TmpPts * 2)
Exit Sub
End If
If tmp3 <= 1340 And tmp3 >= 1205 Then
Pts (TmpPts * 3)
Exit Sub
End If
Pts (TmpPts)
End Sub
Public Sub Pts4()
Dim TmpPts As Integer
tmp = 2760 - (Bar2.Left)
tmp2 = 2760 - ((Bar1.Top))
tmp3 = Sqr((tmp ^ 2) + (tmp2 ^ 2))
If tmp < tmp2 Then
If (ASin(tmp / tmp3)) <= 9 Then TmpPts = 20
If (ASin(tmp / tmp3)) > 9 And (ASin(tmp / tmp3)) <= 27 Then TmpPts = 5
If (ASin(tmp / tmp3)) > 27 And (ASin(tmp / tmp3)) <= 45 Then TmpPts = 12
If (ASin(tmp / tmp3)) > 45 And (ASin(tmp / tmp3)) <= 63 Then TmpPts = 9
If (ASin(tmp / tmp3)) > 63 And (ASin(tmp / tmp3)) <= 81 Then TmpPts = 14
If (ASin(tmp / tmp3)) > 81 And (ASin(tmp / tmp3)) <= 99 Then TmpPts = 11
Else
If 90 - (ASin(tmp2 / tmp3)) > 0 And 90 - (ASin(tmp2 / tmp3)) <= 9 Then TmpPts = 20
If 90 - (ASin(tmp2 / tmp3)) > 9 And 90 - (ASin(tmp2 / tmp3)) <= 27 Then TmpPts = 5
If 90 - (ASin(tmp2 / tmp3)) > 27 And 90 - (ASin(tmp2 / tmp3)) <= 45 Then TmpPts = 12
If 90 - (ASin(tmp2 / tmp3)) > 45 And 90 - (ASin(tmp2 / tmp3)) <= 63 Then TmpPts = 9
If 90 - (ASin(tmp2 / tmp3)) > 63 And 90 - (ASin(tmp2 / tmp3)) <= 81 Then TmpPts = 14
If 90 - (ASin(tmp2 / tmp3)) > 81 And 90 - (ASin(tmp2 / tmp3)) <= 99 Then TmpPts = 11
End If
If tmp3 > 1956 Then Exit Sub
If tmp3 <= 1956 And tmp3 >= 1810 Then
Call Pts(TmpPts * 2)
Exit Sub
End If
If tmp3 <= 1340 And tmp3 >= 1205 Then
Pts (TmpPts * 3)
Exit Sub
End If
Pts (TmpPts)
End Sub
Public Sub Pts(Points As Integer)
If Val(Score(Player).Caption) - Points >= 0 Then
Score(Player).Caption = Val(Score(Player).Caption) - Points
End If
If Score(Player).Caption = 0 Then
wav.Stop
wav.filename = App.Path & "\appl1.wav"
wav.Play
Command1.Enabled = False
lblWin = "Player " & Player & " WIN!!!!"
Command2.Visible = True
Command3.Visible = True
cmdCriquet.Visible = True
Label1.Visible = True
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -