Check out my first game

Started by
14 comments, last by Takaloy 18 years, 3 months ago
Thanks everyone. As I said the game isnt complete and I havent added in the help feature yet. I was going to move on to another project but since I got so many positve replys Im going to start on version 2.0. I'll add in all the bells and whistles and then put it up as the image of the day!
Simplicity is the ultimate sophistication. – Leonardo da Vinci
Advertisement
here i go again, i really should do everything first THEN comment, but anyways... you include windows.h and then use few functions that it supports which would make your program easier to code, add functionality, and reduce redunancy (reinventing the wheel). also, i don't know if you're familiar with structures and enumerators but they make more sense than classes in much of your implentation. using directions makes sense for most games, but when you're just bouncing a ball, you can just invert the velocity along the corresponding axis (traveling down and right across the screen you're ball has a velocity (x,y) of (10, 5), when it bounces off say the top and bottom paddles you can write something like y = -y). incidentally that's the way you should be changing your paddle directions, create a constant in the header and set it to 10, then that way if you ever want to change the speed at which the paddles go you don't have to go and find every 10 and change it, possibly missing one. and to fix the pause bug, it's happening because you're checking for a spacebar press EVERY game loop, i guess it's rendering at a speed of at least 20 fps, which means that if i hold it down for any longer than 1/20th of a second it counts as pressing it again. i'm not familiar with sdl, so i would recommend using the default msg handler because it is notoriously slower, in games we want to be able to get those key presses as fast as possible, but sometimes, like in this case, you want that delay the msg handler provides.

ok... there WAS good stuff too in your code (don't want to discourage you, i'm not perfect i know) :) like i said, and others, GREAT way to reinvent pong! and great use of iterators (in my opinion), i'm horrible with them and only use the ones i have to when dealing with the STL. good job with encapsulating enerything, but purists would say you need to seperate your definitions and implementations, i don't really think it matters all that much and it produces less files.
thanks zapper, that was a great post! I'll keep all of that in mind while I fix up the game.
Simplicity is the ultimate sophistication. – Leonardo da Vinci
Nice one! Firstly, it worked perfectly this time(which is always good). Secondly, the AI is too good!!! Its impossible to loose. You're going to have to put some randomness in there for the final version. Thridly, I like the dual-paddle idea. It was done very well, and did add to gameplay(sometimes, beginners (*cough* me *cough*) just add a new feature to call it 'not *just* a clone!', but there was... well... a reason why that feature wasn't in the original game :) )

Again, nice work!
I've noticed the paddles of my opponent are basically equal to the x and y positions of the ball. This means that it's impossible for me to ever score even one point. Their paddle stays EXACTLY dead center on the ball.

Otherwise, neat approach, you have a way to go before it's done, but I think it's a great start for a first game.
_______________________"You're using a screwdriver to nail some glue to a ming vase. " -ToohrVyk
tried it. good work. anyone won yet? I keep getting beat :(

This topic is closed to new replies.

Advertisement