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.
when gf clicked // Starts the script. pen down // Puts the pen down. glide (1) secs to x:(...) y:(...) // Makes the sprite slide to the desired X and Y position.
This script will make the sprite draw while going to a random place every 0.1 seconds.
when green flag clicked // Starts the script. pen down // Puts the pen down. forever // Lets the script repeat. wait (0.1) secs // Makes a 0.1 second delay. go to x: (pick random (-240) to (240)) y: (pick random (-180) to (180)) // Teleports the sprite to a random place.
This script will put the pen down when the mouse is down.
when green flag clicked // Starts up the script. forever // Makes the script repeat. go to (mouse pointer v) // Teleports sprite to mouse pointer if <mouse down?> then // If the mouse is clicked... pen down // Pen down! else pen up // If the mouse is not down... Pen up!
This script will draw a circle.
when green flag clicked // Starts the script. pen down // puts the pen down. repeat (360) // repeat 360 times: move (1) steps // move one step... turn right (1) degrees // and turn! end