• Content count

  • Joined

  • Last visited

Community Reputation

7 Neutral

About reders

  • Rank

Personal Information

  • Interests
  1. Ops. My mistake. SFML has a frame rate limiter pretty unstable so I simply activated the VSync to avoid getting crazy with clocks. I wasn't thinking about monitor with higher refresh rate than 60 FPS. I'll fix it as soon as I have time Thank you for pointing that out to me
  2. 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
  3. Yet Another Pong

    I've uploaded an edited version of my Pong game for the November Challenge. Take a look.
  4. Here is my submission for the challenge. Sadly I don't have the time to work on it again before the end of the month, and the AI is stupid to say the least. The twist is pretty straightforward, the arena is round instead of rectangular. When a player hits the ball it changes its color. When the ball is red if it exit the arena the point will go to the red paddle. Viceversa when it's blue the point will go to the blue paddle. The two paddles can also overlap and both hit the ball. When this happens and the ball exit the arena a point will be subtracted to both player. Here's the blog post: I hope you like it Code reviews are really appreciated! Round
  5. From the gif, it doesn't seem easy to distinguish between the destroyable enemies and the bullets. Hard to tell without trying, but you could consider differentiate them with colors.
  6. Yet Another Pong

    Thank you very much for your help I reworked the variables moving most of the "magic numbers" in to const as both of you suggested. I also moved the multiple statements per line. As for the classes I started working on that but as predictable I had trouble doing it now since I would need to redo most of the entire thing. So now I'm working on a different version for the contest (if I manage to finish it in time) and I'm working with objects from the start. Here's the upgraded .cpp Pong.cpp
  7. Yet Another Pong

    Thank you very much. I'll work on this. One more question. What's the best way to divide the code in different files like headers and such? Is there a standard?
  8. Yet Another Pong

    What do you suggest I set as classes? I didn't use them since I didn't find the need to.
  9. Yet Another Pong

    Hi, everyone! I "finished" building my first game. Obviously Pong. It's written in C++ on Visual Studio with SFML. Pong.cpp What do you think? What should I consider doing to improve the code? Thank you very much. EDIT: added some screenshot and .zip file of the playable game