How do I use 1 function simultaneously?

Get help using Construct 2

Post » Sun May 04, 2014 5:36 pm

If I have a function that gets called when a keyboard key are held down and the same function gets called when another key are held down...
...is this possible?

I use a function that should do things to a player object when I press a key. It's about steering an object with the arrow-keys.
But I have 2 players, and when Player1 and Player2 steer left at the same time - it does not work. ( yes the Player2 has other keys assigned :) )
I guess the function can not be called like that "at the same time" ?

Each call (for Player1 and Player2) gets different parameters. And the function works fine if only one player steer left or right, but if both steer at the same direction at the same time, it does not.
I have 2 functions, one for "SteerLeft" and one for "SteerRight"

I guess I have to do this in a different way somehow. I wonder how the mechanics that are in progress here works when the function get calls at the same time?
If anyone can explain, I'll give you a HUG! :)

///Soulmachine!
Soulmachine @Soundcloud
B
14
S
2
G
1
Posts: 63
Reputation: 928

Post » Sun May 04, 2014 8:52 pm

I have done some simple experimenting and found that it IS possible to call the same function "simultaneously" and to steer a Player1 and Player2 at the same time using the same function.

I created a totally clean project and had only the controls and a simple function - it worked.

then my problem depends on something else - at least I know this now. :)
Soulmachine @Soundcloud
B
14
S
2
G
1
Posts: 63
Reputation: 928


Return to How do I....?

Who is online

Users browsing this forum: AllanR, Artcadev and 13 guests