Page 1 of 1

"Breakout Clone".. I know it's lame.

Posted: Wed Nov 11, 2009 3:54 pm
by dandymcgee
I made this a few weeks ago out of boredom. I haven't really made any actual playable games before this, although I have been programming for some time. I was planning to add power-ups and such eventually, dunno if that will happen or not. Feel free to post comments, questions, or suggestions.

Screenshot:
Image
Link (Includes full source and project files):
Download [11/13/09 10:21 AM]

Enjoy! ;)

Re: "Breakout Clone".. I know it's lame.

Posted: Wed Nov 11, 2009 7:12 pm
by Draoz100
Looks really nice, keep up the good work.

ps: It isnt lame :)

Re: "Breakout Clone".. I know it's lame.

Posted: Wed Nov 11, 2009 7:59 pm
by Falco Girgis
Damn, that's pretty badass looking. Is this why you were needing direction of impact?

Re: "Breakout Clone".. I know it's lame.

Posted: Thu Nov 12, 2009 1:32 am
by Big Grizzle
It is far from lame.

My GF has a saying...

"It is not how well you do something that is important. It is that you do it."

The reasoning behind it is that people love to critique others, often negatively, very few of those people actually even try to do anything of value. Keep up the great work!

EDIT: BTW...thanks for the source code. I'm currently learning C++ and I'm sure there will be something in your code I haven't seen before!

Re: "Breakout Clone".. I know it's lame.

Posted: Thu Nov 12, 2009 2:26 pm
by dandymcgee
GyroVorbis wrote:Damn, that's pretty badass looking. Is this why you were needing direction of impact?
@Falco - Indeed it is. Thank you for the help with that. 8-)

@Big Grizzle - This is one of the few applications I have made where I actually put a fair deal of effort into comments. I think the source code will be helpful for anyone with some knowledge of C++/SDL who is curious about one man's idea of code structuring. If you do happen to take a look let me know what ya think. ;)

@Draoz100 - Thank you sir.

Re: "Breakout Clone".. I know it's lame.

Posted: Thu Nov 12, 2009 6:17 pm
by hurstshifter
Wow man, really great work here. Very polished.


If you hit the ball just right with the paddle you can get the ball stuck inside the paddle where it circles around rapidly until it eventually escapes and fly's out extremely fast. I actually spent like 10 minutes after clearing all the blocks just trying to get it to happen again, haha.

Re: "Breakout Clone".. I know it's lame.

Posted: Thu Nov 12, 2009 9:15 pm
by dandymcgee
hurstshifter wrote:Wow man, really great work here. Very polished.


If you hit the ball just right with the paddle you can get the ball stuck inside the paddle where it circles around rapidly until it eventually escapes and fly's out extremely fast. I actually spent like 10 minutes after clearing all the blocks just trying to get it to happen again, haha.
Yeah, it does happen occasionally and if you get good enough you can do it on purpose whenever you feel like it. :lol: I'm not sure how to fix it as I'm already taking both the ball velocity and the paddle velocity into account when doing collision checks. I'll just have to deal with it for now.

Re: "Breakout Clone".. I know it's lame.

Posted: Thu Nov 12, 2009 9:37 pm
by Falco Girgis
dandymcgee wrote:
hurstshifter wrote:Wow man, really great work here. Very polished.


If you hit the ball just right with the paddle you can get the ball stuck inside the paddle where it circles around rapidly until it eventually escapes and fly's out extremely fast. I actually spent like 10 minutes after clearing all the blocks just trying to get it to happen again, haha.
Yeah, it does happen occasionally and if you get good enough you can do it on purpose whenever you feel like it. :lol: I'm not sure how to fix it as I'm already taking both the ball velocity and the paddle velocity into account when doing collision checks. I'll just have to deal with it for now.
Your axis of "minimal overlap" that I showed you becomes your collision normal.

Once a collision is detected, you need to push the ball back along the normal (by the amount of overlap) to prevent interpenetration. That's actually exactly how physics simulations resolve that same issue.

Re: "Breakout Clone".. I know it's lame.

Posted: Fri Nov 13, 2009 9:13 am
by dandymcgee
GyroVorbis wrote:Your axis of "minimal overlap" that I showed you becomes your collision normal.

Once a collision is detected, you need to push the ball back along the normal (by the amount of overlap) to prevent interpenetration. That's actually exactly how physics simulations resolve that same issue.
I tried that but I couldn't get it working. I've fixed it for now, but the solution is somewhat of a hack. If the bottom of the ball is ever lower than the top of the paddle you lose.

Check top post for updated version.

Re: "Breakout Clone".. I know it's lame.

Posted: Fri Nov 13, 2009 12:22 pm
by imran.hoshimi
Very good. Nice job. I am also in process of learning SDL. :-)

Re: "Breakout Clone".. I know it's lame.

Posted: Sat Nov 28, 2009 3:26 am
by Skaruts
This is not lame at all. And it's actually looking pretty sexy.

I've been trying to make one of these for scenturies and I still haven't been able to.
I also need some research on ball bouces and stuff and that's why mine is still looking like this (got stuck and stoped doing it):
Image

This was made in BlitzBasic. I'm gonna take a peek into your code for that. Even tho I don't know much of C++, it may help (if I find where it is).

Re: "Breakout Clone".. I know it's lame.

Posted: Sat Nov 28, 2009 2:57 pm
by dandymcgee
Skaruts wrote:This is not lame at all. And it's actually looking pretty sexy.

I've been trying to make one of these for scenturies and I still haven't been able to.
I also need some research on ball bouces and stuff and that's why mine is still looking like this (got stuck and stoped doing it):
Image

This was made in BlitzBasic. I'm gonna take a peek into your code for that. Even tho I don't know much of C++, it may help (if I find where it is).
Cool, good luck. BTW, the ball bounce code is about halfway down in main.cpp.

Re: "Breakout Clone".. I know it's lame.

Posted: Sat Nov 28, 2009 7:05 pm
by Skaruts
Thx man. I looked at the code a bit so far, I'm too sleepy atm to make anything of it. But when I was scroling down my way to the ball related stuff, I glanced at the paddle movement and I thought "wait a minute", I hit the brakes, scrolled up to it again and found some interesting concepts I had never thought about. and I have only looked at the paddle controls yet :D. I'll take a deep look at all of it, tomorow maybe, cuz it seems I'll learn much with it.

Thx a lot for the tip.

Re: "Breakout Clone".. I know it's lame.

Posted: Sat Nov 28, 2009 10:57 pm
by dandymcgee
Skaruts wrote:Thx man. I looked at the code a bit so far, I'm too sleepy atm to make anything of it. But when I was scroling down my way to the ball related stuff, I glanced at the paddle movement and I thought "wait a minute", I hit the brakes, scrolled up to it again and found some interesting concepts I had never thought about. and I have only looked at the paddle controls yet :D. I'll take a deep look at all of it, tomorow maybe, cuz it seems I'll learn much with it.

Thx a lot for the tip.
Sure thing, post back if you have any questions/comments or feel free to PM me.