Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

So Here We Are

Sign in to follow this  


(Ok, I can't seem to add a link at the moment. It just makes the whole post disappear) (Now it seems to work. Can I not start a post with a link or something? Any way back to the original post)

Two Player Pong is finished!

So, after 5 days and 1233 lines of code, it is finally finished. I got around the collision detection problems I had yesterday by checking if the ball was only partially inside one of the sides of the paddle, then resetting the ball's position and reversing its velocity. This seems to work. I also spent a lot of the day changing the title screen so that it shows the controls for each player.

There is one problem that hasn't been ironed out and that is pausing the game when the window loses focus. What I have in there works when the window is minimised but not when you alt-tab away. Does anyone know how to solve this in SDL?

I have included the source code for anyone who wants to have a look. Any observations/comments of the game and/or code would be greatly appreciated.

Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!