1
SFML projects / Pong
« on: January 13, 2016, 04:57:33 pm »
This is my try on a pong.
It was finished a while ago.
I started small and simple but things got pretty ugly pretty fast.
I had a few months break from programing because of some obligations... and to get back into shape I decided to make a pong clone, I got carried away and before I knew the source got big and I didn't want to break it into separate files. :/
Video: https://youtu.be/MtfxawsoY2g
Source: https://github.com/Godsend72/GitFolder
My AI code looks like this:
I have a prediction ball that travels 1.3 times faster than the real ball.
AI paddle moves only when the ball is on his side of the screen.
When the ball collides with the player paddle I set it to the same position as the real ball.
AI prediction example: https://youtu.be/oRq4iqfq33Y
AI logic:
It was finished a while ago.
I started small and simple but things got pretty ugly pretty fast.
I had a few months break from programing because of some obligations... and to get back into shape I decided to make a pong clone, I got carried away and before I knew the source got big and I didn't want to break it into separate files. :/
Video: https://youtu.be/MtfxawsoY2g
Source: https://github.com/Godsend72/GitFolder
My AI code looks like this:
I have a prediction ball that travels 1.3 times faster than the real ball.
AI paddle moves only when the ball is on his side of the screen.
When the ball collides with the player paddle I set it to the same position as the real ball.
AI prediction example: https://youtu.be/oRq4iqfq33Y
AI logic:
(click to show/hide)