Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[VSVB] Ping, Pong.

Custom Title Activated
Loyal Member
Joined
Jun 4, 2005
Messages
1,659
Reaction score
13
Hey RaGEZONE.

I'm new to Visual Basic for Visual Studio and the whole of Visual Basic itself.

At the moment I've got the follow for this 'picture' to bounce off the left side width and then head back. What i need it to do is to bounce of the right one, and continue this process. But it doesn't. When it goes to the right hand side, it just keeps on going through the side of the screen.

This is the code i have so far.

Code:
Public Class Form1
    Dim z As Integer
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Timer1.Enabled = True
        z = 4
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        PictureBox1.Left = PictureBox1.Left + z
        If PictureBox1.Left + PictureBox1.Width > Me.Width Then z = -z
    End Sub
End Class
 
Back
Top