In Scratch, there are "When" blocks, such as when green flag clicked, when key space pressed, when this sprite clicked, and so on, but if I had a boolean, such as "touching color color", how would I put it in a "When" block like "When touching color color"?
Asked
Active
Viewed 259 times
2 Answers
1

CatPerson
- 137
- 7
-
You can. Unfortunately, Scratch isn't sophisticated about how it handles this kind of infinite loop, and so this approach would be costly in terms of performance (i.e. it will slow the program significantly). That said, between the two, the "wait until" is a much better choice. – Peter Duniho Aug 21 '19 at 22:32
1
You may also consider using the event system:
Broadcast a message when touching color
and listen to that message in a when i receive message
block.
This approach helps separating your code into meaningful parts. And it allows to do different things on different sprites/stages when an event occurs.

simon.ro
- 2,984
- 2
- 22
- 36