29
WeDo Basic Builds and Scratch Code Blocks

WeDo Basic Builds and Scratch Code Blocks. Ducks – Build 1

Embed Size (px)

Citation preview

Page 1: WeDo Basic Builds and Scratch Code Blocks. Ducks – Build 1

WeDo Basic Builds and Scratch Code Blocks

Page 2: WeDo Basic Builds and Scratch Code Blocks. Ducks – Build 1

Ducks – Build 1

Page 3: 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.

Page 4: WeDo Basic Builds and Scratch Code Blocks. Ducks – Build 1

Spinner – Build 2

• Spins the spinner top left or right depending on if the “L” key or the “R” key is pressed.

Page 5: WeDo Basic Builds and Scratch Code Blocks. Ducks – Build 1

Monkey – Build 3

Page 6: WeDo Basic Builds and Scratch Code Blocks. Ducks – Build 1

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.

Page 7: WeDo Basic Builds and Scratch Code Blocks. Ducks – Build 1

Alligator - Build 4

Page 8: WeDo Basic Builds and Scratch Code Blocks. Ducks – Build 1

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

Page 9: WeDo Basic Builds and Scratch Code Blocks. Ducks – Build 1

Lion – Build 5

Page 10: WeDo Basic Builds and Scratch Code Blocks. Ducks – Build 1

Scratch Code for Walking Lion

Page 11: WeDo Basic Builds and Scratch Code Blocks. Ducks – Build 1

Scratch Code for Lion Attack

Page 12: WeDo Basic Builds and Scratch Code Blocks. Ducks – Build 1

Parrot / Stork – Build 6

Page 13: WeDo Basic Builds and Scratch Code Blocks. Ducks – Build 1

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.

Page 14: WeDo Basic Builds and Scratch Code Blocks. Ducks – Build 1

Walking - Build 7

Page 15: WeDo Basic Builds and Scratch Code Blocks. Ducks – Build 1

Scratch Code for Legs and Ball

Page 16: WeDo Basic Builds and Scratch Code Blocks. Ducks – Build 1

Goal Keeper - Build 8

Page 17: WeDo Basic Builds and Scratch Code Blocks. Ducks – Build 1

Scratch Code for the Goal Keeper

Page 18: WeDo Basic Builds and Scratch Code Blocks. Ducks – Build 1

Scratch Code for the Ball

Page 19: WeDo Basic Builds and Scratch Code Blocks. Ducks – Build 1

Dancing Boy and Girl – Build 9

Page 20: WeDo Basic Builds and Scratch Code Blocks. Ducks – Build 1

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.

Page 21: WeDo Basic Builds and Scratch Code Blocks. Ducks – Build 1

Dancing Boy and Girl – Scratch Code

Page 22: WeDo Basic Builds and Scratch Code Blocks. Ducks – Build 1

Plane – Build 10

Page 23: WeDo Basic Builds and Scratch Code Blocks. Ducks – Build 1

Plane – Lesson IdeaThis 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.

Page 24: WeDo Basic Builds and Scratch Code Blocks. Ducks – Build 1

Plane – Scratch Code(Tilt Sensor)

0 = level (ahead) 1 = down2 = right3 = up4 = left

Page 25: WeDo Basic Builds and Scratch Code Blocks. Ducks – Build 1

Take Off and Landing CodeThis 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.

Page 26: WeDo Basic Builds and Scratch Code Blocks. Ducks – Build 1

Crane and Guy – Build 11

Page 27: WeDo Basic Builds and Scratch Code Blocks. Ducks – Build 1

Crane and Guy – Scratch Code

Page 28: WeDo Basic Builds and Scratch Code Blocks. Ducks – Build 1

Sail Boat – Build 12

Page 29: WeDo Basic Builds and Scratch Code Blocks. Ducks – Build 1

Boat – Scratch Code