0
votes

I'm trying to create what I'd assume is a very straightforward piece of physics code using Chipmunk on iOS, which will effectively have eight UIButtons move around a UIView of their own accord, bouncing off the edges, and off of each other, at a randomized speed, etc.

As a relatively new coder, I am having a very hard time doing this. I have pulled apart example code from the chipmunk website (even some specifically using UIKit elements) but I am afraid I just don't know enough to establish what forces need to act, how I set them up, etc. I realise that this is a wide question, but all of the tutorial content I've found regarding Chipmunk seems to assume that one's already a proficient programmer, or a proficient physicist and mathematician. I'm a hobby coder and can't spring to pay for any of the professional Chipmunk packages, and since the free version is in C, not Objective-C, even getting it integrated seems like days of work for me.

Chipmunk doesn't seem to be well-documented. For instance, searching for "friction" in the documentation finds a single (unhelpful) instance of the word. If there's no scale, how am I to know what value to enter? I realise I am frustrated and it is easier than I am making it, but it seems like doors are being slammed in my face every way I try to pick this stuff up.

Lots of the tutorials I have found use older versions of Chipmunk too, which huge amounts of stuff have changed from, making them really, really tough to follow along with.

I could really use a bare bones introduction that doesn't automatically assume I can already do it. Is one likely to exist anywhere? Any other tips for how to handle this?

1
I tend to break things into bite-sized chunks. You say you are new to coding. Have you made other iOS apps before? Would it be useful for me to dig up iOS tutorials as well as Chipmunk tutorials?theJollySin
I've got the bulk of an app down that I'm really happy with, it's a fairly simple word game, and I've learned a lot along the way about data algorithms work (I worked out all of the anagrams and other things myself, programmatically), as well as loads of UIKit stuff, general Obj-C syntax stuff, design / flow stuff, etc. I think after Christmas I might just have to pay for the Objective-Chipmunk package and hope I have better luck with that. It's definitely worth paying for, it's just difficult to justify as a hobbyist.Luke

1 Answers

0
votes

Not sure if you are the same guy I just answered on the Chipmunk forums but there is this new example here which contains a (regular, non-pro) Chipmunk/UIKit example. It's pretty thoroughly commented. https://github.com/slembcke/ChipmunkColorMatch

To be fair about the documentation, you do have to realize that there are entire textbooks on the sort of physics that Chipmunk covers. While I do feel that the docs sufficiently cover the API, you are right that it assumes that you know the terms and theory. I can't fit all of that into the documentation, and I don't have the time to write that level of a physics primer. There are some things you just have to know like what mass is, what friction coefficients are (and why they have no units or scale), and how forces work. The Chipmunk documentation should not be a go to place to learn that sort of thing.

If you have specific questions, you can always ask on the Chipmunk forums.