Am I thinking about this right? - Attack Animation

Get help using Construct 2

Post » Sat Feb 16, 2013 12:07 am

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
MOO
B
14
S
4
G
4
Posts: 53
Reputation: 3,862

Post » Sat Feb 16, 2013 12:39 am

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.
B
94
S
29
G
11
Posts: 1,545
Reputation: 20,993

Post » Sat Feb 16, 2013 12:41 am

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?
MOO
B
14
S
4
G
4
Posts: 53
Reputation: 3,862

Post » Sat Feb 16, 2013 12:42 am

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'dArima2013-02-16 00:43:01
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Sat Feb 16, 2013 12:43 am

Here is a youtube video showing hit boxes in Street Fighter II.
http://www.youtube.com/watch?v=Hm27UlelexI

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.ArcadEd2013-02-16 00:44:27
B
94
S
29
G
11
Posts: 1,545
Reputation: 20,993

Post » Sat Feb 16, 2013 12:50 am

Thanks guys. I will have to take a look at that video tonight. Along with your other beginner vids there ArcadEd :P
MOO
B
14
S
4
G
4
Posts: 53
Reputation: 3,862

Post » Sat Feb 16, 2013 2:13 am

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.
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,428

Post » Sat Feb 16, 2013 2:28 am

I hear a lot about this Spriter thing. What is that?
MOO
B
14
S
4
G
4
Posts: 53
Reputation: 3,862

Post » Sat Feb 16, 2013 9:43 am

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
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,428


Return to How do I....?

Who is online

Users browsing this forum: christina, Google [Bot], Yahoo [Bot] and 21 guests