Player combat please help

Get help using Construct 2

Post » Thu May 18, 2017 12:56 am

Hello what would the proper way to make the player do attacks like this? Thanks


Basic attack

Combo attack (if button pressed simultaneously)

And a charge attack (if button is held down)
B
16
S
5
G
1
Posts: 31
Reputation: 1,608

Post » Fri May 19, 2017 5:13 pm

Bump
B
16
S
5
G
1
Posts: 31
Reputation: 1,608

Post » Fri May 19, 2017 6:01 pm

The basic attack should be simple to make. Add a mouse or a keyboard object, and on key press event add your attack actions.

The combo attack its a bit tricky, I'm not sure when you want to be usable, but lets say you can use combo when enemy is bellow 5 hp and you need to press left click mouse and q at the same time.

First you add a global variable called combo attack set it to 0 on start, also you will need to add a instance variable to the enemy we gonna call it bellow_50 set it also to 0 on start, then add an event with conditions, left mouse pressed, q pressed, combo attack is 1 and enemy instance variable bellow_50 is 1. After that you add another event which checks if enemy is bellow 50%, and add the actions global variable combo attack set to 1, enemy instance variable set to 1. When this to are set to 1, then you can combo attack the enemy, go back to the combo event check and add your actions.

For the charged attack, add a global variable called charged, add an keyboard event when key is being held down, add another condition every 0.5 seconds add ad to action to increment the global variable charged by 1. Now you will need another event when key is being released, as action add damage + global variable charged, this will add all that extra damage to the attack. and you reset the variable to 0 after that.

I think that should be it, but take a note this is advanced construct stuff and its hard to implement, it will take a good event scripting and trail and error's until you get it right.
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


Return to How do I....?

Who is online

Users browsing this forum: nahima and 8 guests