How to prevent multiple fire button event...

Started by xboxisfinished, February 25, 2019, 05:55:39 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

xboxisfinished

I am writing a tic tac toe game and so far I have managed to do 98% of the joystick event, checking to see if you already placed a piece there and to avoid moving the character outside the board. My problem is when you start the game the first time only and only the first time and you press the joystick button and you keep holding the joystick button it places both player 1 and 2 at the same spot. But after that it works normally no matter how hard you press the joystick button it will not place player 1 and player 2 on the same spot if it is occupied by either player.

So my question is how to make it that you need to physically left your finger and press the joystick button in order for it to trigger again and refuse to trigger joystick button when you keep holding the joystick button?

Thanks in advance.

Volvo_0ne

#1
J=Joy(1)
If J=16
      Repeat : Wait 5 : Until Not Joy(1)
      Rem Do whatever "fire" does here.
Endif

Should do it (adjust the Wait period as needed)

Transuranic heavy elements may not be used where there is life.

xboxisfinished

Quote from: Volvo_0ne on February 26, 2019, 06:19:19 PM
J=Joy(1)
If J=16
      Repeat : Wait 5 : Until Not Joy(1)
      Rem Do whatever "fire" does here.
Endif

Should do it (adjust the Wait period as needed)
Duuh! - slaps forehead - I  cannot believe I have not thought of that! - sigh - And I call myself a programmer!

THANK YOU SO MUCH!! :D