Events
Summary
Materials
- Day 4 PowerPoint deck
- My Galga Game
- MakeCode Arcade
- Which Button? code (for teacher)
- Galga code (for teacher)
Instructional Activities and Classroom Assessments
- Algorithm Review (5 minutes)
- Introduce Events (10 minutes)
- Create Galga Game (25 minutes)
- Modify Galga Game (10 minutes)
Learning Objectives
Essential Knowledge
AAP-2.B.1 Sequencing is the application of each step of an algorithm in the order in which the code statements are given. AAP-2.B.2 A code statement is a part of program code that expresses an action to be carried out. AAP-2.B.6 Sequential statements execute in the order they appear in the code segment.
- CRD-2.I.2 A syntax error is a mistake in the program where the rules of the programming language are not followed.
- CRD-2.C.2 An event is associated with an action and supplies input data to a program.
- CRD-2.C.3 Events can be generated when a key is pressed, a mouse is clicked, a program is started, or any other defined action occurs that affects the flow of execution.
Details
1. Algorithm review (5 minutes)
- What are the three types of constructs used in algorithm implementations?
- How does a debugger help your coding?
2. Introduce Events (10 minutes)
- Define an event.
- Explain what an event handler is.
- Identify event handlers in a program.
- Explore event handlers in MakeCode.
- Trace code for the Which Button? program.
- Follow an event in MakeCode debugger.
3. Create Galga game (25 minutes)
- Guide students through creating a game that uses several event handlers:
- On start
- On game update
- On A button pressed
- On sprite overlaps
- Ask students to publish their game and post the link to their My Galga Game page.
- Encourage students to save their game to their computer also.
- Have students play their game a few times to see how it works.
4. Modify Galga game (10 minutes)
- Encourage students to modify their Galga game to make it unique.
- Students should explore other game features and insert items they feel will work with their vision for the game.
- Show them how to learn what different blocks do by using the Help feature.
- Encourage students to add comments to the blocks they add.
- Ask students to re-publish their game and add the link to their My Galga Game.