Discuss Scratch

SuperRyn
Scratcher
100+ posts

Workarounds to frequently suggested blocks

Another piece of handy code: When mouse clicked

when green flag clicked
forever
wait until <mouse down?>
wait until <not <mouse down?>>
broadcast [stuff and things]
end

“I'm too busy to update, you are too busy to update, everyone is too busy to update.” - me 2020
Generation 382: the first time you see this copy and paste it on top of your sig in the scratch forums and increase generation by 1. Social experiment.

I'm sig the signature! Wait… is that a wild kumqu-
(------|- >:|)
That's Medium Timmy, he tries to defend aganist evil kumquats, but often fails.
Computer_Fizz
Scratcher
100+ posts

Workarounds to frequently suggested blocks

SuperRyn wrote:

Workaround for mouse up
<not <mouse down?>>
This has been suggseted a lot and the workaround is sturdy. I'm considering adding it, but the workaround may be too obvious. Is there any reasons it may be worth adding despite that?

SuperRyn wrote:

Another piece of handy code: When mouse clicked

when green flag clicked
forever
wait until <mouse down?>
wait until <not <mouse down?>>
broadcast [stuff and things]
end
I don't think this is suggested that often and the code you provide is also very inconsistent.
eric99343
Scratcher
100+ posts

Workarounds to frequently suggested blocks

this is a sensing block that was suggested that the scratch team should reject, because it has a workaround.

ask []::sensing

the ask and not wait block. The workaround is shown below.
_____________________________________________________________________________________________
when green flag clicked
broadcast [ v]
move () steps

when I receive [ v]
ask [] and wait

Last edited by eric99343 (Feb. 12, 2020 14:01:31)

Beamy68
Scratcher
100+ posts

Workarounds to frequently suggested blocks

eric99343 wrote:

this is a sensing block that was suggested that the scratch team should reject, because it has a workaround.

ask []::sensing

the ask and not wait block. The workaround is shown below.
_____________________________________________________________________________________________
when green flag clicked
broadcast [ v]
move () steps

when I receive [ v]
ask [] and wait
Just because it has a workaround, doesn't mean the ST should reject it

Post Goal:


Motion::motion
Looks::looks
Sound::sound
Pen::pen
Events::events
Control::control
Sensing::sensing
Operators::operators
Variables::variables
List::list
More Blocks::custom
bemy
Beamy68
Scratcher
100+ posts

Workarounds to frequently suggested blocks

no8pupil wrote:

PixelYoshi wrote:

Pocoyo3060 wrote:

Computer_Fizz wrote:

