Discuss Scratch
- Discussion Forums
- » Suggestions
- » New Block? [When % of Sprite 1 is touching Sprite 2]
- iNeverBrokeTheRules
- Scratcher
70 posts
New Block? [When % of Sprite 1 is touching Sprite 2]
So If you want a sprite to do something only when it is fully touching another, this is a good idea
It's like the
Is this a good idea?
100= whole
75= One third
50= half
25= Quarter
When (50)% of [Sprite1] is touching [Sprite2]
It's like the
repeat ()Block, but you put the code UNDER instead of IN the block.
end
Is this a good idea?
100= whole
75= One third
50= half
25= Quarter
Last edited by Paddle2See (June 17, 2019 13:42:19)
Hey guys
forever
play sound [LOL ]
end
Now I will put a link to the image, Scratch doesn't let me put it here
https://photos.google.com/photo/AF1QipMUHAJnYJ_hhIPwvD2jLe9s6MPTfLZaiWy4ceZM
- ResExsention
- New to Scratch
1000+ posts
New Block? [When % of Sprite 1 is touching Sprite 2]
How exactly would this work? What is “fully touching”? Does it mean that one sprite is overlapping another sprite? Could you explain some practical uses?
Infrequently active.
It feels weird to see how far we've come. I hope you're well, wherever you are!
- cheesyfriedeggs
- Scratcher
1000+ posts
New Block? [When % of Sprite 1 is touching Sprite 2]
i'm confused by this.
nothing i say is meant in a rude way
maybe i could eat b l a d e s o f g r a s s
My joke RP / My NEW serious RP / “The Questions About Scratch Forum” / The Never-Ending Story / Be moist / What's a stick? / My 1000th post(not counting deleted posts) / #SaveCubeupload / Forests and Fighters / Tuba and Baritone Topic / #StoptheWikiWednesdaySpam / The Stonk Market / Cheesy Radio Network / The Corn Empire / In The Black Hole / Recommend Characters for The Candy Factory!
- Truck11111
- Scratcher
1000+ posts
New Block? [When % of Sprite 1 is touching Sprite 2]
what
can you explain
can you explain
Last edited by Truck11111 (May 21, 2019 13:20:56)
sufferin' succotash!
- Tallented-Code-bot
- Scratcher
100+ posts
New Block? [When % of Sprite 1 is touching Sprite 2]
If it means that the one sprite is on top of another sprite, than no support. If sprite one were very small, and sprite two was very big, than sprite 1 could not be fully covering sprite 2. There is also really no way of measuring the percent that a sprite it touching another sprite. Another thing, what would happen if one sprite or the other were to change costumes or hide at the same time. Would the block still work?
- iNeverBrokeTheRules
- Scratcher
70 posts
New Block? [When % of Sprite 1 is touching Sprite 2]
No! It doesn't mean a sprite is covering 100%, It means that the whole sprite is touching another, just imagine There was a block in the middle of screen, and you have a smaller block, and you only want it to do something when Every Single Pixel of the Smaller Cube Is touching the Big Cube, It doesn't have to cover the thing, just make full contact with the whole thing, so for any mis-understandings
play sound [ Sorry!] until done
Last edited by iNeverBrokeTheRules (May 21, 2019 14:44:41)
Hey guys
forever
play sound [LOL ]
end
Now I will put a link to the image, Scratch doesn't let me put it here
https://photos.google.com/photo/AF1QipMUHAJnYJ_hhIPwvD2jLe9s6MPTfLZaiWy4ceZM
- Truck11111
- Scratcher
1000+ posts
New Block? [When % of Sprite 1 is touching Sprite 2]
oh No! It doesn't mean a sprite is covering 100%, It means that the whole sprite is touching another, just imagine There was a block in the middle of screen, and you have a smaller block, and you only want it to do something when Every Single Pixel of the Smaller Cube Is touching the Big Cube, It doesn't have to cover the thing, just make full contact with the whole thing, so for any mis-understandingsplay sound [ Sorry!] until done
i dont really see a use for this yet
sufferin' succotash!
- GiggyMantis
- Scratcher
65 posts
New Block? [When % of Sprite 1 is touching Sprite 2]
I just died reading this.
75= One third
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaaaaaaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaaaaaaaaaaaaaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaaaaaaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaaaaaaaaaaaaaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaaaaaaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaaaaaaaaaaaaaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaaaaaaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaaaaaaaaaaaaaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaaaaaaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
- codeman1044
- Scratcher
1000+ posts
New Block? [When % of Sprite 1 is touching Sprite 2]
Something seems off… that could just be me. I just died reading this.75= One third
75% = 0.75. One third = 33% = 0.33… HHHMMMMMmmmm…
Anyways, I would kind of support this, but I could see it being more useful as a boolean:
<Percentage of [sprite1 v] touching [sprite2 v]?::sensing>Instead of
when (50) % of [sprite1 v] is touching [sprite2 v]::events hatThis block could actually cause quite a bit of lag. It might even lead to more lag than the touching color block. *Shudder*
It would have to check and see how many pixels are in each sprite and how many of them are touching each other, then do the math, then check and see if the result is equal to the input. Every single frame. This would probably be laggy. Obviously, the boolean might be laggy as well, but it wouldn't constantly run as an event block would, and it would require less computation.
Summary: support if the boolean is added.
Last edited by codeman1044 (June 14, 2019 21:48:12)
This is my signature, which shows up every time I post and is automatic. To make a signature of your own, locate the “Change your signature” option in the bottom left of the Discussion Home.
I am nothing if not consistently inconsistent.
Snap! is a website that offers block coding like Scratch, but also offers the creation of your own blocks and writing JavaScript functions. The adventurous should consider checking it out!
Potentially useful tutorials and topic coverage
If you want to see a new tutorial added to this, feel free to leave a suggestion on my profile.
- iNeverBrokeTheRules
- Scratcher
70 posts
New Block? [When % of Sprite 1 is touching Sprite 2]
e
Last edited by iNeverBrokeTheRules (June 14, 2019 23:23:48)
Hey guys
forever
play sound [LOL ]
end
Now I will put a link to the image, Scratch doesn't let me put it here
https://photos.google.com/photo/AF1QipMUHAJnYJ_hhIPwvD2jLe9s6MPTfLZaiWy4ceZM
- --Snowball--
- Scratcher
500+ posts
New Block? [When % of Sprite 1 is touching Sprite 2]
I just died reading this.75= One third
:O Wow.
Anyway, I immediately start to see some problems with this. First of all, this should either be a “wait until” block or a hat block with an “if then”. And Talented-Code-bot pointed out some problematic things with this. No support for now.
I've since moved on from Scratch, and now I'm making games in the Godot Engine, music in LMMS, art in Photoshop, and other various things that aren't involving this website anymore. Thanks to Scratch for getting me interested in this stuff!
- mica43683
- Scratcher
500+ posts
New Block? [When % of Sprite 1 is touching Sprite 2]
It should be a ring.Something seems off… that could just be me. I just died reading this.75= One third
75% = 0.75. One third = 33% = 0.33… HHHMMMMMmmmm…
Anyways, I would kind of support this, but I could see it being more useful as a boolean:<Percentage of [sprite1 v] touching [sprite2 v]?::sensing>Instead ofwhen (50) % of [sprite1 v] is touching [sprite2 v]::events hatThis block could actually cause quite a bit of lag. It might even lead to more lag than the touching color block. *Shudder*
It would have to check and see how many pixels are in each sprite and how many of them are touching each other, then do the math, then check and see if the result is equal to the input. Every single frame. This would probably be laggy. Obviously, the boolean might be laggy as well, but it wouldn't constantly run as an event block would, and it would require less computation.
Summary: support if the boolean is added.
(percentage of [sprite1 v] touching [sprite2 v]?::sensing)
You wouldn't use
if <percentage of [sprite1 v] touching [sprite2 v]?::sensing> then
...
end
Or it could be
<[sprite1 v] touching (50)% of [sprite2 v]?::sensing>
If it was a ring, it could be used as
if <(percentage of [sprite1 v] touching [sprite2 v]?::sensing) = [50]> then
...
end
I semi-support this.
I got a lot of compliments on my last signature, and I think that's kind of strange. I wrote it when I was 12 and it wasn't very good. I acted like PS4 controllers were the epitome of human technology, for God's sake! I tried too hard to be philosophical, or maybe I tried too hard to be funny, or maybe it was something else. But that signature was bad. It wasn't good. It might be strange for some of you to hear this, seeing as this site is full of kids, but 12-year-old me was practically a baby. I think that's something you realise when you grow up. That you're always better than you were last year. I was looking through old Skype messages between me and a friend of mine from when we were 12, and as I read them, I couldn't stop thinking, “Woah. I was the worst.” It's important to know that you're always the worst. I can almost guarantee that future you is thinking negatively of you right now, just as future me is thinking negatively of me. It's important not to let that get to you. Remember to stay in the present. Tomorrow hates you, but it can't hurt you because you'll never get to tomorrow. When I was 10 or 11, I remember seeing the world very cynically. I thought that human life was inherently selfish, and that we were only put on this planet to destroy it. I'm so glad 10 or 11 year old me is gone, because 17 year old me would NOT get along with that kid.
- CatsUnited
- Scratcher
1000+ posts
New Block? [When % of Sprite 1 is touching Sprite 2]
No Support for the moment, because this block sounds like it would just cause a ton of lag. After all, what it's doing is having to check every pixel of two sprites to check if that pixel of the first sprite is touching the second sprite, and then calculating the number of pixels that are touching to the number of pixels that aren't, and then doing that for every frame. I know that this block would be useful, I'm just worried that it'd be really laggy.
bottom text
- SadNoob
- Scratcher
27 posts
New Block? [When % of Sprite 1 is touching Sprite 2]
Doesn't Scratch already check for every pixel of two sprites with the “touching ()” block? Calculating the number of pixels that are touching isn't that big of an issue. Although I'd assume Scratch's touching blocks can short-circuit (if a pixel is found that is touching the other sprite, so we don't need to check any other pixels), having a sprite on the last pixel Scratch would check could also cause lag, but this doesn't seem to be a problem. I do agree that this could impact performance, but Scratch is already able to do a lot of touching calculations at a fast speed. No Support for the moment, because this block sounds like it would just cause a ton of lag. After all, what it's doing is having to check every pixel of two sprites to check if that pixel of the first sprite is touching the second sprite, and then calculating the number of pixels that are touching to the number of pixels that aren't, and then doing that for every frame. I know that this block would be useful, I'm just worried that it'd be really laggy.
View all my posts
Dislike Scratch 3.0? You can still download the old editor!
EsOayXeftsRCBCtNOaOxFoBisLdapjtnhZejDemXWlHgPSGGyt
- codeman1044
- Scratcher
1000+ posts
New Block? [When % of Sprite 1 is touching Sprite 2]
Yep. I was It should be a ring.really tired when I posted that. It obviously should be a ring, because it could return over 2 values (instead of true/false)(percentage of [sprite1 v] touching [sprite2 v]?::sensing)
Whoops.
Last edited by codeman1044 (June 15, 2019 17:02:25)
This is my signature, which shows up every time I post and is automatic. To make a signature of your own, locate the “Change your signature” option in the bottom left of the Discussion Home.
I am nothing if not consistently inconsistent.
Snap! is a website that offers block coding like Scratch, but also offers the creation of your own blocks and writing JavaScript functions. The adventurous should consider checking it out!
Potentially useful tutorials and topic coverage
If you want to see a new tutorial added to this, feel free to leave a suggestion on my profile.
- charmander1059
- Scratcher
46 posts
New Block? [When % of Sprite 1 is touching Sprite 2]
pen leftAnd
pen right
Hey! I'm Charmander1059. I love Tusken raiders, and Henry Stickmin. I've even made fangames for Henry Stickmin! Heres my best one:
https://scratch.mit.edu/projects/798518787/. If you liked my comment, consider following. Thanks for being you!
- Nambaseking01
- Scratcher
1000+ posts
New Block? [When % of Sprite 1 is touching Sprite 2]
Support. This will be more efficient. If some of you are getting confused on how a programmer will define the percentage, how did you try to memorize the X and Y positions? This is the same!
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?!
Profile | Test Account | Talk with me here! | Griffpatch is quitting Scratch?!
- WindOctahedron
- Scratcher
1000+ posts
New Block? [When % of Sprite 1 is touching Sprite 2]
Please create a separate topic. That way, more people will actually see it.pen leftAndpen right
The message above may contain wrong information, rude remarks, or something embarrassing to my current self. In this case, please ignore it and remember that I likely wrote it back when I didn't know what “respect” truly meant. I really hate thinking about it again.
- coder2045
- Scratcher
1000+ posts
New Block? [When % of Sprite 1 is touching Sprite 2]
Please don't hijack threads. (Read bottom of signature)pen leftAndpen right
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 ⬇️
- Discussion Forums
- » Suggestions
- » New Block? [When % of Sprite 1 is touching Sprite 2]