prePic(2).SendToBack()
End If
CType(sender, MotionPic).Init(MPBoxes(intFlag). _
MPIndex)
MPBoxes(intFlag).Destroy()
While MPBoxes(intFlag).MPState = _
BallState.DESTROYING_BALL
Application.DoEvents()
End While
If CalWin(posMoveTo) = 0 Then
If GiveThreeBalls() = False Then
playerScore = DDScore.number
Dim frm As Form2 = New Form2
frm.AddPlayer() = _
New Player(playerName, playerScore)
frm.Show()
frm.PlashScreen()
frm.drawTable()
ResetBoard()
End If
End If
PreShow()
intFlag = -1
Else
MPBoxes(intFlag).Tag = tempS
End If
ResetAllTag()
End If
End Sub
Private Sub ResetBoard()
ThreeBI(0) = -1
tmr1.Enabled = False
tmr2.Enabled = False
playerScore = 0
playerTime = 0
DDScore.number = 0
DDTime.number = 0
Me.Refresh()
PreShow()
lblNameShow.Text = ""
picBallPre1.Image = Nothing
For i As Integer = 0 To 80
MPBoxes(i).Reset()
Next
End Sub
Private Sub DrawBoard(ByVal sender As Object, _
ByVal e As System.Windows.Forms.PaintEventArgs) _
Handles MyBase.Paint
Dim g As Graphics = e.Graphics
'Рисуем сетку линиями красного (Red) цвета:
Dim p1 As New Pen(Color.Red)
Dim p2 As New Pen(Color.Black)
For i As Integer = 0 To 9
g.DrawLine(p1, intBaseX + 45 * i – 4, intBaseY – 5, _
intBaseX + 45 * i – 4, intBaseY + 45 * 9 – 5)
g.DrawLine(p2, intBaseX + 45 * i – 3, intBaseY – 4, _
intBaseX + 45 * i – 3, intBaseY + 45 * 9 – 4)
g.DrawLine(p1, intBaseX – 4, intBaseY + 45 * i – 5, _
intBaseX + 45 * 9 – 4, intBaseY + 45 * i – 5)
g.DrawLine(p2, intBaseX – 3, intBaseY + 45 * i – 4, _
intBaseX + 45 * 9 – 3, intBaseY + 45 * i – 4)
Next
End Sub
Private Sub LabelScore_Paint(ByVal sender As System.Object, _
ByVal e As System.Windows.Forms.PaintEventArgs)
DDScore.showNumber(e.Graphics)
End Sub
Private Sub LabelTime_Paint(ByVal sender As System.Object, _
ByVal e As System.Windows.Forms.PaintEventArgs)
DDTime.showTime(e.Graphics)
End Sub
Private Sub tmr1_Tick(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles tmr1.Tick
Dim s As String = lblNameShow.Text
lblNameShow.Text = s.Substring(1) + s.Substring(0, 1)
End Sub
'Счётчик секунд, который обнуляем в начале каждой игры
'в методе NewGame:
Dim secondCounter As Integer
'Время, через которое звучит мелодия
'возможного окончания игры:
Dim EndGameTime As Integer = 60
Private Sub tmr2_Tick(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles tmr2.Tick
DDTime.number += 1
lblTime.Refresh()
'Счётчик секунд:
secondCounter = secondCounter + 1
'Мелодия окончания игры:
If secondCounter = EndGameTime Then
My.Computer.Audio.Play("..\..\Sounds\win.wav", _
AudioPlayMode.Background)
End If
End Sub
'#Region "Preview Balls"
Private Sub PreShow()
Dim col, row As Integer
For i As Integer = 0 To 2
If ThreeBI(i) = -1 Then
prePic(i).Visible = False
Else
СКАЧАТЬ