Hi! I imagine this is a study game for you. Great job. I wanted to let you know about a bug I found where in I can slow down the ball by trapping it against the side of the paddle and the edge of the screen for a couple of bounces.
If I had to guess why, I would say you're calculating the ball's new velocity after a hit based directly off of the velocity at the time of the hit. Instead, set a constant for your velocity and then multiply this with the normalized value of your new velocity after the hit.
i.e. new Velocity = mySpeed * NewVector2.normalized;
This will keep the ball moving at a consistent speed and the performance hit from the calculation will be negligible.
Comments
Log in with itch.io to leave a comment.
Hi! I imagine this is a study game for you. Great job. I wanted to let you know about a bug I found where in I can slow down the ball by trapping it against the side of the paddle and the edge of the screen for a couple of bounces.
If I had to guess why, I would say you're calculating the ball's new velocity after a hit based directly off of the velocity at the time of the hit. Instead, set a constant for your velocity and then multiply this with the normalized value of your new velocity after the hit.
i.e. new Velocity = mySpeed * NewVector2.normalized;
This will keep the ball moving at a consistent speed and the performance hit from the calculation will be negligible.
Keep up the good work!
thank you for all the helpfull comments and my apologies for the late replies. I will try to make it work better!