Make key combination to launch skills

Get help using Construct 2

Post » Wed Nov 14, 2012 7:22 pm

I would like to make keys combination in order to launch skills in a fighting game.

for example :

down -> right -> B = fire ball

any tips ?
B
14
S
5
G
4
Posts: 15
Reputation: 3,794

Post » Wed Nov 14, 2012 8:09 pm

Yeah its super easy.

Create an event, and then right click it and use "add condition" then add your second condition.
eg:
keyboard button "Down" is pressed
keyboard button "right" is pressed
repeat to add a third condition
keyboard button "b" is pressed ->do fireball

now the fireball will only occur if all keys are currently pressed.justifun2012-11-14 20:11:05
B
50
S
21
G
8
Posts: 844
Reputation: 10,299

Post » Wed Nov 14, 2012 9:46 pm

I'll give you a nice tip !
Go check the beginners tutorial before starting your game :3 !

Cheers !
B
35
S
16
G
16
Posts: 2,222
Reputation: 16,589

Post » Wed Nov 14, 2012 10:21 pm

The thing is, i don't want these keys to be hold at the same time to launch the skill, i want to press one by one the keys.

press "DOWN", THEN press "RIGHT", THEN press "A" and THEN the fireball is launched.

And when you make an event "Keyboard - On key pressed" the only new condition available is "key down", it doesn't help very much.
B
14
S
5
G
4
Posts: 15
Reputation: 3,794

Post » Thu Nov 15, 2012 2:57 am

Your going to need to store your input into a array or some list that you can look back on. Create an array that can store about 1/2 seconds of input.
Every input should be stored into the array.

When a movement key input(like punch) is pressed. Then track the the movement backwards to make sure only wanted input is used.
B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834

Post » Thu Nov 15, 2012 3:39 pm

OK. so I gave this one some more thought. rather than store every tick of directional input. Store each change of input with a timestamp. That way you have to store less and can check to see if the time stamp is within the range of the move.
B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834

Post » Thu Nov 15, 2012 3:49 pm

I'll try something in this direction, thanks !
B
14
S
5
G
4
Posts: 15
Reputation: 3,794

Post » Thu Nov 15, 2012 6:15 pm

There's actually a plugin for this very thing that rexrainbow made. You can check it out here:

Sequence MatcherTL222012-11-15 18:15:55
B
58
S
20
G
7
Posts: 305
Reputation: 8,804

Post » Thu Nov 15, 2012 7:50 pm

Well this is exactly what i need, thank you very much !
B
14
S
5
G
4
Posts: 15
Reputation: 3,794


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 0 guests