Choppiness in animation using Timer.

If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
2 posts Page 1 of 1
Contributors
User avatar
holymanofgod
Just Registered
Just Registered
Posts: 2
Joined: Mon Nov 11, 2013 2:23 am

I'm making a game where the user has to spam certain keys in a pattern to move their

"Horses" forward to the finish line. and it is done multiplayer.

I already have the multiplayer and client side connection done and it transmits data via TCP / IP so that the server will process each players' "horse" location and send back the coordinates to other player so they can see each other.

Now, I have only one problem, When I animate the horses, I set freq to 10ms, 50ms and it's too slow to process.

10ms is the ideal interval for the timer, however, it creates choppiness in the animation.

I used the code :
Code: Select all
    Private Sub tamara_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tamara.Tick
        horse.Left += 10
    End Sub
and it starts to get white flashes trailing the horse. If someone can post an alternative to this it would be great.
User avatar
CodenStuff
Site Admin
Site Admin
Posts: 4392
Joined: Tue Aug 04, 2009 1:47 am

Have you buffered your form?.

In Form_Load:
Code: Select all
SetStyle(ControlStyles.DoubleBuffer, True)
        SetStyle(ControlStyles.AllPaintingInWmPaint, True)
That should help stop flicker and trails.
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
2 posts Page 1 of 1
Return to “Coding Help & Support”