This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.
  • Index
  •  » FAQ
  •  » How can I hide a sprite in my program?

#1 2008-11-18 06:53:51

natalie
Scratch Team
Registered: 2007-03-07
Posts: 100+

How can I hide a sprite in my program?

Do you want one of your sprites to hide during your game or animation?

For example, say you want Sprite2 to make Sprite1 disappear when it touches it.

Here's one way to program it:

Sprite2:
[blocks]
<forever>
<if><touching[ Sprite1
<broadcast[ TimeToHide
<end>
<end>
[/blocks]

Sprite1:
[blocks]
<when green flag clicked>
<show>

<when I receive[ TimeToHide
<hide>
[/blocks]

As you can see, Sprite2 "broadcasts" a message to Sprite1. When Sprite1 receives the message, it hides. (You need a "show" to make the sprite reappear again each time you run the program.)

Thanks to yambanshee for suggesting this FAQ topic. Please add any suggestions, corrections, or questions.

Offline

 

#2 2008-12-14 11:17:27

bosox397
Scratcher
Registered: 2008-02-17
Posts: 1000+

Re: How can I hide a sprite in my program?

Also if you want the same thing to happen just in reverse (meaning if a sprite is already hiding) you would do

SPrite 2
<forever><if><(<distance to[ sprite one  <<> 10 )> <broadcast[ time to show


Sprite 1

<when green flag clicked><hide>


<when I receive[ time to show
<show>


Dear Scratch Users,
I'm done with scratch, or at least making projects. I have made one last big game, thats both fun and teaches a lesson about water. It'd mean a lot if you gave me feedback.                              http://scratch.mit.edu/projects/bosox397/569201

Offline

 

#3 2009-09-24 19:33:05

pika100chu
Scratcher
Registered: 2009-07-26
Posts: 500+

Re: How can I hide a sprite in my program?

bosox397
Good game!  smile

Offline

 

#4 2009-12-13 12:07:59

masonwiz
Scratcher
Registered: 2009-12-13
Posts: 1

Re: How can I hide a sprite in my program?

I'm trying to make a game where when the dog touches the cat you lose but I can't get my  "Game Over" sprite to appear ans stop the game when and only when the dog sprite touches the cat sprite. can anyone please help me figure this out.

Offline

 

#5 2010-02-07 03:47:38

Mrbus
Scratcher
Registered: 2010-01-30
Posts: 27

Re: How can I hide a sprite in my program?

i would like to know if you can hide a list in scratch.

<hide>


http://i835.photobucket.com/albums/zz280/photoguy11/Crofts6signaturecopy.jpg?t=1331400911

Offline

 

#6 2010-02-07 03:57:49

Mrbus
Scratcher
Registered: 2010-01-30
Posts: 27

Re: How can I hide a sprite in my program?

i kind of mean

<when I receive[ show list show variable list


http://i835.photobucket.com/albums/zz280/photoguy11/Crofts6signaturecopy.jpg?t=1331400911

Offline

 

#7 2010-02-07 14:24:40

Greatdane
Scratcher
Registered: 2007-06-05
Posts: 1000+

Re: How can I hide a sprite in my program?

Mrbus wrote:

i kind of mean

<when I receive[ show list show variable list

You can't.


The future belongs to those who believe in the beauty of their dreams.
        ~ Eleanor Roosevelt

Offline

 

#8 2010-04-13 15:44:35

meew0
Scratcher
Registered: 2010-02-22
Posts: 1000+

Re: How can I hide a sprite in my program?

Greatdane wrote:

Mrbus wrote:

i kind of mean

[blocks]<when I receive[ show list show variable list[/blocks]

You can't.

You can, but you must hack scratch. Look at nXIII's Tutorial

EDIT: PLEASE USE THE

Code:

[blocks][/blocks]

TAGS BEFORE/AFTER YOU TYPING BLOCKS!

Last edited by meew0 (2010-04-13 15:45:53)


http://i.imgur.com/mJV3j.pnghttp://i.imgur.com/HwWAX.pnghttp://i.imgur.com/sZ7Ui.pnghttp://i.imgur.com/0y6yh.pnghttp://i.imgur.com/nOC4l.png

Offline

 

#9 2010-04-18 07:19:53

fnick
Scratcher
Registered: 2009-11-25
Posts: 4

Re: How can I hide a sprite in my program?

http://scratch.mit.edu/forums/viewtopic.php?id=11796#req_messagehttp://scratch.mit.edu/forums/viewtopic.php?id=11796#req_messagehttp://scratch.mit.edu/forums/viewtopic.php?id=11796#req_messagehttp://scratch.mit.edu/forums/viewtopic.php?id=11796#req_messagehttp://scratch.mit.edu/forums/viewtopic.php?id=11796#req_messagehttp://scratch.mit.edu/forums/viewtopic.php?id=11796#req_messagehttp://scratch.mit.edu/forums/viewtopic.php?id=11796#req_message

Offline

 

#10 2010-05-02 15:56:00

BigDolphin
Scratcher
Registered: 2009-12-21
Posts: 81

Re: How can I hide a sprite in my program?

what on earth is this forum?


►►►►►►►►►♠"Thy fish no like thy Trout that deceives thy eye"♠◄◄◄◄◄◄◄◄◄

Offline

 

#11 2010-05-02 16:02:36

wildplayer
Scratcher
Registered: 2008-08-01
Posts: 100+

Re: How can I hide a sprite in my program?

BigDolphin wrote:

what on earth is this forum?

the scratch website forum

Offline

 

#12 2010-05-21 21:55:23

4lover
Scratcher
Registered: 2010-04-24
Posts: 500+

Re: How can I hide a sprite in my program?

For mason wiz you could just do this when<when green flag clicked<forever if><touching color[ whatever color you want<broadcast[444 and for the game over sprit e you make it hide when flag clicked and this script<when I receive[ 444<show>


Check out this awesome new zombie-cod type of game: http://scratch.mit.edu/projects/4lover/1975649

Offline

 

#13 2010-05-21 23:15:28

shamrocker
Scratcher
Registered: 2009-03-19
Posts: 1000+

Re: How can I hide a sprite in my program?

Quite right. I tested it, and so far it works.


http://i46.tinypic.com/2s1b32e.png
respect the oxford comma

Offline

 

#14 2010-06-01 06:10:54

galogalo4
Scratcher
Registered: 2010-05-30
Posts: 3

Re: How can I hide a sprite in my program?

masonwiz wrote:

I'm trying to make a game where when the dog touches the cat you lose but I can't get my  "Game Over" sprite to appear ans stop the game when and only when the dog sprite touches the cat sprite. can anyone please help me figure this out.

example
What you need to do is use broadcast if dog that's sprite one touches cat sprite 2
hide, use it for cat and dog.  and with cat or dog when it touches one another,
broadcast to your game over, it could be called any name you wish.

like this
If dog touches cat  hide then broadcast game over
and put the same in for the cat
go to game over
put in
when I receive game over show and stop all. Its up to you how many seconds you want it to happen that is the wait tool
that should solve it

Last edited by galogalo4 (2010-06-01 06:14:47)

Offline

 

#15 2010-08-19 16:12:15

Gingercloud
Scratcher
Registered: 2010-08-09
Posts: 2

Re: How can I hide a sprite in my program?

Make an invisble costume for the sprite and do this small script:
<when[ any key ]key pressed>
<switch to costume[ the invisible costume you made
thats just another way to do it.get it

i actually made this up...

Offline

 

#16 2010-08-20 01:10:41

Jonathanpb
Scratcher
Registered: 2008-07-25
Posts: 1000+

Re: How can I hide a sprite in my program?

You can't make a costume with nothing in it...  wink  But you can make the costume look like what's behind it.  tongue


"Human beings... must have action; and they will make it if they cannot find it.
-Charlotte Brontë

Offline

 

#17 2011-01-27 08:05:37

kirbynator
Scratcher
Registered: 2008-05-15
Posts: 4

Re: How can I hide a sprite in my program?

Jonathanpb wrote:

You can't make a costume with nothing in it...  wink  But you can make the costume look like what's behind it.  tongue

You can make a costume with absolutely nothing in it, I can't remember how but I have done so.


Koolio - Indigo - Rad - Blinging - Yo, sup - Nah, mate - Ah, well - Troubled times - Over the moon - Really?
KIRBYNATOR (in association with DNZGames)

Offline

 

#18 2011-09-05 06:35:55

Fransis
New Scratcher
Registered: 2011-09-05
Posts: 1

Re: How can I hide a sprite in my program?

It's a pity would be nice to read the whole story of making such a costume..))

Offline

 

#19 2011-09-11 03:17:29

Pencilmaster
Scratcher
Registered: 2011-09-08
Posts: 100+

Re: How can I hide a sprite in my program?

I have a question: How do I hide my Sprite during the first few levels and make it appear in the last?


I iz teh Pencilmaster  wink
www.pencilmaster.weebly.com

Offline

 

#20 2011-09-11 16:26:34

mmww
Scratcher
Registered: 2010-01-14
Posts: 500+

Re: How can I hide a sprite in my program?

Pencilmaster wrote:

I have a question: How do I hide my Sprite during the first few levels and make it appear in the last?

try using the [blocks] <show> [/blocks] and [blocks] <hide> [/blocks]


http://i.imgur.com/AWFFO.pnghttp://www.weebly.com/uploads/1/0/1/4/10146167/4363061_orig.png Save the cheese!
I am http://blocks.scratchr.org/API.php?action=onlineStatus&amp;user=mmww

Offline

 

#21 2011-09-12 08:23:40

Mariusiky
New Scratcher
Registered: 2011-09-12
Posts: 2

Re: How can I hide a sprite in my program?

Mrbus wrote:

i kind of mean

<when I receive[ show list show variable list

You can't.

Offline

 

#22 2011-10-08 12:53:10

gg787
Scratcher
Registered: 2011-03-13
Posts: 19

Re: How can I hide a sprite in my program?

http://scratch.mit.edu/forums/viewtopic.php?id=11796#req_message just do that

Offline

 

#23 2011-11-12 10:04:09

alison81
New Scratcher
Registered: 2011-10-25
Posts: 1

Re: How can I hide a sprite in my program?

I want a sprite to show and hide as many times as I want if I click the same button.  How do I do that?

Offline

 

#24 2011-11-13 11:48:46

Haiming
Scratcher
Registered: 2011-08-20
Posts: 1000+

Re: How can I hide a sprite in my program?

You can''t. At least not now.

Mrbus wrote:

i would like to know if you can hide a list in scratch.

<hide>

Offline

 

#25 2011-11-19 10:16:21

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: How can I hide a sprite in my program?

Mrbus wrote:

i would like to know if you can hide a list in scratch.

<hide>

Unfortunately you can't at the moment, but I'm hoping it'll be possible in 2.0  smile


Why

Offline

 
  • Index
  •  » FAQ
  •  » How can I hide a sprite in my program?

Board footer