Chipmunk Tutorial for iOS: How To Create A Simple iPhone Game

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.

Chipmunk Tutorial for iOS: How To Create A Simple iPhone Game

Postby rwenderlich » Tue Apr 19, 2011 11:00 am

This is the official thread to discuss the following blog post: Chipmunk Tutorial for iOS: How To Create A Simple iPhone Game
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ray Wenderlich
Blog: http://www.raywenderlich.com
Twitter: http://twitter.com/rwenderlich
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
User avatar
rwenderlich
Team Member
Site Admin
 
Posts: 2058
Joined: Thu Dec 23, 2010 4:14 pm
Has thanked: 28 times
Been thanked: 293 times

Re: How To Create A Simple iPhone Game With Chipmunk Physics

Postby smpdawg » Tue Apr 19, 2011 5:11 pm

What an outstanding post! Can't wait to go back and read this again from beginning to end. Keep up the good work.
smpdawg
Baby Hacker
 
Posts: 5
Joined: Thu Apr 07, 2011 6:33 pm
Has thanked: 0 time
Been thanked: 3 times

Re: How To Create A Simple iPhone Game With Chipmunk Physics

Postby andreas.loew » Tue Apr 19, 2011 7:00 pm

I don't understand why people still stick to copy and paste for their polygons.

If you use PhysicsEditor you don't need to copy and paste your vertexes.
You don't need to be careful about concave shapes or sprite orientation.
You don't need to care about orientation in your polygons.
That's all handled for you!

Have a look at this: http://www.physicseditor.de/2011/03/07/ ... os2d-demo/

Complete example is included ;-)
User avatar
andreas.loew
Hacker
 
Posts: 31
Joined: Tue Jan 11, 2011 6:29 pm
Has thanked: 0 time
Been thanked: 2 times

Re: How To Create A Simple iPhone Game With Chipmunk Physics

Postby Bobj-c » Tue Apr 19, 2011 8:07 pm

Hey Ray,

Awesome Tutor rich with info as always

Thanks
Bobj-c
Hacker
 
Posts: 43
Joined: Mon Feb 07, 2011 3:39 pm
Has thanked: 0 time
Been thanked: 1 time

Re: How To Create A Simple iPhone Game With Chipmunk Physics

Postby HarveyTheMan » Tue Apr 19, 2011 9:28 pm

IMO, PhysicsEditor is, as Andreas may have said, a better choice. It seems PhysicsEditor already removes most of the hassle for you. I tested it a couple of times and it worked like a charm. Can I make PhysicsEditor work with Ray's tutorial? Can you please send me samples? Thanks!

Thumbs up for the tutorial! Getting started is easy with these kinds of tutorials! :D
HarveyTheMan
n00b
 
Posts: 3
Joined: Tue Apr 19, 2011 9:19 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How To Create A Simple iPhone Game With Chipmunk Physics

Postby Emmy » Tue Apr 19, 2011 10:51 pm

I am looking at space manager package for my second game. Chipmunk can do a lot more deep and detail work. Thanks for the great tutorial again. This is really help me to understand the chipmunk.
Emmy from Abitalk
---------------------------------
http://www.abitalk.com
http://www.facebook.com/abitalkcommunity
twitter: @abitalk
User avatar
Emmy
Hacker
 
Posts: 21
Joined: Sat Mar 05, 2011 10:18 am
Location: San Jose, CA
Has thanked: 0 time
Been thanked: 0 time

Re: How To Create A Simple iPhone Game With Chipmunk Physics

Postby Emmy » Wed Apr 20, 2011 12:03 am

Hi Ray:

There is catnap_bg.png file missing in the project package.
Emmy from Abitalk
---------------------------------
http://www.abitalk.com
http://www.facebook.com/abitalkcommunity
twitter: @abitalk
User avatar
Emmy
Hacker
 
Posts: 21
Joined: Sat Mar 05, 2011 10:18 am
Location: San Jose, CA
Has thanked: 0 time
Been thanked: 0 time

Re: How To Create A Simple iPhone Game With Chipmunk Physics

Postby ragnarrok » Wed Apr 20, 2011 1:35 am

quick question... any simple way to make it so some blocks take more than one tap to destroy?

and yeah catnap_bg.png is missing, and the resources link seems to be dead.
ragnarrok
Hacker
 
Posts: 11
Joined: Wed Apr 20, 2011 1:33 am
Has thanked: 0 time
Been thanked: 0 time

Chipmunk vs Box2d

Postby JHNeves » Wed Apr 20, 2011 2:52 am

Ray, what do you say: Chipmunk or box2d ? Why ?
User avatar
JHNeves
Hacker
 
Posts: 21
Joined: Wed Apr 20, 2011 2:50 am
Location: Recife, Brazil
Has thanked: 1 time
Been thanked: 0 time

Re: How To Create A Simple iPhone Game With Chipmunk Physics

Postby rwenderlich » Wed Apr 20, 2011 4:13 am

@andreas @Harvey: Yeah Physics Editor is indeed a great tool (especially like the auto-shape tracing), but I think it's better to learn using Vertex Helper so you can understand how things work well before moving up to higher-level tools. Maybe some day I'll update this or add another tutorial on Physics Editor!

@Emmy @ragnarrok: Whoops sorry about the bad resources link & missing bg, should be fixed now!

@ragnarrok: The simplest way would be to add an instance variable in CPSprite for tapsToDestroy. Then when destroy is called, decrement the count, and only destroy it if the count is 0 or less. And you can initialize the tapsToDestory to be different values in the initializers.

@JHNeves: I think they're both great libraries, most people decide based on whether they prefer C (Chipmunk) or Objective-C (a wrapper around Chipmunk or Box2D) or C++ (Box2D). Personally I prefer Box2D because I like its Continuous Collision Detection and API a bit better, but I know a lot of people who like Chipmunk, so you can't really go wrong.

@smpdawg @Bobj-c: Thanks so much, glad it was helpful! :]
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ray Wenderlich
Blog: http://www.raywenderlich.com
Twitter: http://twitter.com/rwenderlich
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
User avatar
rwenderlich
Team Member
Site Admin
 
Posts: 2058
Joined: Thu Dec 23, 2010 4:14 pm
Has thanked: 28 times
Been thanked: 293 times

Next

Return to Official Tutorials

Who is online

Users browsing this forum: No registered users and 8 guests