keyboard count

Get help using Construct 2

Post » Sat Jul 07, 2012 8:03 pm

is there a way to count how many keyboard button is pressed??
B
48
S
15
G
6
Posts: 795
Reputation: 12,035

Post » Sat Jul 07, 2012 8:38 pm

At once or over time ?
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Sat Jul 07, 2012 8:42 pm

I don't see how this would be solved without plugin.
B
16
S
6
G
6
Posts: 100
Reputation: 4,840

Post » Sat Jul 07, 2012 8:48 pm

@Yann , at once like for example i clicked on igtfouh89jmr it will count 12 if i took 1 finger off and made it like this : igtfouh89jm it will be 11 and so on ^^


@Julmust , which plugin if keyboard , yes i want to use keyboard ^^ but how can i do it :) i tried compare values but failed :(
B
48
S
15
G
6
Posts: 795
Reputation: 12,035

Post » Sat Jul 07, 2012 9:30 pm

Most keyboards can only detect about 3 simultaneous key presses. So this doesn't sound very useful. What do you need it for?
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Sun Jul 08, 2012 3:33 am

@Ashley , i want to make that player can't use more than one key on the keyboard for example when he jump he can't move left or righ and when he move he can't jump and so on also when he attack he can't jump or move and so on in all actions ( im thinking of doing 5+ actions depend on how many events i got ) and if this can made i can use alot of these stuffs ^^ i know it can be done by these condtions :
player is NOT moving + space is pressed then jump
and attack :
player speed = 0 + Z is pressed then attack
but the other actions will be harder to do this...
B
48
S
15
G
6
Posts: 795
Reputation: 12,035

Post » Sun Jul 08, 2012 5:51 am

You can have a boolean named "Acting" you switch to true when you start any action. And then you just have to put all you action triggers in a sub event of "is Acting"
Then you just have to have a condition checking that the character isn't doing anything to switch "acting" back to false.
If you have more complew locking relationship you just need to add other booleans to check states.
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Sun Jul 08, 2012 6:34 am

@Yann,
i know it can be done by variables but the problem each is each key will have more than one action for example Z key will be attack , power , defense ,... and X will jump and climb and double jump and so on...

so instead of checking for each actions ,why can't i disable the buttons?
B
48
S
15
G
6
Posts: 795
Reputation: 12,035

Post » Sun Jul 08, 2012 3:02 pm

Then you can have a boolean per key you switch to true on key pressed to lock the other key pressed event.
Having an action like "disable key" will basically do the same thing under the hood I think.
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Sun Jul 08, 2012 3:05 pm

i see so its just can done with variables , thanks for the idea ^^
B
48
S
15
G
6
Posts: 795
Reputation: 12,035

Next

Return to How do I....?

Who is online

Users browsing this forum: flemmig and 33 guests