Page 1 of 1

Choppiness in animation using Timer.

Posted: Mon Nov 11, 2013 2:35 am
by holymanofgod
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.

Re: Choppiness in animation using Timer.

Posted: Mon Nov 11, 2013 12:11 pm
by CodenStuff
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.