Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Make one sprite disappear and other appear in its place
- kiaboni
- New to Scratch
2 posts
Make one sprite disappear and other appear in its place
HI everyone!
I am new to this site and new to coding in general. I am trying to teach myself as much as I can, but I am having a problem figuring out how to make a sprite appear after making another one “hide”
I have figured out how to make sprite #1 disappear after reaching a certain point on the page, but then I want a new one to appear in it's place… Kind of like a magic trick.
Is this even possible?
Any and all help is much appreciated.
Thank you so much!
I am new to this site and new to coding in general. I am trying to teach myself as much as I can, but I am having a problem figuring out how to make a sprite appear after making another one “hide”
I have figured out how to make sprite #1 disappear after reaching a certain point on the page, but then I want a new one to appear in it's place… Kind of like a magic trick.
Is this even possible?
Any and all help is much appreciated.
Thank you so much!
- AgentCNF
- Scratcher
100+ posts
Make one sprite disappear and other appear in its place
Basically, the script for Sprite 2 should be, "When sprite one gets in position and dissapears, go to sprite 1, and show. Like this:
If anything goes wrong, tell me.
when I receive [sprite 1 in place v]
go to [Sprite 1 v]
show
If anything goes wrong, tell me.
Last edited by AgentCNF (Jan. 6, 2014 02:21:05)
- picopaper
- Scratcher
500+ posts
Make one sprite disappear and other appear in its place
In the first sprite, program:
Next, program in another sprite:
However, you can easily work around this with the costume ability. Over the blocks bar, you'll notice a bar saying “Costumes.” Click that, and above the costume icons there's a bar similar to the New Sprite bar. Use this to make your costume, then program:
Hope this helps!
when I receive [Hide v]
hide
broadcast [show v]
Next, program in another sprite:
when green flag clicked
hide
when I receive [show v]
show
However, you can easily work around this with the costume ability. Over the blocks bar, you'll notice a bar saying “Costumes.” Click that, and above the costume icons there's a bar similar to the New Sprite bar. Use this to make your costume, then program:
when green flag clicked
switch costume to [costume1 v]
when I receive [show v]
next costume
Hope this helps!
if <(platypus) = [platypus]> then
set [platypus v] to [platypus]
Pigs with Jetpacks! (a game of porcine combat)
What is with all these kumquat sig– *gulp*
- kiaboni
- New to Scratch
2 posts
Make one sprite disappear and other appear in its place
You guys are awesome! Thanks for the quick response. Have been racking my brain over this one.
Will keep you posted!
Will keep you posted!
- typemaster
- Scratcher
100+ posts
Make one sprite disappear and other appear in its place
This is the script for the sprite that you want to hide:
when I receive [do stuff]Here is the script for the other sprite:
hide
when green flag clickedHope this helped!!
hide //this part is so that he is not shown the whole time
when I receive [do stuff]
go to [sprite1]
show
Owner of TPM!!!!
when green flag clicked
forever
set [what I'm doing] to [playing destiny]
end
- Harakou
- Scratcher
1000+ posts
Make one sprite disappear and other appear in its place
This topic is very old - I think OP has gotten the help they need based on their response. Please check thread dates and make sure you're not reviving a dead topic unnecessarily when you post. This is the script for the sprite that you want to hide:when I receive [do stuff]Here is the script for the other sprite:
hidewhen green flag clickedHope this helped!!
hide //this part is so that he is not shown the whole time
when I receive [do stuff]
go to [sprite1]
show
- Discussion Forums
- » Help with Scripts
- » Make one sprite disappear and other appear in its place