Hi guys,
I've written a game that has traffic moving across a road. The game has different levels, each one getting a bit faster, but as the game gets faster the images start to overlap each other.
This is the code I've used to move the traffic:
How do I stop the overlapping?Code:'Move Traffic on the Road For l = 0 To NumOfCars - 1 imgCar(l).Left = imgCar(l).Left + CarSpeed(l) If imgCar(l).Left > frmMain.ScaleWidth + (50) Then imgCar(l).Left = 0 - imgCar(l).Width: GoTo 200 If imgCar(l).Left < (0 - imgCar(l).Width - (50)) Then imgCar(l).Left = frmMain.ScaleWidth 200: Next l




Reply With Quote