Search code examples
mit-scratch

How to hide a particular sprite in mit-scratch?


I am trying to write a scratch code in which on a button press a particular sprite will be displayed and on another button press another sprite will be displayed, the first one should disappears.

I want to know the basic feature of the scratch that should be used here.


Solution

  • I am not exactly sure what you mean by a button press.

    In case you want to show one sprite on key press "a" and hide the other sprite and do the opposite in case of key press "b" then this is pretty simple.

    Here below you see the script for the sprite that must be shown on "b" keypress. The script for the sprite that must be shown on "a" keypress looks exactly the same except that "show" and "hide" blocks must be switched everywhere.

    enter image description here