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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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