• Advertisement
Sign in to follow this  

First Game: PONG!

This topic is 4523 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have completed my first game in C++. It's a simple Pong clone, but includes one and two player support. I also think it's pretty well done and I tried to give it a retro feel. Download it here. There's one thing that may be wrong that I haven't gotten to test yet: The game may run too fast. I have a rather old computer, and the game has almost no delaying function to regulate its speed, so please tell me if this is way too fast (it should be pretty fast though).

Share this post


Link to post
Share on other sites
Advertisement
I had that same problem back in 2000. Try to count FPS in a loop, then divide every movment with FPS int. Simple, not?

Share this post


Link to post
Share on other sites
It isn't that fast, ( gues i have a slow comp ).
And there's a refresh problem. All the pics stay on background buffer.

Share this post


Link to post
Share on other sites
Hmmm, I don't have that problem with the background at all, and your comp may not be slow maybe the game is just fine for speed.

And thanks for the FPS thing I'll have to try that out.

Share this post


Link to post
Share on other sites
Are you using graphic API ( maybe Allegro or something ). 'Cause in that case its easy to set up speed. Anyway it isn't a bad game, better than my first game which was also pong. Mine was slow even on fast computers, and when i bought new comp it was faster...

Share this post


Link to post
Share on other sites
Yes, it uses SDL. Is there an easy way to regulate speed with that? I'll have to research it.

Share this post


Link to post
Share on other sites
Can someone else try it out to see if images are sticking to the background? That would really be a big problem I would like to fix (and would be very confused about because it doesn't happen to me and I think I understand completely how the buffers work in the game).

Share this post


Link to post
Share on other sites
Yeah, the images are "smearing". Possible causes: not using double buffering, or not using SDL_FillRect(pScreen, NULL, 0); in main loop. And yes, it is a bit fast.

Share this post


Link to post
Share on other sites
Thanks, I think I'll post a topic about this in the Begginners forum so more people can help (and perhaps figure out why this is happening to other people but not to ME!).

Share this post


Link to post
Share on other sites
Yeah, it does that for me. Other than that...not bad! I am creating a Pong Clone in SDL also right now. I have actually finished it, but I am re-writing it with better code, cause I am going to release my source code.



Chad.



EDIT:I HAVE PLAYED IT SOMEMORE, JUST TO SEE IF I FOUND ANY BUGS AND I FOUND ONE. THEIR IS NO PADDEL COLLISION DETECTION FOR WHEN IT COLLIDES WITH WALL. Might want to fix that. lol.


EDIT2:I HAVE FOUND ANOTHER BUG. IN 2 PLAYER MODE THE BALL WENT THROUGH MY PADDEL. MIGHT WANT TO FIX THAT ALSO.


Share this post


Link to post
Share on other sites
Thanks for the response, and I will try to fix that. Also if you want any of my source code, just ask. Or actually you don't have to ask cause I just posted all of it in the For Beginners forum so you can just go there.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement