Jump to content

Phaser and custom clothing/weapons


Jonchun
 Share

Recommended Posts

I've been browsing everything I could find about phaser supporting this custom clothing/weapons, but I can't seem to come up with anything.

 

 

The one solution I've found would be to create an animation tilemap for all the different animations, then create another tilemap with weapons/gear/etc with every frame and then overlay the sprites, but that seems awfully unscalable. 

 

I would LIKE to edit animation frames and edit rotation/offsets per frame so that I can just use a single sprite and sync them with my animations. 

 

 

I've seen Spine and other 2d skeletal animation tools, but that's not exactly what I want either. 

 

Here's an example of basically what I want (taken from the game MapleStory):

Tilemap:

http://www.mapleme.net/cachev156.0/images/Body/00002000.png

JSON:

http://www.mapleme.net/cachev156.0/data/pnginfo/Body/00002000.json

 

As you can see the json contains offset data for each frame of the animation. 

 

 

Is something like this even possible with Phaser? If not, what's the next-best alternative?

Link to comment
Share on other sites

Every sprite in Phaser is also a group and can have children added to it. This extends the scene graph of the world down into and through the sprites. So, yeah, you use a second (and third and fourth and...) sprite to be the weapon/clothing, add it to your sprite, and go from there.

 

Just like you said, though, you'll have to sync the animation of the clothing to the parent yourself.

 

In my game, when the player picks up a mask or a weapon that's how I do it. ¯\_(ツ)_/¯

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...