Am I thinking about this right? - Attack Animation

0 favourites
  • 9 posts
From the Asset Store
Zombie attack is a survival game, where you have 2 types of games: Killer and survival.
  • So I am in the planning stages of a 2D forced perspective Action RPG, akin to Legend of Mana and the upcoming indie game Cryamore.

    More like Legend of Mana in design. If you have no idea what that is look it up on Youtube, amazing game.

    I was pondering, however, how attack animations would work with melee weapons in a side scrolling action game. My first thought, and I am hoping I am correct here, would be to have the weapon sprite as a seperate entity, and have the player spawn the weapon sprite (at a particular animation, lets say SWING) while they animate the attack animation.

    Am I correct in thinking this is how it would work? Because if I have the player themselves animated with a sword, then having them hit an enemy would trigger both themselves getting damaged as well as the enemy, which says to me that the weapon sprite must be seperate, but I must also seamlessly integrate it with the sprites attack animation somehow. Not sure how I will do this (I assume spawn at image point)

    And then there is doing multiple animations so it doesnt feel stiff, but that is something else I will worry about once I figure this out 0_0

  • You could also use collision boxes. This is what a lot of fighting games use. You just create a sprite that is a box/rectangle and have it spawned invisible and use that to check collision. Have different image points on your animations and spawn the boxes to those image points.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Now this I had not thought of. So a box for the main character sprite (lets call it PlayerColl) and then a box that spawns around the sword to check on collison when the swing happens? How would I keep the box pinned to the sword in that case to make the swords shape (or weapon shape) match for collison?

  • Look into action points, they work great for having swappable weapons and such for animations.

    About the player hitting themselves, which I'm assuming is because you have all units in the same family or they're all the same object, all you need is a variable to check if it should hit or not.

    If sword overlaps unit

    Unit variable 'team' is not equal to "heroes"

    • hit unit

    Edit: ninja'd

  • Here is a youtube video showing hit boxes in Street Fighter II.

    youtube.com/watch

    it depends how accurate of a collision you want. The video might explain it better as you can see the boxes are actually larger then the arm. But are also only active on certain frames of the animation.

  • Thanks guys. I will have to take a look at that video tonight. Along with your other beginner vids there ArcadEd :P

  • I have been thinking about this for awhile as one of my upcoming projects is very similar. Think Wanderers from Y's side scrolling action RPG.

    My approach is to create attack animations for the character and then pin the weapon to their hand. The weapon has instance variables for weaponType and damage. In each frame of animation I make sure the pin point is in the right spot. I may have to change this when I start moving to spriter for animations.

    When the enemy is hit, it checks for weaponType to see if it should be hit in the first place, and then uses the weapons damage variable to take damage.

  • I hear a lot about this Spriter thing. What is that?

  • Spriter allows you to create animations based on keyframes. It has a lot of functionality like creating boned animations (create bones and attach images to them) that allow you to assign rotations, joints etc... and then just make your animation keyframes, and it takes care of all the in between frames (tweening). Great tool. Check out the site: BrashMonkey - Spriter

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)