Motion :: motion hat
move up ( number ) steps :: motion
can be recreated with the following code:
set [direction v] to ( direction )
point in direction ( 0 v)
move ( number ) steps
point in direction ( direction :: variables )
———————————————————–
point towards x: ( WantedX ) y: ( WantedY ) :: motion
can be recreated by moving a sprite to that x and y then pointing toward that sprite. it can also be recreated with the following (more complicated) code:
set [deltax v] to ( ( WantedX ) - ( x position ) )
set [deltay v] to ( ( WantedY ) - ( y position ) )
if <not < ( deltay ) = ( 0 )> > then
if < ( deltay ) > ( 0 ) > then
point in direction ( [atan v] of ( ( deltax ) / ( deltay ) )
else
point in direction ( ([atan v] of ( ( deltax ) / ( deltay ) ) ) + (180) )
end
else
if ( ( deltax ) > ( 0 ) ) then
point in direction ( 90 )
else
point in direction ( -90 )
end
———————————————————–
bounce :: motion
can be recreated with the following code:
point in direction ( ( direction ) - ( 180 ) )
Yeah but that’s kinda cringe ngl
Just use python lol
how is that cringe? it's just math.
I do agree with you, PixelYoshi, but please stay on topic, thx.
What??? It wasn't even pixelyoshi who started it..? C'mon pay attention

Post Goal:


Motion::motion
Looks::looks
Sound::sound
Pen::pen
Events::events
Control::control
Sensing::sensing
Operators::operators
Variables::variables
List::list
More Blocks::custom
bemy
12349999eeeeeee9S99
Scratcher
51 posts

Workarounds to frequently suggested blocks

Beamy68 wrote:

no8pupil wrote:

PixelYoshi wrote:

Pocoyo3060 wrote:

Computer_Fizz wrote:

Motion :: motion hat
move up ( number ) steps :: motion
can be recreated with the following code:
set [direction v] to ( direction )
point in direction ( 0 v)
move ( number ) steps
point in direction ( direction :: variables )
———————————————————–
point towards x: ( WantedX ) y: ( WantedY ) :: motion
can be recreated by moving a sprite to that x and y then pointing toward that sprite. it can also be recreated with the following (more complicated) code:
set [deltax v] to ( ( WantedX ) - ( x position ) )
set [deltay v] to ( ( WantedY ) - ( y position ) )
if <not < ( deltay ) = ( 0 )> > then
if < ( deltay ) > ( 0 ) > then
point in direction ( [atan v] of ( ( deltax ) / ( deltay ) )
else
point in direction ( ([atan v] of ( ( deltax ) / ( deltay ) ) ) + (180) )
end
else
if ( ( deltax ) > ( 0 ) ) then
point in direction ( 90 )
else
point in direction ( -90 )
end
———————————————————–
bounce :: motion
can be recreated with the following code:
point in direction ( ( direction ) - ( 180 ) )
Yeah but that’s kinda cringe ngl
Just use python lol
how is that cringe? it's just math.
I do agree with you, PixelYoshi, but please stay on topic, thx.
What??? It wasn't even pixelyoshi who started it..? C'mon pay attention
but he meant pixelyoshi, come on man, pay attention

when green flag clicked
forever
say [DESTROY THE GACHAS!!] for (2) secs
point towards [ gacha]
broadcast [ clear gacha]
end
kittiesrule247
Scratcher
100+ posts

Workarounds to frequently suggested blocks

Nambaseking01 wrote:

hmcn4404 wrote:

I understand there is a mouse down block

<mouse down?>
but why can't there be a mouse up block?

im pretty sure other people who want to make projects were people can draw want they want would appreciate it because it would make there projects code easier to make.

The workaround to mouse up? is:

forever
if <mouse down?> then
wait until <not <mouse down?>>
broadcast [run code v]
end
end

when I receive [run code v]
. . .
<not <mouse down?>>

LGBTQIAPNDO+ PRIDE
PixelYoshi
Scratcher
100+ posts

Workarounds to frequently suggested blocks

12349999eeeeeee9S99 wrote:

Beamy68 wrote:

no8pupil wrote:

I do agree with you, PixelYoshi, but please stay on topic, thx.
What??? It wasn't even pixelyoshi who started it..? C'mon pay attention
but he meant pixelyoshi, come on man, pay attention
i wasn't really off topic, but you guys have gotten of topic so lets just end this…
no8pupil
Scratcher
72 posts

Workarounds to frequently suggested blocks

PixelYoshi wrote:

12349999eeeeeee9S99 wrote:

Beamy68 wrote:

no8pupil wrote:

I do agree with you, PixelYoshi, but please stay on topic, thx.
What??? It wasn't even pixelyoshi who started it..? C'mon pay attention
but he meant pixelyoshi, come on man, pay attention
i wasn't really off topic, but you guys have gotten of topic so lets just end this…
Well
  1. stay on topic
    and ɦɑⱱe ɑ ɓowɭ ɱɾ sqʊɪɗwɑrɖ

like::control hat
heart::motion
follow::list
likes (bbc (alba::stack events)::stack motion)::pen
loves the IPA::operators
friendly::cap
no8pupil
Scratcher
72 posts

Workarounds to frequently suggested blocks

This may not be a suggestion but, can anyone give me a workaround for these BYOB blocks?
report []::cap control
(JavaScript function ( [] @addInput ) { [] }::operators)
and
run ((block::stack grey)::ring grey)::control

like::control hat
heart::motion
follow::list
likes (bbc (alba::stack events)::stack motion)::pen
loves the IPA::operators
friendly::cap
PixelYoshi
Scratcher
100+ posts

Workarounds to frequently suggested blocks

no8pupil wrote:

PixelYoshi wrote:

12349999eeeeeee9S99 wrote:

Beamy68 wrote:

no8pupil wrote:

I do agree with you, PixelYoshi, but please stay on topic, thx.
What??? It wasn't even pixelyoshi who started it..? C'mon pay attention
but he meant pixelyoshi, come on man, pay attention
i wasn't really off topic, but you guys have gotten of topic so lets just end this…
Well
  1. stay on topic
    and ɦɑⱱe ɑ ɓowɭ ɱɾ sqʊɪɗwɑrɖ
lol now your off topic
no8pupil
Scratcher
72 posts

Workarounds to frequently suggested blocks

PixelYoshi wrote:

no8pupil wrote:

PixelYoshi wrote:

12349999eeeeeee9S99 wrote:

Beamy68 wrote:

no8pupil wrote:

I do agree with you, PixelYoshi, but please stay on topic, thx.
What??? It wasn't even pixelyoshi who started it..? C'mon pay attention
but he meant pixelyoshi, come on man, pay attention
i wasn't really off topic, but you guys have gotten of topic so lets just end this…
Well
  1. stay on topic
    and ɦɑⱱe ɑ ɓowɭ ɱɾ sqʊɪɗwɑrɖ
lol now your off topic
bish disgust

like::control hat
heart::motion
follow::list
likes (bbc (alba::stack events)::stack motion)::pen
loves the IPA::operators
friendly::cap
kjtv9000new
Scratcher
37 posts

Workarounds to frequently suggested blocks

< sound [ v] playing? :: sound>

Last edited by kjtv9000new (Feb. 22, 2020 18:33:21)


This message has been approved by me! :: custom hat
if <i detect [evil kumquats v] :: sensing> then

blow up evil kumquats :: looks

else
say [(insert good joke routine here)] for (2) secs
end
always be cool guys.
~(˘▾˘~) This is SiggyProt. He can take down bad guys.
PIE DRAGONS!!!!!!!!!! (it only eats pies)
My website
kjtv9000new
Scratcher
37 posts

Workarounds to frequently suggested blocks

<[ v] recieved? :: events>

This message has been approved by me! :: custom hat
if <i detect [evil kumquats v] :: sensing> then

blow up evil kumquats :: looks

else
say [(insert good joke routine here)] for (2) secs
end
always be cool guys.
~(˘▾˘~) This is SiggyProt. He can take down bad guys.
PIE DRAGONS!!!!!!!!!! (it only eats pies)
My website
kjtv9000new
Scratcher
37 posts

Workarounds to frequently suggested blocks

repeat for (...) seconds{
...
} @loopArrow :: control

Can you make a workaround for that?

Last edited by kjtv9000new (Feb. 22, 2020 18:47:04)


This message has been approved by me! :: custom hat
if <i detect [evil kumquats v] :: sensing> then

blow up evil kumquats :: looks

else
say [(insert good joke routine here)] for (2) secs
end
always be cool guys.
~(˘▾˘~) This is SiggyProt. He can take down bad guys.
PIE DRAGONS!!!!!!!!!! (it only eats pies)
My website
no8pupil
Scratcher
72 posts

Workarounds to frequently suggested blocks

kjtv9000new wrote:

repeat for (...) seconds{
...
} @loopArrow :: control

Can you make a workaround for that?
First
when green flag clicked
set [time v] to [true]
wait (number::grey) sec
set [time v] to [false]
Then
when green flag clicked
repeat until <(time) = [false]>
...
end

like::control hat
heart::motion
follow::list
likes (bbc (alba::stack events)::stack motion)::pen
loves the IPA::operators
friendly::cap
Computer_Fizz
Scratcher
100+ posts

Workarounds to frequently suggested blocks

kjtv9000new wrote:

< sound [ v] playing? :: sound>

That can be worked around like this:
set [MeowPlaying v] to [true]
play sound [meow v] until done
set [MeowPlaying v] to [false]

I am not sure whether or not this is suggested enough to be at the main front, but I'll be thinking about it the next few days.

kjtv9000new wrote:

<[ v] recieved? :: events>

This is hard to work around because nobody can agree on how it would work (i.e. only if it's actively being received immediately, or has been broadcast at any point, or since last broadcast, etc…) Can you be more specific?

kjtv9000new wrote:

repeat for (...) seconds{
...
} @loopArrow :: control

Can you make a workaround for that?


This can be done with the timer, but it's tricky in case of stuff like this

repeat for (1) seconds{
wait (2) secs
} @loopArrow :: control

In this case, would it cut off the scripts if it took longer than the amount of time, or just finish them and only not do the next round?

Last edited by Computer_Fizz (Feb. 22, 2020 20:01:24)

chiru3
Scratcher
41 posts

Workarounds to frequently suggested blocks

change y by ()

is a workaround for

move up () steps
Hopeijay
Scratcher
90 posts

Workarounds to frequently suggested blocks

my_pup4life wrote:

Hopeijay wrote:

my_pup4life wrote:

is there a workaround for this:
set speed to (...):: sound

What do you want this block to do to what?

If you are talking about setting the speed of the sprite, this may help:

set speed to (...):: #7238a8
define set speed to (speed)
forever
move (speed) steps
end
I made it a sound block for a reason, its supposed to be the speed of the sound without the pitch changing

Sorry, I missed that, the correct term would be tempo but sadly there is no way to change the tempo of the sound without changing the pitch. Sorry about that.

Last edited by Hopeijay (Feb. 23, 2020 15:23:53)



Have your hands not been washed in the last 5 hours? CALL 1-800-GOTOTHESINKANDWASHYOURHANDS now, to keep COVID-19 away! That's 1-800-GOTOTHESINKANDWASHYOURHANDS Thank you!
Beamy68
Scratcher
100+ posts

Workarounds to frequently suggested blocks

kjtv9000new wrote:

repeat for (...) seconds{
...
} @loopArrow :: control

Can you make a workaround for that?

By-far the easiest workaround for this is:
repeat (seconds)
...
wait (1) secs
end

OR (because I know people are gonna argue)

repeat until <(seconds) = [0]>
repeat (1)
...
change [seconds v] by (-1)
end
end

Last edited by Beamy68 (Feb. 24, 2020 02:59:24)


Post Goal:


Motion::motion
Looks::looks
Sound::sound
Pen::pen
Events::events
Control::control
Sensing::sensing
Operators::operators
Variables::variables
List::list
More Blocks::custom
bemy

Powered by DjangoBB