How to add customizations to a sprite

Forums Programming cocos2d support (graphics engine) How to add customizations to a sprite

This topic contains 4 replies, has 4 voices, and was last updated by  hamdullahshah 1 year, 11 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
Author Posts
Author Posts
April 16, 2012 at 7:53 pm #240733

eviltuna
Participant
@eviltuna

Hey guys, I’m doing a game where I need to add ALOT of customization to the player’s avatar and wasn’t quite sure of how to do this. What I was thinking was making the avatar sprite with starting clothes then just layer new sprites over it as new items are bought, but I was thinking would I need to make different animations for every single piece of added clothes as the avatar moved?

Any input would be appreciated.

April 17, 2012 at 1:45 am #372929

bigubosu
Participant
@bigubosu

I see what you mean. I have a similar game that I want to do where a character can have different clothes, weapons etc as they progress.

Maybe if it’s too much you can look into how Tiny Tower uses the same sprite to make the person look different.

http://brandontreb.com/Pixel-Art-Character-Tutorial-Create-A-Bitizen/

April 17, 2012 at 2:39 am #372930

eviltuna
Participant
@eviltuna

I was actually thinking of something like in My Pet Zombie (http://itunes.apple.com/ca/app/my-pet-zombie/id424615076?mt=8) where you can buy different clothes for your character.

April 25, 2012 at 5:05 am #372931

Brian Robbins
Participant
@dubane

We didn’t use Cocos2D for My Pet Zombie, but I’ll explain our general methodology as it should be something you can map to Cocos2D.

We have an underlying skeleton for the character, this is each of the individual parts – torso, head, upper arm, forearm, hand, etc. Our animations defined where each of those limbs should go as they move around.

The “attachments” for each of the clothing options are then attached as a child to the appropriate object on the skeleton. So a new hairdo is setup as a child of the head. Some objects like shirts have multiple pieces each attached to the appropriate body part. By setting them as a child of the body part, they automatically move with the body part and don’t need to be individually animated.

Hope that helps!

April 25, 2012 at 5:33 am #372932

hamdullahshah
Participant
@hamdullahshah

@Brian Robbins

Can you please suggest an example of such kind of animation in cocos2d…. Thanks

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.