Discuss Scratch
- The_5th_Scratcher
-
100+ posts
Variable Sensing
UPDATE:
These are all of the block that i'm suggesting:
These are all of the block that i'm suggesting:
[variable v] changed::variables hat //these would start a line of code
[variable v] changed from [] to []::variables hat
[variable v] changed by [number]::variables hat
wait until [variable v] changed ::variables
repeat until [variable v] changed {
}::variables
Last edited by The_5th_Scratcher (May 19, 2021 19:31:21)
- samq64
-
1000+ posts
Variable Sensing
I support
I do not support the boolean blocks because as mentioned above, they're are too ambiguous.
As for the other hat blocks, I don't think they're really needed beacuse you can just do this
I'm not too sure about those last two blocks.
when variable [foo v] changes :: hat eventsbeacuse it's useful and it's something that a lot of people are likely to use.
I do not support the boolean blocks because as mentioned above, they're are too ambiguous.
As for the other hat blocks, I don't think they're really needed beacuse you can just do this
when variable [foo v] changes :: events hat
if <(foo) = [...]> then
...
End
I'm not too sure about those last two blocks.
Last edited by samq64 (June 5, 2021 15:56:04)
- samq64
-
1000+ posts
Variable Sensing
Here's the Scratch wiki article: https://en.scratch-wiki.info/wiki/Snaplet me try this in snap!
What is snap?…
Last edited by samq64 (June 5, 2021 00:52:28)
- The_5th_Scratcher
-
100+ posts
Variable Sensing
I do not support the boolean blocks because as mentioned above, they're are too ambiguous.
I already removed the boolean blocks from the suggestion.
- cat_tap
-
1000+ posts
Variable Sensing
How about -snip-
<[variable v] changed ?::variables>
<[variable v] changed from [] to [] ?::variables>
<[variable v] changed by (...) ?::variables>
wait until <[variable v] changed ?::variables>
repeat until <[variable v] changed ?::variables>
end
then you could also use it in many other ways, like
if <[variable v] changed ? ::variables> then
...
end
<<[variable1 v] changed ? ::variables> and <[variable2 v] changed by (...) ?::variables>>
Support! Though there is a workaround, it's not too accurate if it needs to be precise…
- Chiroyce
-
1000+ posts
Variable Sensing
when green flag clicked
set [cached var v] to (my variable)
when [timer v] > ((timer) - <not <(cached var) = (my variable)>>)
set [cached var v] to (my variable)
say [Variable changed!] for (2) secs // change this to code that should be run when the variable is changed
`my variable` is the variable that will be detected if changed
This is a workaround for people who are in need of this suggestion right now.
Here is a demo.
Last edited by Chiroyce (June 10, 2021 07:30:09)
- kccuber
-
1000+ posts
Variable Sensing
anyway this idea miserably failedHere's the Scratch wiki article: https://en.scratch-wiki.info/wiki/Snaplet me try this in snap!
What is snap?…
Last edited by kccuber (June 10, 2021 13:20:56)
- The_5th_Scratcher
-
100+ posts
Variable Sensing
How about -snip-<[variable v] changed ?::variables>
<[variable v] changed from [] to [] ?::variables>
<[variable v] changed by (...) ?::variables>
wait until <[variable v] changed ?::variables>
repeat until <[variable v] changed ?::variables>
end
then you could also use it in many other ways, likeif <[variable v] changed ? ::variables> then
...
end
<<[variable1 v] changed ? ::variables> and <[variable2 v] changed by (...) ?::variables>>
Support! Though there is a workaround, it's not too accurate if it needs to be precise…
The boolean blocks are no longer part of the suggestion.
- The_5th_Scratcher
-
100+ posts
Variable Sensing
This is a workaround for people who are in need of this suggestion right now.
Thanks! I'll put it in the top post on the first page.
- VeryFamus
-
1000+ posts
Variable Sensing
Here is a workaround for the first hat block:
As for the second hat, I don’t support that one due to being too specific, but here is a workaround (I support all the other ones):
foreverAnd the third hat block:
if <not<(Var)=(oldVar) :: operators> :: operators> then
…
end
Set [oldVar v] to (Var) :: variables
end
foreverThe repeat until block:
if <not<(Var)=(oldVar) :: operators> :: operators> then
If <(Var) = ((oldVar) + [num] :: operators) :: operators> then
…
end
end
Set [oldVar v] to (Var) :: variables
end
Repeat until <not<(Var)=(oldVar) :: operators> :: operators>And the wait until block:
…
end
Forever
Set [oldVar v] to (Var) :: variables
end
Wait until <not<(Var)=(oldVar) :: operators> :: operators>
…
Forever
Set [oldVar v] to (Var) :: variables
end
As for the second hat, I don’t support that one due to being too specific, but here is a workaround (I support all the other ones):
forever
if <not<(Var)=(oldVar) :: operators> :: operators> then
If <<(Var) = [num] :: operators> and <(oldVar) = [num] :: operators>> then
…
end
end
Set [oldVar v] to (Var) :: variables
end
- Jackson49_test
-
100+ posts
Variable Sensing
Bump
Last edited by Jackson49_test (April 5, 2022 22:11:51)