Quantcast
Viewing latest article 4
Browse Latest Browse All 33

How to remove the jitter from my pong AI movement?

I am developing Pong using Monogame / XNA and my AI paddle is really jittery when the ball is moving more horizontally than vertically.

My AI is very simple and works as follows:

  • If the ball's position is greater than the paddle position I increasethe paddle's y position by 3

  • If the ball's position is less than the paddle position I decreasethe paddle's y position by 3

Where is the flaw in my logic that would cause jittering when the ball is moving more horizontally than vertically?


Viewing latest article 4
Browse Latest Browse All 33

Trending Articles



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