i want to pick up the topic which breadpong already started.
im keen on working my old arkanoid over (windowed). and now where i want to make it really nice i notice that this is not the easiest task …
in my testphase my game runs with normal thread.sleep(x) and bufferstrategy >150fps. i know the problems around sleep but the framerate should fairly be enough to go further.
the problem is the movement of the ball itself. like it is normally done theres a position-vector and a direction vector both with float components.
but like breadstick’s example the ball moves very crap (no breadstick, i love your game ;).
i know there are pitfalls with the vsync and rounding issues so that e.g. sometimes two frames paint the same coordinate. but i dont know how to avoid this.
therefore i looked into the ping example of chet haase.
but although its very nice the ball doesnt move really smooth.
i looked into the movement-algorithm and wondered why he uses a cast to get the floating point coordinates to integers. isn’t rounding the better choice ?
so im searching for the smoooooth ball movement.