Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » USING MY BLOCKS IN SCRATCH
- World-Wide_2017
-
Scratcher
24 posts
USING MY BLOCKS IN SCRATCH
My scratch mentors introduced my blocks but i don't understand. How can I type codes in “MY BLOCKS”? What is the mode of typing codes in “MY BLOCKS” ? How do I realise that my codes in “MY BLOCKS” are correct? What are the effect of “MY BLOCKS” ?
- deck26
-
Scratcher
1000+ posts
USING MY BLOCKS IN SCRATCH
You just use normal scratch code in custom blocks but there are advantages. For example, you could pass variables for x and y and radius to a custom block that draws a circle so
If you use the no screen refresh option the circle would be drawn much more quickly. https://scratch.mit.edu/projects/41640002 is an example.
If you use clones they can call a custom block and only the calling clone runs it, unlike broadcasts where every clone and the sprite would try to respond.
Custom blocks are actually very useful but one word of warning - if you use the no screen refresh option and the block can't run within one frame the project will lag horribly. Don't use anything that indicates any kind of wait if you want to use the no screen refresh option.
define drawcircle (x) (y) (radius)is better than having to set three variables and broadcast to a script to draw a circle.
drawcircle (100) (50) (40)
drawcircle (200) (100) (20)
If you use the no screen refresh option the circle would be drawn much more quickly. https://scratch.mit.edu/projects/41640002 is an example.
If you use clones they can call a custom block and only the calling clone runs it, unlike broadcasts where every clone and the sprite would try to respond.
Custom blocks are actually very useful but one word of warning - if you use the no screen refresh option and the block can't run within one frame the project will lag horribly. Don't use anything that indicates any kind of wait if you want to use the no screen refresh option.
- World-Wide_2017
-
Scratcher
24 posts
USING MY BLOCKS IN SCRATCH
I AM FAMILIAR WITH THESE BLOCKS ONLY. PLEASE TEACH ME MORE??
move () steps
turn cw () degrees
turn ccw () degrees
point in direction ( v)
go to x: () y: (0)
glide () secs to x: (0) y: (0)
change x by ()
set x to ()
change y by ()
set y to ()
say [] for (2) secs
say []
think [] for (2) secs
think []
show
hide
switch costume to [ v]
next costume
switch backdrop to [ v]
switch backdrop to [ v] and wait
next backdrop
change [ v] effect by (25)
set [ v] effect to (0)
change size by ()
set size to () %
go to front
go back () layers
play sound [ v]
play sound [ v] until done
stop all sounds
play drum ( v) for (0.25) beats
change volume by ()
set volume to () %
when green flag clicked
when [ v] key pressed
when this sprite clicked
broadcast [ v]
when I receive [ v]
wait () secs
repeat ()
forever
if <> then
if <> then
wait until <>
repeat until <>
stop [<touching [<touching color [#051179] ?><color [#b0d798] is touching [#eda7de] ?>(☁ score)(foo) v] ?> v]
set [ v] to []
end
else
end
end
end
end
- World-Wide_2017
-
Scratcher
24 posts
USING MY BLOCKS IN SCRATCH
AND IAM NOT FAMILIAR WITH THESE.
set rotation style [ v]
if on edge, bounce(y position)(x position)(direction)
clear graphic effects(costume #)(size)(backdrop name)(backdrop #)
set instrument to ((volume) v)
change tempo by ()
set tempo to (tempo) bpm
clear
stamp
pen down
pen up
set pen color to [#f68b6d]
change pen color by ()
set pen color to ()
change pen shade by ()
set pen shade to ()
change pen size by ()
set pen size to ()
when backdrop switches to [ v]
when [ v] > (10)
broadcast [(distance to [ v]) v] and wait
ask (answer)<key [<mouse down?>(mouse x)(mouse y)(loudness)((((((pick random (<<<<<> and <>><<> or <>><not <>>(join (letter (length of (((round (list :: list)) mod (0)) mod (0))) of [world]) [world]) > []> = []> < []> - (0)) to (10)) - (0)) / (0)) * (0)) - (0)) + (0)) v] pressed?> and wait
add [] to [list v]
delete ( v) of [list v]
insert [] at (1 v) of [list v]
replace item ((item ((length of [<[ v] contains [thing] ?> v] :: list) v) of [list v] :: list) v) of [list v] with [thing]
show list [ v]
hide list [ v]
define ()
- medians
-
Scratcher
1000+ posts
USING MY BLOCKS IN SCRATCH
Oh my god I got confused for a second by “My Blocks” LOL.
Also:

A helpful guide by Griffpatch: https://scratch.mit.edu/projects/68924432/
Note: There are no longer numerical only inputs.
Also:

A helpful guide by Griffpatch: https://scratch.mit.edu/projects/68924432/
Note: There are no longer numerical only inputs.
- deck26
-
Scratcher
1000+ posts
USING MY BLOCKS IN SCRATCH
Please try to restrict a topic to one scripting question at a time. If you want to learn to use specific blocks try the wiki pages or just experiment!
- Discussion Forums
- » Help with Scripts
-
» USING MY BLOCKS IN SCRATCH
