Introducing..... [drum roll].... Roung!
Well OK, it is not that big of a deal. Roung is your standard Pong game, except the paddles move in a circular direction instead of straight up and down. I started this just yesterday when it came to me how simple it would be to implement collision for this type of movement. As you can see in
this thread Jycerian wanted to implement a circular Pong game, but was having issues with collision.
The way my collision works is simple, To determine if the ball has collided I follow these steps
- Determine if ball is lined up with a paddle - Ball angle from the center field +- the angle of the paddle
- Check if the ball is close enough to collide with the paddle - Distance from center field to ball
- If it is, bounce the ball
Since I wrote it more as an example than anything, you can get the
full source code from here.
https://bitbucket.org/zsbzsb/roung/Roung was written using SFML.NET (for graphics/window/input) and
NetEXT (for input handling/vectors/time/math). The controls are the 'Left' and 'Right' arrow keys for player 1, 'A' and 'D' keys for player 2. If you want to toggle AI on and off use the 'Asterisk' and 'Num+' / 'Num-' for changing the AI difficulty.
You can get some precompiled binaries
from here if you just want to try it out.
If you have any questions or comments please let me know.