Scratch-gui: Blocks - add "When this sprite touches [sprite]" hat

Created on 10 Aug 2017  路  9Comments  路  Source: LLK/scratch-gui

This block would be a hat that uses the same logic as the existing boolean reporter, "touching [mouse-pointer]?", which has a menu to choose the mouse pointer, the edge, or a sprite.

One reason to add this block is that it would greatly simplify a common case for beginners, where they want to detect that one sprite is touching another, often in a game. One example is in the "Catch Game" Scratch cards:

screen shot 2017-08-10 at 4 26 05 pm

This stack could be reduced to a much simpler one- the new hat would replace the forever block, the if block, and the boolean reporter:

When this sprite touches bowl
Play sound pop
Go to random position
Set y to 180

feature request

Most helpful comment

I'm also curious about the language on the block. A slight variation could be when touching [drop down] as to match the touching [drop down] ? reporter and be a bit more terse. Thoughts?

"When touching" might imply that the following blocks will be run constantly while touching [argument]. For example, a user might try to do this:

"when touching mouse"; "turn 15 degrees"

..and then be surprised to find that the sprite only turns once, as soon as the mouse is touching it!

Whereas "when this sprite touches" makes more sense in that case, I think:

"when this sprite touches mouse"; "turn 15 degrees"

Plus, I think the actual solution would jump out more clearly with "when this sprite touches"; compare:

The respective hat blocks, attached to "repeat until (not touching mouse): turn 15 degrees"

All 9 comments

I really like this idea.

I'm curious about what should be included in the drop-down here and what the default should be. In 36% of shared projects there is only one sprite. Should we think about matching what is in the touching [drop down] ? reporter (see: https://github.com/LLK/scratch-gui/issues/599)?

I'm also curious about the language on the block. Slight variations could be when touching [drop down] or when touches [drop down]. Thoughts?

/cc @ntlrsk @carljbowman

I'm also curious about the language on the block. A slight variation could be when touching [drop down] as to match the touching [drop down] ? reporter and be a bit more terse. Thoughts?

"When touching" might imply that the following blocks will be run constantly while touching [argument]. For example, a user might try to do this:

"when touching mouse"; "turn 15 degrees"

..and then be surprised to find that the sprite only turns once, as soon as the mouse is touching it!

Whereas "when this sprite touches" makes more sense in that case, I think:

"when this sprite touches mouse"; "turn 15 degrees"

Plus, I think the actual solution would jump out more clearly with "when this sprite touches"; compare:

The respective hat blocks, attached to "repeat until (not touching mouse): turn 15 degrees"

Plus it's closer to the "when this sprite clicked" block so I think it's more important to match that

Agreed @towerofnix ! Thanks for the adding some visuals to this! 馃槃

Any updates to this?

Hi @Kenny2github please refrain from bump comments like this. On each issue you can see where it is in the schedule by looking at the Milestone. Items that are listed in the "Backlog" mean that they will likely not be addressed until after the alpha release. Items with a date (e.g. "Aug 23") mean that they are scheduled to be completed by that date.

Hi @thisandagain you made your point in one pr - there's no need to reiterate it in every case I made my mistake. Thanks.

I like this idea - ScratchJr has the image block, and this would just be a more complex version.

Could there also be this option?
image

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kyleplo picture kyleplo  路  4Comments

fsih picture fsih  路  3Comments

ericrosenbaum picture ericrosenbaum  路  3Comments

rschamp picture rschamp  路  3Comments

chrisgarrity picture chrisgarrity  路  4Comments