Attached is the start of my Breakout clone, at the moment the ball should just bounce around a couple of times (smoothly) & then quit. But the ball bounces around with varying speeds and with jerky movements, why?

Recommended Answers

All 2 Replies

My first guess would be because of lines 244 to 247 and related lines:

int x;
int y;
int yVel;
int xVel;

These are integers, change them all to double's or float's for a smoother result. Also, make sure any values you add / subtract to these variables are also the same data type.

Thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.