Discuss Scratch

Prinseskat
Scratcher
1000+ posts

If (sprite name) showing? block

<if (sprite name) showing?>
A boolean reporter saying whether or not a sprite is onscreen and you can see it. I'm not aware of a particularly easy workaround.

haha funny kumquat meme
stickfiregames
Scratcher
1000+ posts

If (sprite name) showing? block

Why not just
<showing? :: looks>

We could also have a block like the current
([ v] of [ v])
but for booleans.

Last edited by stickfiregames (Dec. 2, 2014 08:35:37)











If you can read this, my signature cubeupload has been eaten by an evil kumquat!




or you just used Inspect Element, you hacker

;
Prinseskat
Scratcher
1000+ posts

If (sprite name) showing? block

stickfiregames wrote:

Why not just
<showing? :: looks>

We could also have a block like the current
([ v] of [ v])
but for booleans.
Only
<showing? :: looks>
makes sense, I guess. How would the
([ v] of [ v])
block for booleans work/look though? (You can put booleans into the current block, though I don't think it'll work well.)

Last edited by Prinseskat (Dec. 2, 2014 09:03:14)


haha funny kumquat meme
salvation_
Scratcher
100+ posts

If (sprite name) showing? block

The if shown block would be like this
if <shown?> then

end
This block could be used to find out if something is visible. Currently the only way to do this is to show a sprite that covers the whole screen, and then see if the sprite is touching that screen, and then hide the sprite that covers the whole screen. I am uncertain if this trick actually works. But if it does there is still a problem with this. The problem is that it when the project gets laggy it flashes the sprite making it visible and then invisible, so that half the time you can still see the sprite.

I make games on scratch especially Platformers.
Here are a few of them:
The Truth About The Brontosaurus
Triceratops A Scrolling Platformer
Space Cube
A Square With Hair
Bolt (A non-generic platformer)
I also made a really good bird's eye view tile engine with a talking engine, which you can find here
Morimop
Scratcher
1000+ posts

If (sprite name) showing? block

No Support.

show
set [shown? v] to [1]

hide
set [shown? v] to [0]

if <(shown?) = [1]> then
... :: grey
end

i literally have nothing to write here. huh.
4dsfunk
Scratcher
100+ posts

If (sprite name) showing? block

salvation_ wrote:

The if shown block would be like this
if <shown?> then

end
This block could be used to find out if something is visible. Currently the only way to do this is to show a sprite that covers the whole screen, and then see if the sprite is touching that screen, and then hide the sprite that covers the whole screen. I am uncertain if this trick actually works. But if it does there is still a problem with this. The problem is that it when the project gets laggy it flashes the sprite making it visible and then invisible, so that half the time you can still see the sprite.
I agree!

all lives matter
salvation_
Scratcher
100+ posts

If (sprite name) showing? block

Morimop wrote:

No Support.

show
set [shown? v] to [1]

hide
set [shown? v] to [0]

if <(shown?) = [1]> then
... :: grey
end
However if you have a lot of clones that wouldn't work for all of them. What if some clones are shown and some are not you would need this block!

I make games on scratch especially Platformers.
Here are a few of them:
The Truth About The Brontosaurus
Triceratops A Scrolling Platformer
Space Cube
A Square With Hair
Bolt (A non-generic platformer)
I also made a really good bird's eye view tile engine with a talking engine, which you can find here
4dsfunk
Scratcher
100+ posts

If (sprite name) showing? block

salvation_ wrote:

Morimop wrote:

No Support.

show
set [shown? v] to [1]

hide
set [shown? v] to [0]

if <(shown?) = [1]> then
... :: grey
end
However if you have a lot of clones that wouldn't work for all of them. What if some clones are shown and some are not you would need this block!
Yea

all lives matter
Skywarslord
Scratcher
100+ posts

If (sprite name) showing? block

Support.It would make lot of projects eaiser to make without having to put Variables after every show/hide and make things genarlly eaiser.

Grand Strategyphile
check out my most recent garbage (WARNING: by clicking on that link you agree to be subjected to a poorly scripted, badly drawn, bug-riddled mess which barley passes for a project)
https://scratch.mit.edu/projects/891951035/

say [dont expect me to be on after 3:35 PM lols] 
Wisst_Cat
Scratcher
100+ posts

If (sprite name) showing? block

What are the uses for this? Are you looking for a specific use or many? If you're planning to use this in one project, do you think it can be used in other projects?

(~˘▾˘)~ - This is HulaHula, she protects me from kumquats and helps correct my grammar.

Bored? Come play some of my games, here are some highlights:
An endless runner (kinda).
A cool space pong game.

or make your own! Wait… no ideas?
Use this link!

Remember, X Æ A-12 is pronounced Kyle!
Morimop
Scratcher
1000+ posts

If (sprite name) showing? block

4dsfunk wrote:

salvation_ wrote:

Morimop wrote:

No Support.

show
set [shown? v] to [1]

hide
set [shown? v] to [0]

if <(shown?) = [1]> then
... :: grey
end
However if you have a lot of clones that wouldn't work for all of them. What if some clones are shown and some are not you would need this block!
Yea
Try to create a “sprite-only” variable and use broadcasts.
when I receive [is ... shown v]
if <(shown?) = [0]> then
... :: grey
end

i literally have nothing to write here. huh.
salvation_
Scratcher
100+ posts

If (sprite name) showing? block

Wisst_Cat wrote:

What are the uses for this? Are you looking for a specific use or many? If you're planning to use this in one project, do you think it can be used in other projects?
Yes I want to use it in my game but it could also be useful for other people who are making similar projects.

