ForumsProgramming ForumSUSHI CAT iphone jiggle mechanics

4 2273
verdantTree
offline
verdantTree
1 posts
0

To any developers out there who worked on the iOS version of Sushi Cat.

I am a CS student currently learning to program in iOS using Cocos2d and Box2d.

I love sushi cat, and as a learning exercise, I have been trying to replicate the jiggling mechanics of sushi cat. I have an idea of how you implemented it in the Flash version, but I have literally no idea how you translated those squishy, jiggly cat physics to iOS.

If you guys would be willing to share any pointers or hints for how this type of physics could be implemented, I would be really grateful (obviously I don't expect you to share any copyrighted trade secret code etc).

Thanks and best wishes!

  • 4 Replies
master565
offline
master565
4,239 posts
190

You'll have a better shot asking the developer directly. He doesn't seem to have his e-mail linked so you may just have to hope he checks his comments and sees yours.

joeybetz
offline
joeybetz
107 posts
1,230

Sushi Cat is just a chain of circle rigid bodies linked together with joints into a much bigger circle. The initial area of the bigger circle is calculated and stored. Every update the rigid body circles are "extruded" outwards, away from the center point, to match the initial area of the bigger circle. The amount and how often you "extrude" determines how rigid the squishy body ends up being.

That's the easy part, rendering the little guy is where things got challenging, but that's a different story.

OneWizard
offline
OneWizard
5 posts
60

I could be wrong, but is it a bitmap fill with the eyes and other things added on top? That would also make it easy to expand by just increasing the size of everything as it eats sushi.

joeybetz
offline
joeybetz
107 posts
1,230

Kind of. The bitmap fill didn't give me the effect I was looking for plus the bitmap had to scale slightly with the soft body as it grew so I ended up going the slower route and drawing the body with graphics data and using that as a mask over the body bitmap. It made the body look a little more 3D and didn't make him look like just a bitmap fill. The ears and legs were "snapped" to a specific rigid body circle and as the body grew, they would stay locked to the outer edge (up to a certain length though for the ears only). The face was kept at the center point at all times while a dark border was drawn around the entire cat. I think I had some bevel filters on him at some point, but they had to be removed for performance.

Showing 1-4 of 4