PRo-Beaniie
Well-known member
- Joined
- Mar 17, 2011
- Messages
- 55
- Programming Experience
- 3-5
Hey Guys,
Im still fairly new to VB and i have a problem with a msgbox loop in my form it bugging me as i was in college earlier trying to figure it out my friend had the same problem too but he managed to fix his loop .... i however was not so fortunate... its probably a stupid mistake somwhere but mabye you guys could help me spot it ... this is were i think the error lies...
Im still fairly new to VB and i have a problem with a msgbox loop in my form it bugging me as i was in college earlier trying to figure it out my friend had the same problem too but he managed to fix his loop .... i however was not so fortunate... its probably a stupid mistake somwhere but mabye you guys could help me spot it ... this is were i think the error lies...
VB.NET:
Private Sub CheckHit()
For Me.x = 1 To NumOfEnemy
'Timer Main Collision Code ...
If (Missile.Top + Missile.Height >= Enemy(x).Top) And (Missile.Top <= Enemy(x).Top + Enemy(x).Height) And (Missile.Left + Missile.Width >= Enemy(x).Left) And (Missile.Left <= Enemy(x).Left + Enemy(x).Width) And Enemy(x).Visible = True Then
Enemy(x).Visible = False
Enemy(x).Left = -100
Missile.Visible = False
ShotDown += 1
Missile.Top = -100
ScoreBoard.Text = ScoreBoard.Text + 25
Enemy(x).Visible = True
EnemySpeed = EnemySpeed + 0.5
End If
Next
'ScoreBoard Variables ...
If ScoreBoard.Text = 100 Then
TimerMain.Enabled = False
GameTimer.Enabled = False
MsgBox(" Nice One you kicked thier ass! ")
End If
End Sub
Last edited: