BGE ComputingJ Balfour 2022
Follow these instructions to achieve your success criteria for this lesson.
- Understand how programming skills can be applied elsewhere
- I can make a Marty Robot move a certain number of steps
- I can explain why sequence is so important in computer programming
Movement
Your first task is to make the Marty Robot move. Using a ruler, determine how far Marty moves in a single step.
Since you have now discovered that Marty moves 0 centimetres at a time, your next step is to find out how many steps Marty will need to take to get the the yellow marker on the map.
How many steps were needed to get to the yellow zone on the map?
Now that you know that he took 0 steps to reach the yellow zone, you can now calculate how many steps are needed to get to the next zone very easily.
Using this information, you can now determine how many steps will be needed to get to just before the wall on the big map.
Now make Marty move to the wall and back again.
What you have most likely done is set the number of steps both ways manually, so if he took ten steps to move forwards, you then made him move back ten steps.
From your Scratch lessons, how could you make this more efficient (i.e. what block in Scratch allows you do something multiple times)?
Using a structure similar to one found within Scratch, make Marty move to the yellow line and back three times.
Making it even more efficient
Marty is a powerful little robot. He has many different tools and features that help make him more useful. For example, he has a sensor that allows him to detect colours with his feet.
These sensors can be used to detect a colour which Marty is expected to walk to. By using some kind of structure that allows Marty to carry something out repeatedly, we can make Marty move until he gets to a location.
Colour is composed of three different components, red, green and blue. These three components need to be checked when Marty is using his colour sensor to ensure that he is on the correct colour.
You can use the following colour input to select a colour and you can input the RGB values to test out what each of them make up.
Using the sensor built-in to Marty, make Marty move to the yellow block and then back.
To do this, place Marty on the yellow block and then use the sensor to determine each component, red, green and blue. Once you have establish what red, green and blue components are needed for the colour of the paper, you can compare them as shown:
Watch the following video to see exactly what you will need to do:
Finishing the maze
This task is in your groups.
Your job is to make Marty go from one side of the map to the other side of the map, collecting the yellow zone and stopping when it gets to the red zone. You start in the green zone.
Your code should be programmatically written to take advantage of things like the sensors and blocks that allow you to repeat something multiple times.
The following rules apply to this program:
- If Marty goes off to the side slightly (drifts), you can give him a little push to put him back on track again.
- If Marty senses black underneath him then the program should stop.
- If Marty senses yellow and there is not enough room for him to turn around, you may manually help him rotate.