Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How do i make a sprite disappear and re-appear when a key is pressed
- snakeboy712
-
100+ posts
How do i make a sprite disappear and re-appear when a key is pressed
How do i make something that disappears when you press a key and then re-appears when you press
the same key again?
the same key again?
- jokebookservice1
-
1000+ posts
How do i make a sprite disappear and re-appear when a key is pressed
First, let's make a variable that remembers if you have pressed the key. Let's call it
Now, let's pretend it is the space bar you are after:
- snakeboy712
-
100+ posts
How do i make a sprite disappear and re-appear when a key is pressed
Time to see if the script worked…
Apparently not i don't know why…
Apparently not i don't know why…
- asivi
-
1000+ posts
How do i make a sprite disappear and re-appear when a key is pressed
@jokebookservice1 is right but better if you add at the end of that script First, let's make a variable that remembers if you have pressed the key. Let's call itNow, let's pretend it is the space bar you are after:
- jokebookservice1
-
1000+ posts
How do i make a sprite disappear and re-appear when a key is pressed
Why? (I wasn't using a forever loop)@jokebookservice1 is right but better if you add at the end of that script First, let's make a variable that remembers if you have pressed the key. Let's call itNow, let's pretend it is the space bar you are after:
Also, are you sure it doesn't work, here is a link: https://scratch.mit.edu/projects/108622169/
- _TigerJack21_
-
83 posts
How do i make a sprite disappear and re-appear when a key is pressed
No, I think asivi is correct. Because you haven't added a delay, the “when space key pressed” block will be activated multiple times. This is bad because the results will be very unpredictable.Why? (I wasn't using a forever loop)@jokebookservice1 is right but better if you add at the end of that script First, let's make a variable that remembers if you have pressed the key. Let's call itNow, let's pretend it is the space bar you are after:
Also, are you sure it doesn't work, here is a link: https://scratch.mit.edu/projects/108622169/
Last edited by _TigerJack21_ (May 7, 2016 10:51:13)
- asivi
-
1000+ posts
How do i make a sprite disappear and re-appear when a key is pressed
It is for prevent more than once key detection if the user press the key for a while.Why? (I wasn't using a forever loop)@jokebookservice1 is right but better if you add at the end of that script First, let's make a variable that remembers if you have pressed the key. Let's call itNow, let's pretend it is the space bar you are after:
Also, are you sure it doesn't work, here is a link: https://scratch.mit.edu/projects/108622169/
- jokebookservice1
-
1000+ posts
How do i make a sprite disappear and re-appear when a key is pressed
Ok
- snakeboy712
-
100+ posts
How do i make a sprite disappear and re-appear when a key is pressed
Nevermind it works now 

- asivi
-
1000+ posts
How do i make a sprite disappear and re-appear when a key is pressed
Of course, never was a trouble.
- -frostyiceprincess-
-
1000+ posts
How do i make a sprite disappear and re-appear when a key is pressed
Please don't necropost.
- PhoenixDragonBlue
-
100+ posts
How do i make a sprite disappear and re-appear when a key is pressed
Please don't necro-post (bump an old topic). Also, please do not post on a topic in the “Help with Scripts” with the problem already solved (in fact, I'm not sure why this isn't closed).
- ebonysp
-
1 post
How do i make a sprite disappear and re-appear when a key is pressed
Hey gorls is gengal gengal
- Thefrenchpeople
-
500+ posts
How do i make a sprite disappear and re-appear when a key is pressed
Please don't necropost. This topic is from 2017. Hey gorls is gengal gengal
- Codicar
-
8 posts
How do i make a sprite disappear and re-appear when a key is pressed
Hey dudes shut up, lol
this is not the dumb script he/she is talking about
this is not the dumb script he/she is talking about
- Guest_102233
-
100+ posts
How do i make a sprite disappear and re-appear when a key is pressed
Please refrain from necroposting on a topic resolved more than 4 years ago. This will make the topic seem it is new. I don't know why it hasn't been closed yet. Hey dudes shut up, lol
this is not the dumb script he/she is talking about
- Discussion Forums
- » Help with Scripts
-
» How do i make a sprite disappear and re-appear when a key is pressed