Discuss Scratch

balii
New to Scratch
6 posts

help with assignment?

Can you guys help me im struggling a bit haha..
im trying to hide and show a certain list by pressing s.
so, when i press s the list will show on the screen, and when i press it again, it will disappear.
Do you know how to do this?
scubajerry
Scratcher
1000+ posts

help with assignment?

Is this the whole assignment? A hint is you need a variable to keep track of the state of the list's visibility.
balii
New to Scratch
6 posts

help with assignment?

no its just a part of an assignment haha.. and yeah ive tried using a counter.. still not working for me.. any more hints?
scubajerry
Scratcher
1000+ posts

help with assignment?

when green flag clicked
Set [visible v] to [1]
show list [my_list v]

when [s v] key pressed
set [visible v] to <[1] - (visible) //this toggles between 1 and 0
if <(visible) = [1]> then
show list [my_list v]
else
hide list [my_list v]
end
Blaze349
Scratcher
1000+ posts

help with assignment?

balii wrote:

Can you guys help me im struggling a bit haha..
im trying to hide and show a certain list by pressing s.
so, when i press s the list will show on the screen, and when i press it again, it will disappear.
Do you know how to do this?
when green flag clicked
forever

wait until <key [s v] pressed?>

wait until <not <key [s v] pressed?>>

show list [ v]
wait until <key [s v] pressed?>

wait until <not <key [s v] pressed?>>
hide list [ v]
end
end
end
balii
New to Scratch
6 posts

help with assignment?

Thanks guys!!

Powered by DjangoBB