Forums

ForumsProgramming Forum

SUSHI CAT iphone jiggle mechanics

Posted Oct 22, '11 at 10:56pm

verdantTree

verdantTree

1 post

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!

 

Posted Oct 23, '11 at 9:48am

master565

master565

4,288 posts

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.

 

Posted Oct 25, '11 at 8:34pm

joeybetz

joeybetz

107 posts

Knight

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.

 

Posted Oct 26, '11 at 10:11pm

OneWizard

OneWizard

5 posts

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.

 

Posted Nov 1, '11 at 4:02pm

joeybetz

joeybetz

107 posts

Knight

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.

 
Reply to SUSHI CAT iphone jiggle mechanics

You must be logged in to post a reply!