Page 1 of 1

Pong!

Posted: August 9th, 2013, 4:04 am
by GreatJake
I made this a few months ago. Its pretty simple compared to some of the stuff you guys do but it was one of my first c++ programs i kinda made on my own since i used chilis frame work so i decided to share it.

Re: Pong!

Posted: August 9th, 2013, 8:23 am
by bshivam2001
Good Work!
Its Pretty nice according to what we have learnt!

Re: Pong!

Posted: August 9th, 2013, 12:57 pm
by Nosferatu
Pretty good, but the bounce sound makes my ears bleed :D and the game sometimes crashes when the ball hits the top of the table.

Re: Pong!

Posted: August 9th, 2013, 2:22 pm
by clau007
It's cool, but crashes very often!

Re: Pong!

Posted: August 9th, 2013, 5:01 pm
by GreatJake
It never crashes when you run it in the exe. Im useing windows 8 so i think windows is adding some code that stops it from crashing if you draw an out of bounds pixel.

Re: Pong!

Posted: August 9th, 2013, 6:48 pm
by LuisR14
you could just solve it by adding ifs in both PutPixel functions that discards the pixel(s) when x/y is less than 0 or greater than screenwidth/screenheight :)

Re: Pong!

Posted: August 9th, 2013, 7:34 pm
by GreatJake
That feels very hacky. Doing 4 if statements for every pixel? that sounds very inefficient but i hope it stops all the crashes :D

Re: Pong!

Posted: August 10th, 2013, 2:42 am
by LuisR14
well you can do it all in one if statement, doesn't have to be 4 :lol:

Re: Pong!

Posted: August 10th, 2013, 5:30 pm
by elnegro97
I made a Pong clone too, finished it today.

Re: Pong!

Posted: August 11th, 2013, 2:45 am
by GreatJake
LuisR14 wrote:well you can do it all in one if statement, doesn't have to be 4 :lol:
True but your still checking for 4 conditions.