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

Anything related in any way to game development as a whole is welcome here. Tell us about your game, grace us with your project, show us your new YouTube video, etc.

Moderator: PC Supremacists

Post Reply
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

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

Post 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! ;)
Last edited by dandymcgee on Fri Nov 13, 2009 9:22 am, edited 2 times in total.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
Draoz100
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 3
Joined: Sun Nov 01, 2009 8:55 pm
Favorite Gaming Platforms: PC
Programming Language of Choice: c++

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

Post by Draoz100 »

Looks really nice, keep up the good work.

ps: It isnt lame :)
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
Posts: 10294
Joined: Thu May 20, 2004 2:04 pm
Current Project: Elysian Shadows
Favorite Gaming Platforms: Dreamcast, SNES, NES
Programming Language of Choice: C/++
Location: Studio Vorbis, AL
Contact:

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

Post by Falco Girgis »

Damn, that's pretty badass looking. Is this why you were needing direction of impact?
User avatar
Big Grizzle
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 61
Joined: Wed Sep 02, 2009 1:07 pm
Current Project: 2d side scrolling shooter.
Favorite Gaming Platforms: The SNES rules all!!! Super Aleste baby!
Programming Language of Choice: Python
Location: London, UK
Contact:

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

Post 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!
"Simplicity is the ultimate sophistication." - Leonardo da Vinci
http://caveofgrizzle.blogspot.com/
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

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

Post 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.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
User avatar
hurstshifter
ES Beta Backer
ES Beta Backer
Posts: 713
Joined: Mon Jun 08, 2009 8:33 pm
Favorite Gaming Platforms: SNES
Programming Language of Choice: C/++
Location: Boston, MA
Contact:

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

Post 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.
"Time is an illusion. Lunchtime, doubly so."
http://www.thenerdnight.com
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

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

Post 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.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
Posts: 10294
Joined: Thu May 20, 2004 2:04 pm
Current Project: Elysian Shadows
Favorite Gaming Platforms: Dreamcast, SNES, NES
Programming Language of Choice: C/++
Location: Studio Vorbis, AL
Contact:

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

Post 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.
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

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

Post 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.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
User avatar
imran.hoshimi
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 12
Joined: Mon Dec 01, 2008 4:57 am
Current Project: Nothing. :(
Favorite Gaming Platforms: PC, XBox360, PS2, SNES and almost all of them.
Programming Language of Choice: C/C++
Location: Karachi, Pakistan.
Contact:

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

Post by imran.hoshimi »

Very good. Nice job. I am also in process of learning SDL. :-)
User avatar
Skaruts
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 4
Joined: Sat Nov 28, 2009 3:13 am
Current Project: probably nothing worth mentioning
Favorite Gaming Platforms: PC, psp
Programming Language of Choice: what hard question..
Location: A nice portuguese bitch.. err.. I mean beach!

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

Post 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).
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

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

Post 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.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
User avatar
Skaruts
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 4
Joined: Sat Nov 28, 2009 3:13 am
Current Project: probably nothing worth mentioning
Favorite Gaming Platforms: PC, psp
Programming Language of Choice: what hard question..
Location: A nice portuguese bitch.. err.. I mean beach!

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

Post 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.
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

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

Post 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.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
Post Reply