Ik heb een simpel spelletje gemaakt die figuurtjes bestuurd, maar goe kan ik nu programmeren dat als hij tegen de muur botst msgbox "Je bent dood" of zo iets
Option Explicit
Private Sub cmdboven_Click()
tmrlinks.Enabled = False
tmrboven.Enabled = True
tmronder.Enabled = False
tmrrechts.Enabled = False
End Sub
Private Sub cmdlinks_Click()
tmrlinks.Enabled = True
tmrboven.Enabled = False
tmronder.Enabled = False
tmrrechts.Enabled = False
End Sub
Private Sub cmdonder_Click()
tmrlinks.Enabled = False
tmrboven.Enabled = False
tmronder.Enabled = True
tmrrechts.Enabled = False
End Sub
Private Sub cmdrechts_Click()
tmrlinks.Enabled = False
tmrboven.Enabled = False
tmronder.Enabled = False
tmrrechts.Enabled = True
End Sub
Private Sub Form_Load()
tmrlinks.Enabled = False
tmrboven.Enabled = False
tmronder.Enabled = False
tmrrechts.Enabled = False
End Sub
Private Sub scrlsnelheid_Change()
Label1.Caption = scrlsnelheid.Value
End Sub
Private Sub tmrboven_Timer()
pctrfiets.Top = pctrfiets.Top - Label1.Caption * 5
End Sub
Private Sub tmrlinks_Timer()
pctrfiets.Left = pctrfiets.Left - Label1.Caption * 5
End Sub
Private Sub tmronder_Timer()
pctrfiets.Top = pctrfiets.Top + Label1.Caption * 5
End Sub
Private Sub tmrrechts_Timer()
pctrfiets.Left = pctrfiets.Left + Label1.Caption * 5
End Sub
Option Explicit
Private Sub cmdboven_Click()
tmrlinks.Enabled = False
tmrboven.Enabled = True
tmronder.Enabled = False
tmrrechts.Enabled = False
End Sub
Private Sub cmdlinks_Click()
tmrlinks.Enabled = True
tmrboven.Enabled = False
tmronder.Enabled = False
tmrrechts.Enabled = False
End Sub
Private Sub cmdonder_Click()
tmrlinks.Enabled = False
tmrboven.Enabled = False
tmronder.Enabled = True
tmrrechts.Enabled = False
End Sub
Private Sub cmdrechts_Click()
tmrlinks.Enabled = False
tmrboven.Enabled = False
tmronder.Enabled = False
tmrrechts.Enabled = True
End Sub
Private Sub Form_Load()
tmrlinks.Enabled = False
tmrboven.Enabled = False
tmronder.Enabled = False
tmrrechts.Enabled = False
End Sub
Private Sub scrlsnelheid_Change()
Label1.Caption = scrlsnelheid.Value
End Sub
Private Sub tmrboven_Timer()
pctrfiets.Top = pctrfiets.Top - Label1.Caption * 5
End Sub
Private Sub tmrlinks_Timer()
pctrfiets.Left = pctrfiets.Left - Label1.Caption * 5
End Sub
Private Sub tmronder_Timer()
pctrfiets.Top = pctrfiets.Top + Label1.Caption * 5
End Sub
Private Sub tmrrechts_Timer()
pctrfiets.Left = pctrfiets.Left + Label1.Caption * 5
End Sub