Public Class Form1
Dim mouthIsOpen As Boolean = False
Dim cD As Integer = 4
Dim obstInt As Integer = 0
Dim moveright As Boolean = True
Dim moveup As Boolean = True
Dim i As Integer = 0
Dim touchedTop As Boolean = False
Dim touchedRight As Boolean = False
Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick
If mouthIsOpen = False Then
PictureBox1.Image = My.Resources.closed
mouthIsOpen = True
ElseIf mouthIsOpen = True Then
If cD = 1 Then
PictureBox1.Image = My.Resources.openleft
ElseIf cD = 2 Then
PictureBox1.Image = My.Resources.openright
ElseIf cD = 3 Then
PictureBox1.Image = My.Resources.opendown
ElseIf cD = 4 Then
PictureBox1.Image = My.Resources.openup
End If
mouthIsOpen = False
My.Computer.Audio.Play("C:\Users\Kade\Desktop\wakawaka.wav")
End If
End Sub
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
Timer1.Start()
TimerU.Start()
TimerObst.Start()
End Sub
Private Sub Form1_KeyDown(sender As System.Object, e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
If e.KeyCode = 65 Then
TimerL.Start()
TimerR.Stop()
TimerD.Stop()
TimerU.Stop()
cD = 1
ElseIf e.KeyCode = 68 Then
TimerR.Start()
TimerL.Stop()
TimerD.Stop()
TimerU.Stop()
cD = 2
ElseIf e.KeyCode = 83 Then
TimerD.Start()
TimerL.Stop()
TimerR.Stop()
TimerU.Stop()
cD = 3
ElseIf e.KeyCode = 87 Then
TimerU.Start()
TimerL.Stop()
TimerR.Stop()
TimerD.Stop()
cD = 4
ElseIf e.KeyCode = 96 Then
End If
End Sub
Private Sub TimerL_Tick(sender As System.Object, e As System.EventArgs) Handles TimerL.Tick
PictureBox1.Left = PictureBox1.Left - 2
End Sub
Private Sub TimerR_Tick(sender As System.Object, e As System.EventArgs) Handles TimerR.Tick
PictureBox1.Left = PictureBox1.Left + 2
End Sub
Private Sub TimerD_Tick(sender As System.Object, e As System.EventArgs) Handles TimerD.Tick
PictureBox1.Top = PictureBox1.Top + 2
End Sub
Private Sub TimerU_Tick(sender As System.Object, e As System.EventArgs) Handles TimerU.Tick
PictureBox1.Top = PictureBox1.Top - 2
End Sub
Private Sub TimerObst_Tick(sender As System.Object, e As System.EventArgs) Handles TimerObst.Tick
If moveright = True Then
Panel1.Left += 7
Panel2.Left += 7
Panel3.Left += 7
Panel4.Left += 7
Else
Panel1.Left -= 7
Panel2.Left -= 7
Panel3.Left -= 7
Panel4.Left -= 7
End If
If moveup = True Then
Panel5.Top += 7
Panel6.Top += 7
Panel7.Top += 7
Else
Panel5.Top -= 7
Panel6.Top -= 7
Panel7.Top -= 7
End If
If Panel4.Left <= Me.ClientRectangle.Left Then
moveright = True
End If
If Panel4.Left + Panel4.Width >= Me.ClientRectangle.Right Then
moveright = False
End If
If Panel5.Top <= Me.ClientRectangle.Top Then
moveup = True
End If
If Panel5.Top + Panel5.Height >= Me.ClientRectangle.Bottom Then
moveup = False
End If
End Sub
Private Sub TimerCount_Tick(sender As System.Object, e As System.EventArgs) Handles TimerCount.Tick
i = i + 1
Label2.Text = "Time Alive: " & i & " seconds"
End Sub
Private Sub TimerCheck_Tick(sender As System.Object, e As System.EventArgs) Handles TimerCheck.Tick
If PictureBox1.Left <= Me.ClientRectangle.Left Then
touchedRight = True
End If
If PictureBox1.Left + PictureBox1.Width >= Me.ClientRectangle.Right Then
touchedRight = True
End If
If PictureBox1.Top <= Me.ClientRectangle.Top Then
touchedTop = True
End If
If PictureBox1.Top + PictureBox1.Height >= Me.ClientRectangle.Bottom Then
touchedTop = True
End If
If touchedRight = True Then
Timer1.Stop()
TimerL.Stop()
TimerR.Stop()
TimerD.Stop()
TimerU.Stop()
TimerCount.Stop()
TimerObst.Stop()
TimerCheck.Stop()
MessageBox.Show("Congratulations, dev, you stayed alive for " & i & " seconds!")
Me.Close()
ElseIf touchedTop = True Then
Timer1.Stop()
TimerL.Stop()
TimerR.Stop()
TimerD.Stop()
TimerU.Stop()
TimerCount.Stop()
TimerObst.Stop()
TimerCheck.Stop()
MessageBox.Show("Congratulations, dev, you stayed alive for " & i & " seconds!")
Me.Close()
End If
End Sub
End Class
However, I have no idea where to start with the high scores table. Any help is appreciated, thanks!

New Topic/Question
Reply



MultiQuote





|