I want to toggle something, but i can't find how to do it in Construct.
I would like to execute this code in Construct:
if (GetAsyncKeyState(VK_F1)&1) mVisible=(!mVisible);[/code:rk2ljp33]
Are you trying to use Python or Events?
Develop games in your browser. Powerful, performant & highly capable.
Easiest way would be:
variable = 1 - variable
With variable being either 0 or 1, it will always toggle (1 - 0 = 1, 1 - 1 = 0)
I think what you want is Mouse & Keyboard's Control State.
+ MouseKeyboard: On player 1 pressed "Control 1"
-> Do this
+ System: MouseKeyboard.ControlState("Control 1", 1)=1
Note you will have to define the key in preferences for F1.