How do I have my player attack?

Get help using Construct 2

Post » Thu Jun 08, 2017 2:59 pm

I want it so when the player presses 'space' the player goes through an attack animation and when it collides with the enemy it subtracts health from it, to ti then reverting back into the normal idle position for the player to progress with the game. I tried a tutorial of Jerminator online but it hasn't worked. Help please. Its a sidescroller metroidvania game and the attack is a melee.
B
2
Posts: 6
Reputation: 162

Post » Thu Jun 08, 2017 3:35 pm

First you need to have the animation for the sprite, after that you will need a separate sprite pinned to an image point near the weapon for collision detection. Then you add an keyboard object to your project and add an event on key space pressed, and as action play the animation, make a wait system expression( 2 seconds or something like that), and reset the animation back to default.

As a sub event add the collision detection, use the sprite pinned to the image point and check if its touching the enemy, if it does subtract from his heath.
Like my work? Fallow me on social media, and see my games on the arcade.
B
7
S
5
G
9
Posts: 298
Reputation: 5,367

Post » Thu Jun 08, 2017 4:13 pm

Alright, seems legit, ill give it a go, thanks!
B
2
Posts: 6
Reputation: 162

Post » Thu Jun 08, 2017 4:24 pm

If its okay can you show me a screenshot of what these events would look like?
B
2
Posts: 6
Reputation: 162

Post » Thu Jun 08, 2017 4:53 pm

Well I cant make the events without the sprite animation, if you can send me the player and all of its animation I can make an example capx file.
Like my work? Fallow me on social media, and see my games on the arcade.
B
7
S
5
G
9
Posts: 298
Reputation: 5,367

Post » Sun Aug 06, 2017 1:30 am

Bahamur wrote:If its okay can you show me a screenshot of what these events would look like?


What kinda of attacks are you trying to do? Shooting, sword combo attack, punching... depending on what you wanna do will change how the events come together
B
17
S
4
Posts: 86
Reputation: 1,211


Return to How do I....?

Who is online

Users browsing this forum: dop2000, Maako and 5 guests