Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » If list is showing then...
- cookiegr
- Scratcher
100+ posts
If list is showing then...
I need a script for my game here:
http://scratch.mit.edu/projects/11589335/
The list called backpack will have the items that the person currently has, but I need a script so when the backpack list is showing if a certain sprite is clicked, then it will do something. I also need one for when the backpack list is not showing.
http://scratch.mit.edu/projects/11589335/
The list called backpack will have the items that the person currently has, but I need a script so when the backpack list is showing if a certain sprite is clicked, then it will do something. I also need one for when the backpack list is not showing.
- scubajerry
- Scratcher
1000+ posts
If list is showing then...
If I understand your request, there is no way to test for a list showing. You can make a variable that you keep track if you have told the list to show or hide. Then you can test that variable.
- birchyboii
- Scratcher
100+ posts
If list is showing then...
Whenever a script hides the list set (showing list? v) to no
Whenever a script shows the list set (showing list? v) to yes
Whenever a script shows the list set (showing list? v) to yes
- scubajerry
- Scratcher
1000+ posts
If list is showing then...
Say [ I want to show the list]
Show list (my_list)
Set (list_showing) to [YES]
Say [I want to hide the list]
Hide list (my_list)
Set (list_showing) to [NO]
Say [now to use my variable]
When this sprite clicked
If <(list_showing) = [YES]> then
Do the list showing stuff
else
Do the list now showing stuff
End
- Discussion Forums
- » Help with Scripts
- » If list is showing then...