Quantcast
Channel: Active questions tagged xna-4.0 - Game Development Stack Exchange
Viewing all articles
Browse latest Browse all 33

How to remove the jitter from my pong AI movement?

$
0
0

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 all articles
Browse latest Browse all 33

Latest Images

Trending Articles



Latest Images

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