Best way to do this?

Donni11

  • *
  • Posts: 2181
Hello,

So in my game I'm trying to figure out the best method to use for the actor to equip weapons.

1. Create 50 animations of the actor with the weapon and change it to those animations with the actor collides with the weapon.

2. Anchor the weapon the the x and y of the actor.

For those who have done this sort of thing before, I'd really appreciate if you'd left a comment of which one works best.

Thanks,
Peace

merrak

  • *
  • Posts: 2719
Anchoring would save you the trouble of drawing all those animations, but the coding can be finicky. As with a lot of "best approaches" questions, it comes down to the specifics. Do you want a lot of variety in the weapons and animations? # of animations x # of weapons could get out of control quickly. Are you comfortable with the necessary anchoring code?

squeeb

  • Posts: 1617
Sorry to but in :D I was wondering the same thing.  I have the torch apdated to the player... kind of works... what if I set the x and y by what frame the animation is on for the player and move the torch to the hand on each animation frame?
Or if anyone has better ideas :) I don't really want to make walk and idle animations  just to have a torch

Donni11

  • *
  • Posts: 2181
 So I figured out if I went with animation, I'd have to draw 148 animations. It seems better to go with anchoring. However this might end up complex code because I'd have to anchor it perfectly and change the rotation based on what the player is doing. And at the same time, I have to make it look as if the player is actually holding a weapon.  Are there any behaviors out there that support this?
I'm sure someone down the line who was using Stencyl wanted to do this as well.
Peace

stefan

  • *
  • Posts: 2263
This is all basic math really. I can't work out a behavior for you now (waiting for my system to be fixed), but perhaps this is something to work into a tutorial ;)

twotimingpete

  • *
  • Posts: 1667
I've done something with glowing elements on characters (e.g., the visor of a character glowing in the dark) that one could use to make different equippable weapons -- depending on how many weapons and how much animation the game has, it might be practical.

I make a full set of animation frames for just the glowing element that can be laid perfectly on top of the regular actor. So at the art creation I animate that element along with all the various frames, and then when I make spritesheets out of it I isolated the glowing element into one sheet and the character onto another sheet.

the lamps on his suit and the reflections on his body are one actor, and the character himself is another actor.