Discuss Scratch

hamsandwichthefox
Scratcher
5 posts

On/off mechanic

I am designing a game where if you press space it opens or closes a menu, but I am unclear of how to do that. Do you know how to?
SpeedSpot
Scratcher
18 posts

On/off mechanic

You could set a variable with an on/off or 1/0 setting to represent whether it is open or closed.
when green flag clicked
set [Menu v] to [0]

when [space v] key pressed
if <[Menu] = [0]> then
set [Menu v] to [1]
show


else
set [Menu v] to [0]
hide

end
I think this would work.

Powered by DjangoBB