Simple Melee attack

Onenoodle

  • Posts: 84
Does anyone know how to make a simple melee attack for a side scroller?
Or an easy way to edit the gun firing in gun and run examples to not use weapons and just switch the animation.

Basically all I need is:
When you click the attack button, the actors animation switches to "attack animation right/left".
And then after the animation has played, it goes back to the idle animation etc. When attacking it deals damage to the enemy in front if they are close enough.

Very simple, but I can't seem to find a behavior in stencylforge that works like this.

Can anyone help out? Would be very appreciated :)

Hectate

  • *
  • Posts: 4643
I don't think you read my reply to this question in the other thread as you did not reply.

You could do something like that. Maybe make it so the "bullet" is actually a slash in the air. Make that "bullet" not move at all, and disappear quickly, but damaging any enemies first.
:
:
Patience is a Virtue,
But Haste is my Life.
Proud member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.

Storbusaren

  • Posts: 108
I solved that "problem" yesterday. I used the attack behavior from the RPG-game example, and changed it a little. If you study that behavior a little, you'll probably see what needs to be changed :)

Maybe I can upload the modified version on the forge

« Last Edit: November 01, 2012, 01:33:52 am by Storbusaren »

Onenoodle

  • Posts: 84
I don't think you read my reply to this question in the other thread as you did not reply.

You could do something like that. Maybe make it so the "bullet" is actually a slash in the air. Make that "bullet" not move at all, and disappear quickly, but damaging any enemies first.
I read it but It doesn't help me a lot unfortunately. :/ Still don't know what code blocks to use to do such a thing.

I solved that "problem" yesterday. I used the attack behavior from the RPG-game example, and changed it a little. If you study that behavior a little, you'll probably see what needs to be changed :)

Maybe I can upload the modified version on the forge
Really? nice. I would really appreciate it if you could!
There is no weapon correct? just switches to a different character animation?
My character has his weapon already.

Onenoodle

  • Posts: 84
Also Storbusaren,
Are you building off the run and gun example?

Storbusaren

  • Posts: 108
It's necessary to have a separate sword actor, because you probably don't want your feet or head for example to deal dmg. The sword should be in another collision group.

And no, i don't build from any example.

Onenoodle

  • Posts: 84
Ok. I guess I could just make an invisible sword actor? Can you upload the behavior to stencylforge for me? If it works, I may be able to set up some compensation for you.

Storbusaren

  • Posts: 108
Hehe, some compensation.. I can't now though, hopefully tonight. That means about 15:00 stencyl-forum-time.

Onenoodle

  • Posts: 84
Haha yes. Well, let me you when you do :)
Will be awesome :) Thanks.

Storbusaren

  • Posts: 108
Uploaded. It's called "Sidescroller Sword Attack".

Onenoodle

  • Posts: 84
Legend! Thank you :)
I'll let you know how it goes.
Thanks Heaps.

Onenoodle

  • Posts: 84
You are a legend! The behavior works well. Just one problem. The attack animation doesn't play. It just glitches kind of.
Any idea?

Storbusaren

  • Posts: 108
Do you mean the "player attack animation" or the "sword attck animation"?

Onenoodle

  • Posts: 84
The player attack animation.

Onenoodle

  • Posts: 84
The behavior works fine which is awesome. Only problem is the animation. The player actor animation just glitches for a sec. It doesn't play the actual animation, just makes the actor disappear for a second.