Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21096

Similar repeating code and testing tools

$
0
0
PicBlackSquareDown1.Top = PicBlackSquareDown1.Top + speed
If PicBlackSquareDown1.Location.Y > 800 Then
PicBlackSquareDown1.Top = rnd.Next(-4000, 0)
End If
If PicBlackSquareDown1.Bounds.IntersectsWit... Then
PicBlackSquareDown1.Top = rnd.Next(-4000, 0)
score += 1
lblScore.Text = "Score: " & score
End If

PicBlackSquareDown2.Top = PicBlackSquareDown2.Top + speed
If PicBlackSquareDown2.Location.Y > 800 Then
PicBlackSquareDown2.Top = rnd.Next(-4000, 0)
End If
If PicBlackSquareDown2.Bounds.IntersectsWit... Then
PicBlackSquareDown2.Top = rnd.Next(-4000, 0)
score += 1
lblScore.Text = "Score: " & score
End If

See, it is basically the same code, how do I code it down as this goes on for all my assets, 60+?

Also what testing tools are there in VB? I have used Debug, what else can I test my application on?

Viewing all articles
Browse latest Browse all 21096

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>