Discuss Scratch

savaka
Scratcher
1000+ posts

Variable viewers

Please note this is kind of a placeholder suggestion that will get replaced by another if I ever decide to write that one.
One way to make variable viewers be able to do more things such as move:
make [variables v] do :: variables cstart
end
TheHockeyist
Scratcher
1000+ posts

Variable viewers

How would this work?


savaka
Scratcher
1000+ posts

Variable viewers

TheHockeyist wrote:

How would this work?
Like people commonly want to have a block to make a variable go to a position, you'd do:
make [my var v] do :: variables cstart
go to x: (0) y: (100) // or whatever position you want
end
TheHockeyist
Scratcher
1000+ posts

Variable viewers

savaka wrote:

TheHockeyist wrote:

How would this work?
Like people commonly want to have a block to make a variable go to a position, you'd do:
make [my var v] do :: variables cstart
go to x: (0) y: (100) // or whatever position you want
end

Why not
move variable to x: (0) y: (0) :: variables
?

Last edited by TheHockeyist (Aug. 11, 2014 14:38:31)



TimothyLawyer
Scratcher
1000+ posts

Variable viewers

Instead of adding extra blocks to manipulate variable watchers, one new block would be added to Scratch to treat a variable watcher as though it were a sprite (for the scope of the block).

instruct variable [a variable v] to :: variables cstart
end

So instead of
show variable [... v]
use
instruct variable [... v] to :: variables cstart
show
end

For example
instruct variable [... v] to :: variables cstart
hide
go to x: (0) y: (170)
show
end
Use existing blocks to do things with a variable (or list) watcher.

Edit: Replaced command with instruct. Some other possibilities: direct, tell, control, have…

Last edited by TimothyLawyer (Aug. 11, 2014 20:01:11)


BeetleBlocks, WatercolorBot, and Turtle Art
Hover over a name or label to translate into current language
When Earth was… Purple?

☂️




Braeden5454
Scratcher
500+ posts

Variable viewers


make [variables v] do :: variables cstart //what would happen?
switch costume to [a costume v]
create clone of [myself v]
say [hello] for (3) secs
set [color v] effect to (a number)
end

No text here-> Haha April Fools, You spent 3 seconds highlighting this.
move () steps

If you think my post was helpful, you may want to Follow me to receive updated and useful tips.
I am raeden5454. You can check out some more projects at My Prof
404 Error. Cannot find page “signature”. Reason: Kumquat consumption
savaka
Scratcher
1000+ posts

Variable viewers

Braeden5454 wrote:

make [variables v] do :: variables cstart //what would happen?
switch costume to [a costume v]
create clone of [myself v]
say [hello] for (3) secs
set [color v] effect to (a number)
end
  1. Nothing
  2. Nothing
  3. It would do that
  4. It would do that
stickfiregames
Scratcher
1000+ posts

Variable viewers

The problem with this is that variables are not sprites. If you implemented the say or effect blocks then you would have to reprogram the watchers. Similarly watchers can do many things that do not have a block.

Although the alternative would require a huge number of blocks:

move [variable v] to x:(0) y:(0) :: variables
set [variable v] watcher to [small v] :: variables // small, large, slider
set [variable v] slider [min v] to (0) :: variables
// watchers like the timer or position would also need the first two

move [list v] to x:(0) y:(0) :: lists
set [list v] width to (100) :: lists
set [list v] height to (100) :: lists

Adding colours would also require
set [variable v] color to [#ff0000] :: variables
set [list v] color to [#ff0000] :: lists

Neither solution really feels ideal.

Last edited by stickfiregames (Aug. 12, 2014 17:03:13)











If you can read this, my signature cubeupload has been eaten by an evil kumquat!




or you just used Inspect Element, you hacker

;
DemCupcakesYo
Scratcher
100+ posts

Variable viewers

stickfiregames wrote:

The problem with this is that variables are not sprites. If you implemented the say or effect blocks then you would have to reprogram the watchers. Similarly watchers can do many things that do not have a block.

Although the alternative would require a huge number of blocks:

move [variable v] to x:(0) y:(0) :: variables
set [variable v] watcher to [small v] :: variables // small, large, slider
set [variable v] slider [min v] to (0) :: variables
// watchers like the timer or position would also need the first two

move [list v] to x:(0) y:(0) :: lists
set [list v] width to (100) :: lists
set [list v] height to (100) :: lists

Adding colours would also require
set [variable v] color to [#ff0000] :: variables
set [list v] color to [#ff0000] :: lists

Neither solution really feels ideal.

I support your idea.

-DemCupcakesYo

If you support, it should be +1. If you don't, it should be +0, not -1. If you half-support, it should be +1/2 or +0.5, not +0. You can't subtract from the supporters.

My browser / operating system: Windows 7, Chrome 36.0.1985.125, Flash 14.0 (release 0)

Christiand1014
Scratcher
63 posts

Variable viewers

Support.

Sadly, my signature was eaten by a evil kumqu- OH WAIT.
danielhal
Scratcher
100+ posts

Variable viewers

TheHockeyist wrote:

savaka wrote:

TheHockeyist wrote:

How would this work?
Like people commonly want to have a block to make a variable go to a position, you'd do:
make [my var v] do :: variables cstart
go to x: (0) y: (100) // or whatever position you want
end

Why not
move variable to x: (0) y: (0) :: variables
?
+1

Powered by DjangoBB