clare
01-04-2005, 04:43 AM
hey
im clare and i am new at vb.net
i have written a shooting game where u hit a black and yellow bee (its for a uni course for children) as u can see from the coding below i have got the bees flying round but do not know how get a final score.
Please help.... thanks
'back to the main page'
Private Sub LinkLabel3_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel3.LinkClicked
Dim startInstance As New start
startInstance.Show()
Me.Hide()
End Sub
'start button'
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Enabled = True
Timer2.Enabled = True
hits = 0
display = 0
End Sub
'timer 1 bee'
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim objRand As New Random
Dim iRandom1 As Integer
Dim iRandom2 As Integer
iRandom1 = objRand.Next(8, 414)
iRandom2 = objRand.Next(16, 176)
PictureBox1.Left = iRandom1
PictureBox1.Top = iRandom2
display = display + 1
TextBox1.Text = display
End Sub
'Bee'
Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click
hits = hits + 1
TextBox2.Text = hits
End Sub
'timer 2 evil bee'
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
Dim objRand As New Random
Dim iRandom3 As Integer
Dim iRandom4 As Integer
iRandom3 = objRand.Next(28, 380)
iRandom4 = objRand.Next(28, 180)
PictureBox2.Left = iRandom3
PictureBox2.Top = iRandom4
End Sub
'evil bee'
Private Sub PictureBox2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
hits = hits + 1
TextBox2.Text = hits
End Sub
'easy level'
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim shootInstance As New shoot
shootInstance.Show()
Me.Hide()
End Sub
'medium level'
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim shoot1Instance As New shoot1
shoot1Instance.Show()
Me.Hide()
End Sub
'hard level'
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Dim shoot2Instance As New shoot2
shoot2Instance.Show()
Me.Hide()
End Sub
'end'
Private Sub LinkLabel2_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel2.LinkClicked
End
End Sub
End Class
im clare and i am new at vb.net
i have written a shooting game where u hit a black and yellow bee (its for a uni course for children) as u can see from the coding below i have got the bees flying round but do not know how get a final score.
Please help.... thanks
'back to the main page'
Private Sub LinkLabel3_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel3.LinkClicked
Dim startInstance As New start
startInstance.Show()
Me.Hide()
End Sub
'start button'
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Enabled = True
Timer2.Enabled = True
hits = 0
display = 0
End Sub
'timer 1 bee'
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim objRand As New Random
Dim iRandom1 As Integer
Dim iRandom2 As Integer
iRandom1 = objRand.Next(8, 414)
iRandom2 = objRand.Next(16, 176)
PictureBox1.Left = iRandom1
PictureBox1.Top = iRandom2
display = display + 1
TextBox1.Text = display
End Sub
'Bee'
Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click
hits = hits + 1
TextBox2.Text = hits
End Sub
'timer 2 evil bee'
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
Dim objRand As New Random
Dim iRandom3 As Integer
Dim iRandom4 As Integer
iRandom3 = objRand.Next(28, 380)
iRandom4 = objRand.Next(28, 180)
PictureBox2.Left = iRandom3
PictureBox2.Top = iRandom4
End Sub
'evil bee'
Private Sub PictureBox2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
hits = hits + 1
TextBox2.Text = hits
End Sub
'easy level'
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim shootInstance As New shoot
shootInstance.Show()
Me.Hide()
End Sub
'medium level'
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim shoot1Instance As New shoot1
shoot1Instance.Show()
Me.Hide()
End Sub
'hard level'
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Dim shoot2Instance As New shoot2
shoot2Instance.Show()
Me.Hide()
End Sub
'end'
Private Sub LinkLabel2_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel2.LinkClicked
End
End Sub
End Class