BLOCKS | WORKSPACE: / BLOCKS |
---|
CODE WITH
FINISH YOUR HOUR OF CODE
BLOCKS | WORKSPACE: / BLOCKS |
---|
giftbox,230,430;goal,0,230,430
1,2,0,1,1
Drag a block to the workspace and connect it with the block.
Then press the button to try your program.
It's time for us to save Christmas!
You've got to capture all the presents to deliver back to Whoville.
Let's use an algorithm to program our Drone to move forward one block to pick up some presents.
Try placing one right under the block.
giftbox,330,430;goal,0,330,430
1,3,0,1,1
Let's pick up the presents further away from you.
Drag and drop the move blocks into the workspace to guide the drone further forward to pick up the presents.
Excellent! Now let's fly the drone a bit more over to the right to pick up the presents laying around in the snow over there.
You can drag out two and place them under the block to get the drone to move forward two blocks.
giftbox,330,330;tree,330,400;goal,0,330,330
1,4,0,1,1
Drag and drop the into the workspace to capture the presents.
Click the drop down to change the direction of the drone.
Great, the drone is doing an awesome job picking up presents.
Let's pick up some more around here but be careful!
avoid flying your drone into the trees!
You can stack multiple to program the drone to move multiple blocks. Remember you can also choose the direction the drone moves by selecting the dropdown.
giftbox,330,330;giftbox,430,430;tree,330,400;goal,0,330,330;goal,0,430,430
1,6,0,1,1
Drag and drop the into the workspace to guide drone to the presents at the other side of the trees.
Click the drop down to change the direction of the drone.
We've got our first couple of presents Max!
Let's keep flying around to pick up the rest. Avoid flying the drone into the trees.
You can stack multiple to program the drone to move multiple blocks. Remember you can also choose the direction the drone moves by selecting the dropdown.
giftbox,330,330;giftbox,430,430;tree,330,400;tree,530,400;giftbox,530,530;giftbox,630,430;;goal,0,330,330;goal,0,430,430;goal,0,530,530;goal,0,630,430
1,10,0,1,1
Drag and drop the into the workspace to guide drone to the presents at the other side of the trees.
Click the drop down to change the direction of the drone.
We're almost done picking up the presents at the top of the mountain, Max!
Let's keep flying around to pick up the rest.
You can stack multiple to program the drone to move multiple blocks. Remember you can also choose the direction the drone moves by selecting the dropdown.
giftbox,500;goal,0,0;giftbox,500;goal,0,0;giftbox,500;goal,0,0
2,4,1,2,1
Key Listening:
Where programmers set the game to listen for keys and run code when that key is pressed.
Use the and the to program the sleigh to speed up when the right arrow is pressed.
Alright! We've got most of the presents at the top of the mountain.
Time to hop in the sleigh and test the controls.
Let's move forward to pick up those presents over there.
Place a block in the F.L.O.A.T. tool and select the appropriate key with the dropdown.
giftbox,300;goal,0,0;giftboxf,600;goalf,0,0;goal,1,400
2,6,1,2,1
Use the and another to program the sleigh to jump.
Use the dropdown to chose which key makes the sleigh jump.
Great! Now that we've got the sled moving let's test out the jumping system.
Let's program the sleigh to jump!
Place a block in the F.L.O.A.T. tool and select the appropriate key with the dropdown.
reindeer,700;reindeer,1000;goal,2,1000;goal,1,1400
2,10,2,2,1
Use the to program the sleigh to slow down.
Use the dropdown to chose which key makes the sleigh slow down.
Slow Down to a stop after picking up Max.
Now you're really moving! But theres some reindeers in the way.
Let's hop over the reindeers and pick up Max.
Make sure to slow down to a stop after picking up Max.
Place a block in the tool and select the correct key in the dropdown.
Be sure to hold down the arrow keys to slow down or speed up the sleigh.
tree,700;tree,1000;tree,1000;goal,1,400
2,10,3,3,1
Drag and drop the blocks into the workspace to program the sleigh to slow down, speed up, and jump over the trees.
Great! The test went amazing! Now it's time to start going downhill.
lets try to jump over some trees
Place a block in the F.L.O.A.T. tool and select the appropriate key with the dropdown.
tree,800;giftbox,700;goal,0,0;tree,700;reindeer,1000;tree,700;giftbox,900;goal,0,0;goal,1,400
2,20,3,3,1
Use the and another to program Max to bark.
Program max to bark and avoid obstacles to pass this lesson.
Awesome! You got the sleigh to work! But now we've got to deal with those reindeer!
Lets get Max to bark them away!
Place a block in the F.L.O.A.T. tool and select the appropriate key with the dropdown.
decoration,600;goal,0,0;decoration,600;goal,0,0;decoration,600;goal,0,0; goal,1,200
2,10,3,3,1
Use the and another to program the Grinch to throw snowballs.
Throw snowballs at all the decorations to pass this lesson.
Awesome! Now we've got to handle those Christmas decorations!
You can program the Grinch to throw snowballs to take out those decorations.
Place a block in the F.L.O.A.T. tool and select the appropriate key with the dropdown.
tree,800;giftbox,700;decoration,700;giftbox,500;tree,700;giftbox,700;giftbox,400;goal,1,300
2,10,3,3,2,100
Event Listener
When you set the system to listen for an event and run code when the event is triggered.
Use the and the to program the game to add 50 points when a present is touched.
Collect 100 points to pass this lesson.
Now we're making some progress! We'll get down there in no time.
Let's program the system to keep track of your score when you catch a present.
Place a in the statement and change the number from 0 to any number you want.
giftbox,300;giftbox,300;giftbox,300;goal,1,400
2,2,3,3,1
Use the and the to program the game to play a different sound when a present is touched.
Hey you're doing awesome! Event listeners can be used respond to many events.
Let's use an event listener to change the sound a present makes when you touch it
Place a block in the statement and choose any sound you want from the dropdown.
reindeer,900;reindeer,600;reindeer,600;reindeer,600;goal,1,400
2,4,3,3,1
Use the and the to play Max’s Bark whenever it senses a reindeer nearby.
Ahh this is getting boring. Let's use the sleigh's automated system.
You’ll need to program it to handle obstacles so you can nap.
Let’s test it out with something simple like barking away the reindeers with Max's recorded bark.
Place a block in the B.A.G.S. tool and select the appropriate object to look out for.
decoration,600;goal,0,0;decoration,800;goal,0,0;reindeer,500;decoration,800;goal,0,0;goal,1,400
2,4,3,3,1
Use the and the to to throw snowballs whenever it senses a decoration nearby.
Hey that worked really well! Let's use the sleigh's guidance system to handle something else.
There are plenty of decorations on the way down.
Let’s program the system to throw some snowballs and show them who's boss.
Place a block in the B.A.G.S. tool and select the appropriate object to look out for.
giftboxf,500;goalf,0,0;giftboxf,600;goalf,0,0;reindeer,500;giftboxf,600;goalf,0,0;decoration,800;goal,0,0;
2,6,3,3,1
Use the and the to jump and grab presents whenever it senses a flying present above.
Okay! The snowball system works great.
Now it’s time to set the sleigh to jump and grab flying presents when they are nearby.
Place a block in the B.A.G.S. tool and select the appropriate object to look out for.
tree,600;giftbox,400;decoration,500;goal,0,0;giftbox,400;reindeer,500;giftboxf,400;goalf,0,0;giftbox,400;goal,1,200
2,8,3,3,1
Use the and the to jump over trees whenever it senses a tree up ahead.
Remember to program the system to handle all the other obstacles up ahead as well.
Great! Now the system can almost handle everything in the way down the mountain.
Now we've just got to handle those pesky trees.
Let's get the sleigh to jump over the trees up ahead.
Place a block in the B.A.G.S. tool and select the appropriate object to look out for.
tree,2,600;tree,1,600;giftbox,3,600;tree,2,600;tree,3,600;giftbox,1,600;tree,1,600;tree,3,600;giftbox,2,600;reindeer,2,600;decoration,2,600
2,14,3,4,1
If Statements
used to run some code "if" a condition is met. Like if lane 1 has no obstacles, then move to lane 1.
Use , , and to program the sleigh to move to an free lane
All this bouncing broke the jump system! You can still use the B.A.G.S. system to steer the sleigh while you take a nap.
lets to move the sleigh out into an empty lane to avoid the trees.
Try placing a for lanes 1, 2, and 3 in each empty space in
Remember to change the dropdown options to move to the correct lane.
2,15,3,4,2,100
Use and to move around the lanes.
You are free to use the other blocks you learned.
Earn 100 points with to win this level.
You drooled on the controls while taking a nap!
That fried the BAGS circuits. You’ll have to steer the sleigh yourself!
Try placing an action block in the key press tool and select the right key with the dropdown.
Also, place a in the statement and change the number from 0 to any number you want.
2,100,3,4,1
Make Your Own Obstacles
Use and to spawn items in different lanes.
Add as many obstacles as you'd like.
Complete the obstacle course to win the level.
Now it's your chance to make your own level for you and your friends to try!
Make sure its possible to complete your game. For example, all three lanes shouldnt have a tree.