Discuss Scratch

mlcreater
Scratcher
1000+ posts

<draggable?>

The block:
set drag mode [ v] :: sensing stack
new in 3.0 allows the “can drag in player” setting of a sprite to be changed by its scripts.

I suggest another new block:
draggable? :: sensing boolean
that would report true if the drag mode is set to “draggable”, and false if the drag mode is set to “not draggable”.

I also suggest making the drop-down menu in
set drag mode [ v] :: sensing stack
rounded so that you could put another block into it.

This change could let you set the drag mode to the opposite of what it is now (for example, if Wizard-toad has to cast a spell on itself):
set drag mode <not <draggable? :: sensing boolean>> :: sensing stack

set drag mode (item ((2) - <draggable? :: sensing boolean>) of [["draggable", "not draggable"\] v]) :: sensing stack
-XTV-
Scratcher
100+ posts

<draggable?>

hm, this is actually an interesting idea, support, as you can do this
when green flag clicked
forever
if <<draggable? :: sensing boolean>> then
say [HAHA DRAG GO BRRRRRRRRRR]
end
end
latin_gamerX
Scratcher
500+ posts

<draggable?>

workaround

when green flag clicked
set drag mode [draggable v]
set [draggable v] to [1]
if <(draggable) = [1]> then



else

end
HarperIsLost
Scratcher
15 posts

<draggable?>

This is a pretty good idea.
mlcreater
Scratcher
1000+ posts

<draggable?>

latin_gamerX wrote:

workaround
(snip)
Not really… you would have to change the variable every time you switched the drag mode, or else define a custom block and replace every instance of the set drag mode block.

There are similar ‘workarounds’ for many other blocks, but the blocks make the tasks easier:
size

volume

length of [ v] :: list

Edit: I want to add that these blocks help people who do not understand variables yet, and the <draggable?> block would too.

Last edited by mlcreater (Oct. 25, 2020 22:20:30)

Steve0Greatness
Scratcher
1000+ posts

<draggable?>

Workaroundable
dragging
set [drag v] to [yes]
forever
if <(drag) = [yes]> then
if <<<touching [mouse pointer v] ?> and <mouse down?>> and <(drag) = [yes]>> then
repeat until <<not <<touching [mouse pointer v] ?> and <mouse down?>>> and <(drag) = [yes]>>
go to [mouse pointer v]
end
end
end
end
Bollean
<(drag) = [yes]>
But
I support, this is a workaround that only griffpatch would think of quickly, that took some thinking from my part
Example

Last edited by Steve0Greatness (Oct. 25, 2020 20:33:36)

hotdogbananaman
Scratcher
100+ posts

<draggable?>

dont we already have this?
Steve0Greatness
Scratcher
1000+ posts

<draggable?>

hotdogbananaman wrote:

dont we already have this?
no, we don't, we just a workaround
IndianRuby718
Scratcher
100+ posts

<draggable?>

hotdogbananaman wrote:

dont we already have this?
We can change the setting inside the editor manually, but not in the project itself. The “workaround” we have right now does pretty much the same thing, but it doesn't do the same thing because it doesn't change the option shown inside that says whether the sprite is draggable or not. So I don't consider this a workaround, and so I say that there is no workaround… Support!

Edit: only the second workaround. The first one does do that, but it would still be convenient and makes sense to have this block.

Last edited by IndianRuby718 (Dec. 6, 2020 02:12:57)

SKY913
Scratcher
1 post

<draggable?>

Powered by DjangoBB