WeDo Basic Builds and Scratch Code Blocks
Ducks – Build 1
Ducks – Scratch Code This code works with the ducks build. The ducks spin in circles. One could imagine them dancing on a lake. The build uses a motor and a pulley to make the ducks spin.
Spinner – Build 2 Spins the spinner top left or right depending on if the “L” key or the “R” key is pressed.
Monkey – Build 3
Monkey – Scratch Code This code works with the monkey build. The monkey’s arms move up and down. One could imagine monkeys jumping, and their arms going up and down as you try to catch bananas from trees in the jungle. The build uses a motor, cams, and gears to make the monkey’s arms go up and down.
Alligator - Build 4
Alligator – Scratch Code This code works with the alligator build. The alligator's mouth opens and closes. One could imagine the alligator floating in a swamp. His mouth opens and closes as he tries to catch birds and other animals that adventure across the swamp in search of food. The build uses a motor, pulley and belt and a crown gear to make his mouth open and close
Lion – Build 5
Scratch Code for Walking Lion
Scratch Code for Lion Attack
Parrot / Stork – Build 6
Parrot / Stork – Scratch Code This code works with the bird build. As you push down on the bird’s tail, it’s wings go up and when you release the tail it’s wings go down. This action is competed with the help of a cam. We use a tilt sensor to register the movement of the bird’s wings. One could imagine the bird flying through the sky trying to catch it’s food. When he needs to rest, he could land on a tree branch.
Walking - Build 7
Scratch Code for Legs and Ball
Goal Keeper - Build 8
Scratch Code for the Goal Keeper
Scratch Code for the Ball
Dancing Boy and Girl – Build 9
Dancing Boy and Girl – Lesson Idea This code works with the boy and girl build. The build uses a motor, cams and gears to make them move. You could imagine them dancing. You can use different costumes in Scratch to make your sprits (boy and girl) look like they are dancing. The code on the next page is one example of how we did it. Notice that we use a forever control block to make the action continuous.
Dancing Boy and Girl – Scratch Code
Plane – Build 10
Plane – Lesson Idea This code works with the plane build. The plane uses a motor and gears to make the propeller rotate. We have also used a tilt sensor on the plane. You can go up by tilting the plane toward the ceiling and down by tilting the plane toward the floor. The plane can also bank left or right by tilting the plane in that direction. See the tilt sensor code on the next slide. You could imagine a plane crop dusting or fighting fires.
Plane – Scratch Code (Tilt Sensor) 0 = level (ahead) 1 = down 2 = right 3 = up 4 = left
Take Off and Landing Code This code accompanies the tilt sensor code on the previous slide. Here we set the position of the plane to where it looks like it’s on the ground. We set it’s speed to 0 and ask it to glide to a position near the horizon of the sky. This makes it look like its taking off. We then increase it’s speed gradually using a speed variable land a loop. The reason we multiple the speed by -1 is that the plane is moving from right to left, which is toward a negative x. We have used a broadcast to indicate when we want to take off and land. A “t” on the keyboard is used for take off and an “l” on the keyboard is used for landing. When we land we stop all of the scripts to make is appear as the plan has landed and turned off it’s motor.
Crane and Guy – Build 11
Crane and Guy – Scratch Code
Sail Boat – Build 12
Boat – Scratch Code