Discuss Scratch

Kismat12
Scratcher
100+ posts

Add a radius block

I was think you guys can add a sensing block which detects that sprites radius, by as much it can be, like not a 360 degree radius, but could be between 1-360 degree, the people can change that part, and can detect if anything is in that radius of the sprite.
if <[(Radius  [360] v] on [sprite1 v])] = (Sprite [Any? v])> then

end
This basically detects if any sprite is in the 360 radius


—————————————————————————————————————————————————————————————————–

Flowermanvista
Scratcher
1000+ posts

Add a radius block

The example you provide here already has a block:
(distance to [Sprite v])

Aside from that, I'm not really sure what this does. What do you mean by “not a 360 degree radius”? Radius is generally meant to convey a measure from a circle's center to its edge - for example “everyone in a ten mile radius” would include all people in a circle with a radius of ten miles from the center point.

Add a SPOOKY SKELETON to your project!

The Scratch 3 Project Save Troubleshooter - find out why your project won't save

ST, Please Add A Warning When A Size Limit Is Exceeded

My Dumb Creations - THE BEST ANIMATION | The Windows 98 Experience (made on Windows 98) | nobody cares about Me… | the2000 Reveals His New Profile Picture | Not Dumb Creations - Ten Years
Ctrl+Shift+Down for more…
Do evil kumquats keep eating your signature? Assert your dominance and eat the evil kumquats. Did you know that kumquats are only about the size of an olive?
deletedscratch0
Scratcher
82 posts

Add a radius block

Kismat12 wrote:

I was think you guys can add a sensing block which detects that sprites radius, by as much it can be, like not a 360 degree radius, but could be between 1-360 degree, the people can change that part, and can detect if anything is in that radius of the sprite.
if <[(Radius  [360] v] on [sprite1 v])] = (Sprite [Any? v])> then

end
This basically detects if any sprite is in the 360 radius
That would be useless as they would always be in that place.


._.
:::::::::::::::::::::::::::::::::::::::::::::
HACK | COLLAB | SCRIPTS
::::::::::::::::::::::::::::::::::::::::::::

70 POSTS!
StrangeMagic32
Scratcher
1000+ posts

Add a radius block

deletedscratch0 wrote:

Kismat12 wrote:

I was think you guys can add a sensing block which detects that sprites radius, by as much it can be, like not a 360 degree radius, but could be between 1-360 degree, the people can change that part, and can detect if anything is in that radius of the sprite.
if <[(Radius  [360] v] on [sprite1 v])] = (Sprite [Any? v])> then

end
This basically detects if any sprite is in the 360 radius
That would be useless as they would always be in that place.
So what about this?
if <sprite [any v] is in a () radius of [sprite1 v]::sensing> then //where the radius is the radius of the circle

end
yet as Flowermanvista stated

Flowermanvista wrote:

The example you provide here already has a block:
(distance to [Sprite v])

Aside from that, I'm not really sure what this does. What do you mean by “not a 360 degree radius”? Radius is generally meant to convey a measure from a circle's center to its edge - for example “everyone in a ten mile radius” would include all people in a circle with a radius of ten miles from the center point.

Last edited by StrangeMagic32 (Dec. 13, 2018 17:30:02)



“Remember the worth of souls is great in the sight of God;”
- Doctrine and Covenants 18:10


I have since moved to @JollyWinter
CalculatorFun
Scratcher
94 posts

Add a radius block

Using Pythagoras' Theorem would accomplish this easily sqrt( (x2-x1)^2 + (y2-y1)^2 ) < 100 then do (stuff)
Or just use ..
(distance to [Sprite v])

Last edited by CalculatorFun (Dec. 25, 2018 17:43:55)


darshk2013
Scratcher
5 posts

Add a radius block

and how do i get the raidius block anyways
Roblox888i
Scratcher
1000+ posts

Add a radius block

darshk2013 wrote:

and how do i get the raidius block anyways
Please don't necropost. And you can't.

Last edited by Roblox888i (Jan. 2, 2022 06:53:54)


Below this little line ^ is my signature, you can edit it by going to scratch.mit.edu/discuss/settings/YOURUSERHERE/ also highlight a part and do CNTRL+SHIFT+DOWN to scroll down.



Roblox888i
===========================================================================================================
| Ocular Profile | Scratch Profile | ScratchStats Profile | Github Profile |
=================================
| | Scratch Wiki Profile | |
===========================================================================================================


REST OF SIGNATURE NOT DONE
mybearworld
Scratcher
1000+ posts

Add a radius block

Kismat12 wrote:

(#1)
I was think you guys can add a sensing block which detects that sprites radius, by as much it can be, like not a 360 degree radius, but could be between 1-360 degree, the people can change that part, and can detect if anything is in that radius of the sprite.
if <[(Radius  [360] v] on [sprite1 v])] = (Sprite [Any? v])> then

end
This basically detects if any sprite is in the 360 radius
is this supposed to be
if <is [Sprite1 v] in a radius of (360)° :: sensing> then
. . .
end
If so, this already exists
if <(distance to [Sprite1 v]) < (361) > then
. . .
end

Signatures are the only place where assets links still work.
darshk2013
Scratcher
5 posts

Add a radius block

i found a way to make raidius just check this
https://scratch.mit.edu/projects/622969768/
click see inside

Last edited by darshk2013 (Jan. 3, 2022 09:34:51)

Powered by DjangoBB