How do I make a melee attack?

Get help using Construct 2

Post » Sun Mar 09, 2014 8:45 am

Hello,

I am sure this has been asked before but I couldn't find it in the forums.
Can someone tell me how to create a melee attack for a platform game?

Thank You
@coyowl

coyowl.com

Game studio with a portfolio of 3 Apple Featured games.
B
31
S
7
G
2
Posts: 111
Reputation: 2,417

Post » Sun Mar 09, 2014 8:51 am

Use instance variables.
If melee =1 and action pressed-Do melee attack.
I will not let you reach the sisters
Nature Forums
B
11
S
5
G
2
Posts: 496
Reputation: 2,306

Post » Sun Mar 09, 2014 8:53 am

Yes but how do I actually make it.
For example:

Do I spawn a bullet with a range limit?
Do I spawn an object in front of my character?

Sorry but I haven't done this before, what's the logic?
@coyowl

coyowl.com

Game studio with a portfolio of 3 Apple Featured games.
B
31
S
7
G
2
Posts: 111
Reputation: 2,417

Post » Sun Mar 09, 2014 9:01 am

skozax wrote:Yes but how do I actually make it.
For example:

Do I spawn a bullet with a range limit?
Do I spawn an object in front of my character?

Sorry but I haven't done this before, what's the logic?

You said you want to do a melee attack,use different animation frames to do that.

Why do you need to spawn an object?
If you want to do that,You can use another instance variable.
I will not let you reach the sisters
Nature Forums
B
11
S
5
G
2
Posts: 496
Reputation: 2,306

Post » Sun Mar 09, 2014 9:07 am

"Why do you need to spawn an object?"

How are the enemies are going to be affected? They have to collide with something to hurt them, right?
I know It must be very simple but I still don't get it. Maybe there is a simpler method than the one I have in mind.
If you can, please explain.

Thanks
@coyowl

coyowl.com

Game studio with a portfolio of 3 Apple Featured games.
B
31
S
7
G
2
Posts: 111
Reputation: 2,417

Post » Sun Mar 09, 2014 9:15 am

I think skozax is asking how to make a melee attack that can be interacted with. @skozax, try going into your melee attack animation and adding an image point over the character's fist (or whatever you hit with). Then create another small sprite about the size of the character's fist, set invisible.

Then it's: When character's animation ("melee attack") is playing > Set (fist sprite) position to character's image point (fist). Then you can base your collisions etc around the fist sprite.

Something like that should work :)
B
15
S
4
G
1
Posts: 286
Reputation: 1,988

Post » Sun Mar 09, 2014 9:18 am

Just a collision event will also work.Each animation frame can have different collision polygon.
I will not let you reach the sisters
Nature Forums
B
11
S
5
G
2
Posts: 496
Reputation: 2,306

Post » Sun Mar 09, 2014 9:22 am

(Forgot about collision polygons :oops: )
B
15
S
4
G
1
Posts: 286
Reputation: 1,988

Post » Sun Mar 09, 2014 9:38 am

Thank you all for your help!
@coyowl

coyowl.com

Game studio with a portfolio of 3 Apple Featured games.
B
31
S
7
G
2
Posts: 111
Reputation: 2,417


Return to How do I....?

Who is online

Users browsing this forum: amazingdream and 25 guests