This is so simple but it won't work. Does anyone know a way I could make this work?Code:User clicks with right button
Soldier is stopped
Soldier -> movement start
User clicks with right button
Soldier is not stopped
Soldier -> movement stop
Printable View
This is so simple but it won't work. Does anyone know a way I could make this work?Code:User clicks with right button
Soldier is stopped
Soldier -> movement start
User clicks with right button
Soldier is not stopped
Soldier -> movement stop
It's because the game quickly checks when you're pressing the button. It will activate both conditions within the time you press the key.
I would use the key to toggle a flag. Then when the flag is either on or off, switch the movements.
Sent from my iPhone using Tapatalk
User clicks with right button
Soldier is stopped
Soldier -> movement start
Flag 0 is off
User clicks with right button
Soldier is not stopped
Soldier -> movement stop
Flag 0 is off
Then add an action to each: "Turn flag 0 on".
Lastly, create an additional event:
Flag 0 is on: Turn Flag 0 off.
I tried this and maybe I didn't understand but it did not work. Can I have an example please?
User clicks with right button: toggle flag 0
Flag 0 is ON:
Soldier movement start
Flag 0 is OFF:
Soldier movement stop
Sent from my iPhone using Tapatalk
Thank you it works now. But now the player can go out of bounds, how can I prevent this?
Test position of player. Click all the arrows that point outside the sides of the frame.
The condition now will read "when active leaves the play area" (or something similar to that)
Then stop the player.
Sent from my iPhone using Tapatalk
That is what I originally had it and now it is broken.
When player leaves the play area: set flag off?
Sent from my iPhone using Tapatalk
This way will work if you're not using the current status of the timer for anything.
User clicks with right button
Soldier is stopped
Timer is greater than 0.02
Soldier -> movement start
Set Timer -> 0
User clicks with right button
Soldier is not stopped
Timer is greater than 0.02
Soldier -> movement stop
Set Timer -> 0