collinhover / impactplusplus

Impact++ is a collection of additions to ImpactJS with full featured physics, dynamic lighting, UI, abilities, and more.
http://collinhover.github.com/impactplusplus
MIT License
276 stars 59 forks source link

Player Multi Entity #162

Closed CarlosX closed 10 years ago

CarlosX commented 10 years ago

anyone have any idea how to create this entity

player combine

mh00000 mb00000 armor

Pattentrick commented 10 years ago

Can you be more specific? What is your goal? You can make an animation sheet that will combine all states seen at your post and swap the animations as needed with only one entity. Or you could use multiple entities (head, body, machine) and try to "synchronize them". It's hard to give you an advice without more information about what you are trying to do.

CarlosX commented 10 years ago

is like a rpg .. you equip a hat and head change.. but I want to know if there is any way to do this without creating multiple entities something like this http://impactjs.com/forums/code/layered-animation-sheet

collinhover commented 10 years ago

At the moment ++ does not support multi part entities. You can certainly do it without creating multiple entities. Without testing it myself, I'd guess you'd need to modify the update animation and draw methods of an entity to call themselves once for each part and swap out the animation sheet, anims, size, and offset.