Pong! and a fortuitos November Challenge

Published November 29, 2017
Advertisement

Hi everyone!

This is the story of how I started working on a Pong game for fun without even noticing that that was the month's challenge theme. 
 

I started developing a Pong game since I wanted to follow the suggestion of user Alpha_ProgDes (I think you all know what blog post I'm talking about).
I have some programming experience in C++ thanks to my university studies, but never (really) tried developing a game.
Since I already know how to use Visual Studio, that was my SDK of choice. The framework used is SFML since I read it was pretty easy to use and sufficiently complete for 2D games development. 

So I started developing a standard Pong game. Since my esthetic sense is pretty sucky I followed the Material Design color palette to choose the colors of the game elements. I'm probably not experience enough to tell you what to do, but I think it's a good idea to follow this design standard since they are made to be pleasing to the eyes.

The graphic is entirely vector based, with shapes defined using the SFML libraries.
This choice made the collision detection easy and reliable. 

After developing a working version I published it on the For Beginners forum to get reviews of the code.
I really need to thank users h8CplusplusGuru and frob for their suggestions and insights. 

When I was finally satisfied with the results I started working on a modified version for the November Challenge.
The "twist" idea came to me practically instantly. Instead of having a standard rectangular game space I wanted to use a round arena with the paddle moving around the circumference and the ball bouncing inside of it.

The first step was to realize the paddles.
Since I wanted to stick to vectors shape, I developed a custom shape class following the preexisting classes in the SFML library.
For the rest of the code (i.e. collisions, bouncing etc..) it was all a matter of trigonometry.
I encountered some problems in the algorithm, since I'm used to a coordinate system starting from bottom left instead of the top right one used in programming.
Nothing that couldn't be solved with a bit of logic. 

Anyway, there's my story. Hope you like my game and sorry for my bad English.

Code reviews are highly appreciated guys :)

0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement