How To Create A Breakout Game with Box2D and Cocos2D 2.X Tutorial: Part 2

Discussion of the official tutorials published on raywenderlich.com. Please only discuss the official tutorials here - for general questions, use the General Discussion forum instead.

How To Create A Breakout Game with Box2D and Cocos2D 2.X Tutorial: Part 2

Postby rwenderlich » Fri Jan 18, 2013 1:00 pm

This is the official thread to discuss the following blog post: How To Create A Breakout Game with Box2D and Cocos2D 2.X Tutorial: Part 2
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ray Wenderlich
Blog: http://www.raywenderlich.com
Twitter: http://twitter.com/rwenderlich
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
User avatar
rwenderlich
Team Member
Site Admin
 
Posts: 2155
Joined: Thu Dec 23, 2010 4:14 pm
Has thanked: 28 times
Been thanked: 338 times

Re: How To Create A Breakout Game with Box2D and Cocos2D 2.X

Postby hype96 » Sat Jan 19, 2013 3:04 pm

Great tutorial website!

@rwenderlich what is the typical procedure for yourself and your tutorial team for learning how to implement specific features (ex: how to create a server for a multiplayer game) for your tutorials? The reason I ask is because I am new to coding and often find myself having a difficult time trying to use your tutorials as a base and build upon them to implement the specific features I need. Tips in the right direction would be very helpful. I plan on being fruitful and adding to your tutorials and I believe that's why you have your website setup.

Thanks for your reply
hype96
Baby Hacker
 
Posts: 8
Joined: Mon Jan 14, 2013 5:34 pm
Has thanked: 4 times
Been thanked: 0 time

Re: How To Create A Breakout Game with Box2D and Cocos2D 2.X

Postby bcbroom » Sat Jan 19, 2013 4:55 pm

I see this as two different questions, and I'll answer them in terms of what I have done as someone newish to iOS. I can't answer for any of the other team members.

1) How did I learn the specific features to write the tutorial?

I look around for other information. Are there other tutorials on related things? Is there a website for the library I want to use? Does it have examples and documentation? I tend to start with making something almost trivial work, and then add things to it as I try to figure things out. Sometimes there are other tutorials or starting points that can help me get started. When something doesn't work, I google the error or the problem and try to work out the issues that way (sites like stackoverflow.com can be very helpful). At some point I feel like I have enough worked out to be a viable lesson.

2) How do you extend your knowledge once you have a tutorial mastered?

This is hardener in some ways. Here are some things that I try to do. Can I (mostly) reproduce the tutorial items on my own? Do I know what the parts do? Can I add something slightly different (different image, color, shape, direction, etc)? Can I put two on the screen at the same time?

At this point I'd suggest trying to find the online documentation for the topic you've been working on. If its something with Cocos2D, can you find the class reference in the documentation, or the Apple documentation for iOS classes. What other methods does the class have, and can I get those to work? etc. I have found the Apple documentation as a whole to be pretty readable, so don't be afraid to look these up.

I think the hardest part is when you try to integrate the knowledge you have from several tutorials together into one idea. The only suggestion I have is to give it a try, and look for answers to issues that come up.

I'm not sure I've answered you very well, but hope it helps some.
bcbroom
Team Member
iOS Tutorial Team Member
 
Posts: 11
Joined: Wed May 16, 2012 1:00 am
Has thanked: 0 time
Been thanked: 1 time

Re: How To Create A Breakout Game with Box2D and Cocos2D 2.X

Postby charlie » Sun Jan 20, 2013 11:16 am

awesome job brian on the updates, can't wait to go through them!
charlie
Team Member
iOS Tutorial Team Member
 
Posts: 113
Joined: Sun Jan 02, 2011 7:40 am
Has thanked: 3 times
Been thanked: 12 times

Re: How To Create A Breakout Game with Box2D and Cocos2D 2.X

Postby hype96 » Sun Jan 20, 2013 2:15 pm

Thanks a lot for your reply Brian. And I do agree, trying to integrate what you learned from multiple tutorials is the hardest part
hype96
Baby Hacker
 
Posts: 8
Joined: Mon Jan 14, 2013 5:34 pm
Has thanked: 4 times
Been thanked: 0 time

Re: How To Create A Breakout Game with Box2D and Cocos2D 2.X

Postby Orochi_X » Mon Jan 21, 2013 12:15 pm

Thanks for the updated tutorials. They will prove to be very helpful.
Orochi_X
Uber Haxx0r
 
Posts: 54
Joined: Sat Jul 02, 2011 1:14 pm
Location: Kidderminster, United Kingdom
Has thanked: 0 time
Been thanked: 1 time

Re: How To Create A Breakout Game with Box2D and Cocos2D 2.X

Postby HeavenHell » Tue Feb 26, 2013 10:08 am

I finish tutorial : breakout game with box2d
But, when Ball collide blocks, velocity of blocks reduce. So Why??
HeavenHell
Baby Hacker
 
Posts: 8
Joined: Tue Feb 26, 2013 10:06 am
Has thanked: 0 time
Been thanked: 0 time

Re: How To Create A Breakout Game with Box2D and Cocos2D 2.X

Postby Frahaan » Wed Apr 24, 2013 10:28 am

Hello

I am trying to port this to Mac and when I do, I always get errors with the contact listener, is there something different I need to do for Mac, basically I want to use Cocos2d and Box2d to detect collision (specific collisions) so I can do something when 2 certain bodies/sprites collide.

Thanks Frahaan Hussain
Frahaan
n00b
 
Posts: 3
Joined: Sun Mar 17, 2013 5:40 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How To Create A Breakout Game with Box2D and Cocos2D 2.X

Postby howardor » Sat May 25, 2013 4:11 pm

I am having a memory management problem, running this product, converted to ARC. I followed the steps suggested in other tutorials on the site converting the initial Box2D template to arc then proceeding with the tutorial, but the problem comes in when I need to hold onto the CCSprites in the userData. I have the choice to use CFBridgingRetain/Release functions or the __bridge qualifier. I've tried it in various combinations and still get EXC_BAD_ACCESS errors at points of contact, either with one of the blocks in the game or with the paddle. I tried Profiling with Zombies, and only get confirmation that it's releasing the object one time too many. Any general rules of thumb for hanging on to these sprites in userData, in ARC?
howardor
n00b
 
Posts: 2
Joined: Mon Apr 29, 2013 12:57 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How To Create A Breakout Game with Box2D and Cocos2D 2.X

Postby Zepsilon » Tue Jul 09, 2013 12:16 pm

Hi. I'm trying to make an app where I have a player that jumps across platforms trying to avoid falling off the screen, and for this I need a way to create random shaped rectangles. Everywhere I've looked people just use sprites with image files, is there any way to create a rectangle without using an image, and to make it have physical properties?
Zepsilon
n00b
 
Posts: 1
Joined: Tue Jul 09, 2013 12:13 pm
Has thanked: 0 time
Been thanked: 0 time

Next

Return to Official Tutorials

Who is online

Users browsing this forum: No registered users and 4 guests

cron