when gf clicked set [space v] to (0) when [space v] key pressed set [space v] to <(1) - (space)> if <(space) = (1)> show variable [score v] else hide variable [score v] endIs that what you want/mean?
Offline
Assuming that your score is shown in a variable called score:
(score)Make another variable:
(ScoreShown)Then:
When [space v] key pressed if <(ScoreShown) = [0]> show variable [score v] set (ScoreShown) to [1] else hide variable [score v] set (ScoreShown) to [0] endEDIT: Aww I was late... also that thing Magnie did with set space to 1 - space is good since it reduces blocks needed overall by one. You would use it instead of scoreshown and after the if/else.
Last edited by Smozzick (2012-02-09 16:54:25)
Offline
You will need a sprite-only variable ( I named it H/S )
{Start of script}
When [Space key pressed]
If <(H/S)=Hide>
Set [H/S] to (Show)
Show [Variable]
Stop Script
{End of if}
If <(H/S)=Show>
Set [H/S] to (Hide)
Hide [Variable]
Stop Script
{End of if}
{End of script}
EDIT: Or you could do this
{Start of script}
When [Space key pressed]
If <(H/S)=Hide>
Set [H/S] to (Show)
Show [Variable]
{End of if}
else
Set [H/S] to (Hide)
Hide [Variable]
{End of else}
{End of script}
Last edited by laptop97 (2012-02-09 16:56:54)
Offline
When [space v] key pressed if <(variable) = [1] > hide variable [whatever] set [variable] to 0 else show variable [whatever] set [variable] to 1
Last edited by CheeseMunchy (2012-02-09 20:06:42)
Offline
GiovanH wrote:
The easiest way is this:
When space pressed
Forever
Show Variable
Wait until space pressed
Hide Variable
/Forever
So, when I press space it begins the script and shows the variable. Then, I press space again, and it hides the variable. But it loops, so it shows it again.
This way works:
when gf clicked forever show variable [var v] wait until <key [space v] pressed?> wait until <not <key [space v] pressed?>> hide variable [var v] wait until <key [space v] pressed?> wait until <not <key [space v] pressed?>>Or this way:
when gf clicked hide variable [var v] when key [space v] pressed wait until <not <key [space v] pressed?>> show variable [var v] wait until <key [space v] pressed?> wait until <not <key [space v] pressed?>> hide variable [var v]
Last edited by rdococ (2012-02-10 17:04:11)
Offline