I make games on scratch especially Platformers.
Here are a few of them:
The Truth About The Brontosaurus
Triceratops A Scrolling Platformer
Space Cube
A Square With Hair
Bolt (A non-generic platformer)
I also made a really good bird's eye view tile engine with a talking engine, which you can find here
salvation_
Scratcher
100+ posts

If (sprite name) showing? block

Morimop wrote:

4dsfunk wrote:

salvation_ wrote:

Morimop wrote:

No Support.

show
set [shown? v] to [1]

hide
set [shown? v] to [0]

if <(shown?) = [1]> then
... :: grey
end
However if you have a lot of clones that wouldn't work for all of them. What if some clones are shown and some are not you would need this block!
Yea
Try to create a “sprite-only” variable and use broadcasts.
when I receive [is ... shown v]
if <(shown?) = [0]> then
... :: grey
end
Yes but this would only work for the sprite who uses the shown variable not for the clones.

I make games on scratch especially Platformers.
Here are a few of them:
The Truth About The Brontosaurus
Triceratops A Scrolling Platformer
Space Cube
A Square With Hair
Bolt (A non-generic platformer)
I also made a really good bird's eye view tile engine with a talking engine, which you can find here
Vercte
Scratcher
500+ posts

If (sprite name) showing? block

salvation_ wrote:

everybody else wrote:

~snippity snip snip~
Yes but this would only work for the sprite who uses the shown variable not for the clones.
Actually, if you set it to sprite only, it DOES work for the clones. That's how you create a clone ID system.

not that active anymore

_________










Seriously. Period. I'm not that active anymore. I've recently realised that Scratch, while good for basic programing, is just not that versatile for making games. So, I've moved on to engines like Roblox and Stencyl, which are entirely different from scratch. Farewell.
salvation_
Scratcher
100+ posts

If (sprite name) showing? block

Vercte wrote:

salvation_ wrote:

everybody else wrote:

~snippity snip snip~
Yes but this would only work for the sprite who uses the shown variable not for the clones.
Actually, if you set it to sprite only, it DOES work for the clones. That's how you create a clone ID system.
How do you set it to sprite only is their a way to make the message only go to clones or only go to sprites. Because if so that would be great except I don't know how to use it!

I make games on scratch especially Platformers.
Here are a few of them:
The Truth About The Brontosaurus
Triceratops A Scrolling Platformer
Space Cube
A Square With Hair
Bolt (A non-generic platformer)
I also made a really good bird's eye view tile engine with a talking engine, which you can find here
Vercte
Scratcher
500+ posts

If (sprite name) showing? block

salvation_ wrote:

Vercte wrote:

salvation_ wrote:

everybody else wrote:

~snippity snip snip~
Yes but this would only work for the sprite who uses the shown variable not for the clones.
Actually, if you set it to sprite only, it DOES work for the clones. That's how you create a clone ID system.
How do you set it to sprite only is their a way to make the message only go to clones or only go to sprites. Because if so that would be great except I don't know how to use it!
This is how:

New Variable

o for all sprites o For this sprite only
^ click this, and it becomes personal to every clone!
Then,
when I start as a clone
hide
set [foo v] to [1]
if <(foo)=[1]> then
think [i am hidden]
end

not that active anymore

_________










Seriously. Period. I'm not that active anymore. I've recently realised that Scratch, while good for basic programing, is just not that versatile for making games. So, I've moved on to engines like Roblox and Stencyl, which are entirely different from scratch. Farewell.
salvation_
Scratcher
100+ posts

If (sprite name) showing? block

Vercte wrote:

salvation_ wrote:

Vercte wrote:

salvation_ wrote:

everybody else wrote:

~snippity snip snip~
Yes but this would only work for the sprite who uses the shown variable not for the clones.
Actually, if you set it to sprite only, it DOES work for the clones. That's how you create a clone ID system.
How do you set it to sprite only is their a way to make the message only go to clones or only go to sprites. Because if so that would be great except I don't know how to use it!
This is how:

New Variable

o for all sprites o For this sprite only
^ click this, and it becomes personal to every clone!
Then,
when I start as a clone
hide
set [foo v] to [1]
if <(foo)=[1]> then
think [i am hidden]
end
But that hides the clones what if you want the clones shown?

I make games on scratch especially Platformers.
Here are a few of them:
The Truth About The Brontosaurus
Triceratops A Scrolling Platformer
Space Cube
A Square With Hair
Bolt (A non-generic platformer)
I also made a really good bird's eye view tile engine with a talking engine, which you can find here
Vercte
Scratcher
500+ posts

If (sprite name) showing? block

It works the other way, just set it to zero.

not that active anymore

_________










Seriously. Period. I'm not that active anymore. I've recently realised that Scratch, while good for basic programing, is just not that versatile for making games. So, I've moved on to engines like Roblox and Stencyl, which are entirely different from scratch. Farewell.
Nambaseking01
Scratcher
1000+ posts

If (sprite name) showing? block

There is an older duplicate for this topic: https://scratch.mit.edu/discuss/topic/69728/

But since this topic contains more discussion, I'll report the two topics to be merged

Hey there! My name is Nammy. I'm a male Forum Helper and Scratch Wiki Editor.
Profile | Test Account | Talk with me here! | Griffpatch is quitting Scratch?!
coder2045
Scratcher
1000+ posts

If (sprite name) showing? block

define show
show
set [shown? v] to [1]

define hide
hide
set [shown? v] to [0]

<(shown?) = [1]>
Done.

Highlight this text and press Ctrl-Shift-Down to view more of my signature. There's a lot in there.
I FOUND THE POSTIE POSTIE POST LINK THIS
Brainteaser: What comes next? Answer on my profile. First correct answer gets a follow.

[ ]
[ [ ] ]
[ [ [ ] ] [ ] ]
Good projects ⬇️




Powered by DjangoBB