Skip to main content
Post Closed as "Duplicate" by House
deleted 241 characters in body; edited title
Source Link
House
  • 73.3k
  • 17
  • 185
  • 273

How to "smooth" an object movementdo I avoid going through objects at high speed?

I am quite the beginner in XNA. I have only recently started using GameComponents. I have a multiplayer game called Better Pong (a successor to my first game, EpicPong). It's a simple 2 player pong game. I move the ball (which is an object) by incrementing the Vector2 (the position) of the ball by the velocity Vector2 and updating the hitbox Rectangle.

However, by having very large speeds (such as (12,12)) the ball might go through the paddlepaddle since it just skips through the Paddle's Rectangle "hitbox".

Is there a way to make the ball move "smoother"make smaller movements, so it doesn't go through the paddle?

(The source code is here(but still move fast)?

How to "smooth" an object movement?

I am quite the beginner in XNA. I have only recently started using GameComponents. I have a game called Better Pong (a successor to my first game, EpicPong). It's a simple 2 player pong game. I move the ball (which is an object) by incrementing the Vector2 (the position) of the ball by the velocity Vector2 and updating the hitbox Rectangle.

However, by having very large speeds (such as (12,12)) the ball might go through the paddle since it just skips through the Paddle's Rectangle "hitbox".

Is there a way to make the ball move "smoother", so it doesn't go through the paddle?

(The source code is here)

How do I avoid going through objects at high speed?

I am quite the beginner in XNA. I have only recently started using GameComponents. I have a multiplayer game called Better Pong. I move the ball (which is an object) by incrementing the Vector2 (the position) of the ball by the velocity Vector2 and updating the hitbox Rectangle.

However, by having very large speeds (such as (12,12)) the ball might go through the paddle since it just skips through the Paddle's Rectangle "hitbox".

Is there a way to make the ball make smaller movements, so it doesn't go through the paddle (but still move fast)?

Source Link
Ilan
  • 101
  • 1

How to "smooth" an object movement?

I am quite the beginner in XNA. I have only recently started using GameComponents. I have a game called Better Pong (a successor to my first game, EpicPong). It's a simple 2 player pong game. I move the ball (which is an object) by incrementing the Vector2 (the position) of the ball by the velocity Vector2 and updating the hitbox Rectangle.

However, by having very large speeds (such as (12,12)) the ball might go through the paddle since it just skips through the Paddle's Rectangle "hitbox".

Is there a way to make the ball move "smoother", so it doesn't go through the paddle?

(The source code is here)