Examples of Scripts with Pen Blocks

Материал из Поле цифровой дидактики

Шаблон:Stub One can make any project with whatever pen blocks they like, but here are some ideas:

This script will make the sprite draw and glide/slide to a specific location.

whenclickedStartsthescript.pendownPutsthependown.glide1secstox:...y:...MakesthespriteslidetothedesiredXandYposition.

This script will make the sprite draw while going to a random place every 0.1 seconds.

whenclickedStartsthescript.pendownPutsthependown.foreverLetsthescriptrepeat.wait0.1secsMakesa0.1seconddelay.gotox:pickrandom-240to240y:pickrandom-180to180Teleportsthespritetoarandomplace.

This script will put the pen down when the mouse is down.

whenclickedStartsupthescript.foreverMakesthescriptrepeat.gotomousepointerTeleportsspritetomousepointerifmousedown?thenIfthemouseisclicked...pendownPendown!elsepenupIfthemouseisnotdown...Penup!

This script will draw a circle.

whenclickedStartsthescript.pendownputsthependown.repeat360repeat360times:move1stepsmoveonestep...turn1degreesandturn!end

See Also

fr:Scratch Wiki Accueil/tutos/021 Dessiner avec souris