Program Marty to respond to events such as pressing a key

21 of 21 linked standards shown.
| Curriculum area | Linked standards |
|---|---|
| Digital Technologies, Design & technologies: Digital Technologies |
Select a code to read the full standard.
| Curriculum area | Linked standards |
|---|---|
| General standards |
Select a code to read the full standard.
| Curriculum area | Linked standards |
|---|---|
| Health and Wellbeing: Mental, Emotional, Social and Physical Wellbeing | |
| Literacy & English: Listening and Talking | |
| Literacy & English: Writing | |
| Technologies: Computing Science | |
| Technologies: Craft, Design, Engineering and Graphics |
Select a code to read the full standard.
| Curriculum area | Linked standards |
|---|---|
| Computing, Design and Technology: Computing | |
| Computing, Design and Technology: Design and Technology |
Select a code to read the full standard.
| Curriculum area | Linked standards |
|---|---|
| International Society for Technology in Education (ISTE) |
Select a code to read the full standard.
| Curriculum area | Linked standards |
|---|---|
| Elementary Technology Applications: Grade 3 to Grade 5 |
Select a code to read the full standard.
Students will have been using the main green flag event block for programs in MartyBlocks. This lesson will introduce more functionality behind the events section, in MartyBlocks. Event blocks can be triggered by different things, the green flag is only one of them. This will set the stage for parallel programming and connectivity with other devices, like the micro:bit.
In this lesson, learners will create a basic remote control to be used with Marty via different event blocks; this program will rely on learners using sprites as triggers. The use of sprites requires an internet connection.
Practice using blocks, in MartyBlocks; knowledge of some block names
To complete this lesson, learners need to be using a tablet and have an internet connection.
Share with learners the first slides of the presentation, displaying the objectives and success criteria.
Ask learners how many of them use the keyboard on their devices to control actions or if they prefer another way to interact with them: mouse, voice, gesture, etc. Share with learners the short spoof video that features the one key keyboard, Mactini, located in the presentation. Ask learners if they think this way of interaction is efficient or if there is something more they could do.
After watching the video, share that this device has one event with multiple if statements controlling the displayed text on the screen after each key press or combination of key presses. Ask learners to fill in ideas in the workbook why having a one key keyboard could be a good idea and why it could be a bad idea.
Share that today, they will be creating a remote for Marty that will control him with multiple event blocks. Share an idea for a video that displays Marty moving in the four directions, being controlled by Sprites in MartyBlocks. This video does not have the code alongside the video because you wouldn't see which sprite was being pressed. The other videos, showing how to add sprites and actions for the sprites clearly describe this process. The teacher guide displays all the code that was used to move Marty with the sprites.
Show learners the main MartyBlocks screen, this is available as a recorded video from the presentation or if your device is connected to the board/projector, feel free to show the following steps from there. Both this video and the one below, have subtitles to support where to click; feel free to turn them on, in YouTube.
This video, below, shows Marty responding to the two different blocks as they are clicked, from the above example. This video is featured in the presentation but can be removed, if desired.
Ask learners what keys or symbols they would choose to use for controlling Marty: remind them that we used the Marty sprite to get ready; we could use Marty to move a certain way but would other people understand that clicking Marty would make him move or are there more natural symbols to control his movement? Learners might suggest the arrow keys or the WASD keys on the keyboard. Record the ideas on the board and have learners record their ideas in the workbook with annotations for what each key/symbol should do.
Once a bit of time has been given to record this, remind learners, or introduce them to, the sprite library:
Before having learners explore the sprite library, click on the costumes tab, at the top of the window, to explore what can be done to change the look of a sprite. Point out that this also includes flipping and color changes and that other icons may have more options (as it happens, the arrows, that learners will likely settle on, also feature alternate arrows at 90 degree turns). Finally, show what the paintbrush icon does, after tapping the add sprite icon: create your own sprite.
Encourage learners to explore the sprite library to find any icons they think would be appropriate for what they need to do and allow them time to explore the options that go with sprites.
Learners need to have their idea for what sprites will do before beginning the code. Once this is decided, it should not take very long for them to assign commands to each block/sprite and explain. Reinforce that it is the sprite tap that is triggering the code, not the green flag. To highlight this, it may be helpful to illustrate what happens with Marty should learners use the green flag event block for each of the sprites. The only output will be the actions attached to the green flag event block for the Marty sprite workspace: none of the other sprites have a green flag event block.
Learners need to meet the criteria of 4 directions. Extension activities offer ideas to take this further.
Bring learners back together to discuss the challenges they faced and overcame. Have groups model their creations and explain what is happening, when. Encourage other groups to ask questions to deepen the understanding of the processes.
Suggested questions you might ask:
Carry out any end of lesson routines.
Log off devices and clear everything away.