Jump to content
  • Advertisement
Sign in to follow this  
boogyman19946

Pong evaluation

This topic is 2869 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

Hello everyone :D I've been working on my Pong game for a while and had a break in within so this one took me exceptionally long to make since the tic tac toe game a while back.

I believe I have finally finished it. I haven't discovered any obvious bugs in the game. I had problems with controls and angle reflecting in one spot but I've managed to deal with those :) I've packed up the current source code and executable into a zip file and uploaded it to mediafire (link at the bottom of the post). I would put up the source of each file separately but I don't think that's such a good idea since there are so many files.

Here's a screenshot of the game in action:


I would like you guys if you could point me to where I could fix my code or make it cleaner. This is only my second game and after this I'm planning on doing Tetris and then perhaps a side scroller, so I'd love to fix my errors before the next game :) Thanks ahead of time.

Links (latest version is recommended :D):
Source + Executable V2
Source + Executable

[Edited by - boogyman19946 on July 19, 2010 7:35:58 PM]

Share this post


Link to post
Share on other sites
Advertisement
Hey pretty good!

A couple of things.

Source code:

I still advocate the creation of a class to handle your images. If you have a lot of images (as your games get more complex) it will make life SO much easier.

A personal preference (or a personal design that I have) is a generalized "Run" function that calls another function say "OnFrame" this way the "run" function which contains the message pump can be copied to your next program without having to re-write it. You could have it call a "OnInitalise" and "OnTermiante" functions as well.
You can even then stick it in a static library and not have to worry about it again!

Or not. Its just the sort of things you can do, not what you must do :)

Playing the game!

It got stuck! The computed angle had a horisontal vector of 0 so it just bounced up and down next to my paddle (I gave up after a fe mins watching). Make sure that its not possible to have an angle which results in that (unless pong had that - I never played pong)

When the ball is travelling mostly horizontal the computer's paddle is very 'shuddery'. Kinda annoying.

But still very good anyway! Keep up the good wok and I hope your having fun creating :)

Share this post


Link to post
Share on other sites
on the first try i got some "Divide by Zero" Error.

on the next try i had to end the game because the ball was infinitely bouncing up and down after i hit it from the side :)

Share this post


Link to post
Share on other sites
Quote:
Original post by empirical2
Hey pretty good!

A couple of things.

Source code:

I still advocate the creation of a class to handle your images. If you have a lot of images (as your games get more complex) it will make life SO much easier.


I've put the image handling stuff into the Back Buffer so all of the checks and selecting is performed by the back buffer. All I have to do is call the function from within the object being drawn.

Quote:
Original post by empirical2A personal preference (or a personal design that I have) is a generalized "Run" function that calls another function say "OnFrame" this way the "run" function which contains the message pump can be copied to your next program without having to re-write it. You could have it call a "OnInitalise" and "OnTermiante" functions as well.
You can even then stick it in a static library and not have to worry about it again!

Or not. Its just the sort of things you can do, not what you must do :)


That's definitely an interesting way to go about it :] I'll think about it during the making of the Tetris game. I'm thinking of using this with my side scroller game. :D It will certainly make my code cleaner by taking out all the trivial functionality. Thanks, I'll definitely consider.

Quote:
Original post by empirical2
Playing the game!

It got stuck! The computed angle had a horisontal vector of 0 so it just bounced up and down next to my paddle (I gave up after a fe mins watching). Make sure that its not possible to have an angle which results in that (unless pong had that - I never played pong)


Well that's quite a problem D: I've added a check to the moving function to make sure that the ball is at least 15 degrees from the 0 position. That problem should not happen anymore.

Quote:
Original post by empirical2When the ball is travelling mostly horizontal the computer's paddle is very 'shuddery'. Kinda annoying.


I added some margin to the moving functions so that the paddle is more tolerant as to the ball's position. It shouldn't shutter as much, if at all.

Quote:
Original post by empirical2But still very good anyway! Keep up the good wok and I hope your having fun creating :)


I'm having quite the fun :D The worst was the tic tac toe game because it was the first game I've made but now that I've completed my second game, it proves to be the most awesome feeling having produced something functional and complete. Finding solutions to problems feels quite rewarding. It's a lot better than a math class >.> Quite the fun I'd say :)

Quote:
Original post by scope
on the first try i got some "Divide by Zero" Error.

on the next try i had to end the game because the ball was infinitely bouncing up and down after i hit it from the side :)


Should be fixed in the second version ^.^


Here's the updated version. I'll include it in the original post as well
Source + Executable V2

[Edited by - boogyman19946 on July 19, 2010 7:56:50 PM]

Share this post


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

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!