Hey guys!
How can we make hero customizable? (considering that it has many animations: walk, jump, shoot, etc.)
First thing that came to mind is to create duplicate MovieClips, like
hero.mc=MovieClip.new --etc...
hero.mcRedShirt=MovieClip.new --etc..
hero.mcGreenShirt=MovieClip.new --etc.. |
Then after user gets red shirt, we assign:
Or maybe switching texture pack is better?
heroTPack=TexturePack.new("heropack.txt","heropack.png",true)
heroTPack=TexturePack.new("heropackRED.txt","heropackRED.png",true)
heroTPack=TexturePack.new("heropackGREEN.txt","heropackGREEN.png",true)
hero.mcRedShirt=MovieClip.new --all frames we get from heroTPack |
Then after user gets red shirt, we assign:
heroTPack=heroTPackRED --(I'm not sure if MovieClip will instantly switch texture, or it should be reloaded?) |
Any better solutions?P. S. And can we make different wardrobe items customizable?
Let's say hats, pants, t-shirts, there will be lots of combinations, it will be too complicated to manage so many movieclips or texture packs.
Comments
switching texture pack seems to be a good option as of now.
Fragmenter - animated loop machine and IKONOMIKON - the memory game
I do that for this:
Likes: Apollo14
https://deluxepixel.com
If customization is really for the player then you could use a RenderTarget, draw the hero base to it, then add hats and clothes etc.. then use that texture for your Bitmap.
If you can use Spine that would be easier though
Likes: Apollo14, Favfly
Spine працює в гідерос, тільkи ящо анімація без мешів (сітоk)
Apollo14
яб на твоємe місці зробив оkрему анімацію MovieClip для руk, голови, ніг, тулувоща - а потім зібрав всі ці анімації в 1 спрайт і ним вже рухав, а kоли треба змінити теkстуру міняв тільkи анімацію тулувища
Likes: Apollo14
https://play.google.com/store/apps/developer?id=razorback456
мій блог по гідерос https://simartinfo.blogspot.com
Слава Україні!
(I totally didn't get the idea ) Thanks @oleg ! Definitely I should try different movieclips for different body parts of hero. I'm not sure how manageble it will be, but I think it's worth testing.
"What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
“The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
How to properly switch texturepacks?
I've managed to work only movieclip switching. And I have to remove movieclip from parent every time, and then add it again. Can we reload movieclip without removing/adding it from parent?
(anyway if we could switch texturepacks, it would be much better, no need to create lots of movieclips)
"What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
“The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
Likes: Apollo14