This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2007-03-18 12:21:24

bernatp
Scratcher
Registered: 2007-03-07
Posts: 49

Get the visibility of a sprite (visible? block)

Sometimes a visible? purple block (with pointed ends) would be very useful.
For example: shooting. You can't shoot when the Shot is visible, but you can, when it's invisible (after touching the edge, or the enemy). Presently, you have to use a new variable, eg. YouCanShoot, which has to be set to 0 after shooting, and set to 1, if the Shot reaches the edge or a particular sprite.

(Have you got any other ideas for that problem?)

I'm talking about this 'imaginary' block:
http://people.inf.elte.hu/bernatp/tar/visible.jpg

Offline

 

#2 2007-03-20 09:54:35

andresmh
Scratch Team at MIT
Registered: 2007-03-05
Posts: 1000+

Re: Get the visibility of a sprite (visible? block)

Personally, I think using a variable for that is OK. But I am sure others would agree a visibility block would be better. We will come back to all your suggestions as we think about new features. Thanks a lot for taking the time of creating an image and everything!


Andres Monroy-Hernandez | Scratch Team at the MIT Media Lab
on identi.ca and  twitter

Offline

 

#3 2010-02-04 20:03:54

billyedward
Scratcher
Registered: 2008-01-03
Posts: 500+

Re: Get the visibility of a sprite (visible? block)

This has been in Streak since v0.0. See my signature if you want it.


"I'd love to change the world, but they haven't released the source code yet."
Check out the latest version of Streak --> http://billy.scienceontheweb.net/Streak

Offline

 

#4 2010-02-04 20:40:24

hmnwilson
Scratcher
Registered: 2007-07-04
Posts: 1000+

Re: Get the visibility of a sprite (visible? block)

billyedward wrote:

This has been in Streak since v0.0. See my signature if you want it.

/bump


I'm taking a break from Scratch until 2.0 comes out. Any messages sent between then and now probably won't be read - sorry.
(Oct. 20, 2011)

Offline

 

#5 2010-03-19 14:30:09

TheGameMaster1231
Scratcher
Registered: 2009-07-24
Posts: 1000+

Re: Get the visibility of a sprite (visible? block)

If It Was The Spacebar To Shoot, You Could Do: When Key [space] Pressed, Broadcast [shoot] And Wait. Then In The Bullet, Do: When I Receive [shoot] Then Put The Script For It To Keep Going Untill It Hit's Something. (Edge, Enemy, etc.) But Yes, That Would Be A Useful Block, And Like billyedward Said, It's Been In Streak For A Looooooooooong Time. But It Would Be An 'obsolete!' Block When You Uploaded It. Also, You WOULD Be Able To Hack Scratch For It, Which Is What I'm Gonna Do Like NOW. If I Figure Out How To Make It, I'll Tell You How.  smile

Offline

 

#6 2010-03-19 14:39:00

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: Get the visibility of a sprite (visible? block)

Use a 480x360 white/black sprite in the very very back layer that has 100% ghost effect and this script:
[blocks]
<when green flag clicked>
<forever>
<if><touching[ shotSprite
<set{ visible }to( 1
<else>
<set{ visible }to( 0
<end>
[/blocks]
This works because hits are only registered on visible sprites, but they work on ones with 100% ghost (which is really invisible)


nXIII

Offline

 

#7 2010-03-19 14:46:39

BWOG
Scratcher
Registered: 2008-09-19
Posts: 1000+

Re: Get the visibility of a sprite (visible? block)

billyedward wrote:

This has been in Streak since v0.0. See my signature if you want it.

O_O You bumped an almost 3 year old thread.

Offline

 

#8 2010-03-29 08:48:03

TheGameMaster1231
Scratcher
Registered: 2009-07-24
Posts: 1000+

Re: Get the visibility of a sprite (visible? block)

nXIII wrote:

Use a 480x360 white/black sprite in the very very back layer that has 100% ghost effect and this script:
[blocks]
<when green flag clicked>
<forever>
<if><touching[ shotSprite
<set{ visible }to( 1
<else>
<set{ visible }to( 0
<end>
[/blocks]
This works because hits are only registered on visible sprites, but they work on ones with 100% ghost (which is really invisible)

True, But If You Press The Red Stop Sign And Stop Everything, It Will Appear.  hmm

Offline

 

Board footer