Inspiration
We wanted to create a game that we knew we could finish. We were thinking about a board game that we could use flask to implement the game as a website; however, pong is just too fun.
What it Does
It is a two-player game. They can control their paddle to hit the moving ball. The ball gradually slows up until someone loses a life. Someone loses a life when the ball hits their vertical side. If a player loses 3 lives, the game ends.
How We Built It
We used the PyGame library.
Challenges we ran into
The ball sometimes went through the paddle because our game refreshes the screen with FPS. Therefore, when the refresh rate is low and the ball speed is high, it can skip the paddle altogether ("teleporting").
Accomplishments that we're proud of
The ball ricochet when it hits the paddle took a lot of time. The vector changes depending on where it hits the paddle by calculating the ratio between the center and the location of the paddle and half the length of the paddle. There is also a constant of .5 so that the minimum angle is 30 degrees (30 60 90 -> 1, sqrt(3), 2).
What we learned
Some of our teammates learned about creating classes in python.
What's next for Pong
We were thinking about implementing an AI, but we ran out of time. We are going to try that after the Hackathon because we love to program and it is a good challenge.
Log in or sign up for Devpost to join the conversation.