
4.2. LightsOff Tutorial¶
This lesson creates an App Inventor version of the classic Whack-a-Mole game. The student will follow an instructor-led tutorial that will introduce the concepts of animation, timing, and randomness. The student will also see again the concept of a programmer-defined procedure, an important abstraction. This lesson reinforces the enduring understanding that procedures are useful abstractions that are used by programmers to structure and simplify programs.
CSP Framework | |||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||||||||||||||||||||||||||||||||
Enduring Understanding AAP-3: Programmers break down problems into smaller and more manageable pieces. By creating procedures and leveraging parameters, programmers generalize processes that can be reused. Procedures allow programmers to draw upon existing code that has already been tested, allowing them to write programs more quickly and with more confidence. | |||||||||||||||||||||||||||||||||||||||||
Learning Objective AAP-3.A.a: For procedure calls: a. Write statements to call procedures. Learning Objective AAP-3.A.b: For procedure calls: b. Determine the result or effect of a procedure call. | |||||||||||||||||||||||||||||||||||||||||
Learning Objective AAP-3.B: Explain how the use of procedural abstraction manages complexity in a program. | |||||||||||||||||||||||||||||||||||||||||
Learning Objective AAP-3.C: Develop procedural abstractions to manage complexity in a program by writing procedures. | |||||||||||||||||||||||||||||||||||||||||
Professional Development
The Student Lesson: Complete the activities for Mobile CSP Unit 4, Lesson 4.2:LightsOff Tutorial.
Materials
- Presentation system (LCD projector/Interactive whiteboard)
- Access to computer, laptop, or Chromebook (install the Companion app on Chromebooks)
- Access to mobile device with the Companion app installed or access to the emulator installed on the computer or laptop.
- LightsOff Tutorial
4.2.1. Learning Activities¶
Estimated Length: 45 minutes
- Hook/Motivation (5 minutes): In the prior App Inventor lesson, Paint Pot, we introduced an abstraction concept, a variable. Do the students remember its purpose and why we decided to introduce a variable into the Paint Pot Lesson? Describe the student objectives for today’s lesson. In today's lesson another abstraction concept, the concept of defining a procedure from Paint Pot Refactoring, will be revisited. Remind the students that a procedure is a sequence of instructions that can be carried out by calling the procedure.
- Experiences and Explorations (25 minutes): Lead the students through the LightsOff tutorial. Allow faster students to follow the tutorial on their own. Identify new components used in this app, the ImageSprite, and how the ImageSprite component is used to animate the lightBulb. Ensure that students know that ImageSprites require a Canvas component. Lead the design of the UI with the students and walk students through the coding of the app. Be sure to spend time reiterating that a procedure is a sequence of instructions that can be carried out by calling the procedure.
- Rethink, Reflect and/or Revise (15 minutes): As a class discuss the following: How was the animation of the ImageSprite achieved in this app? How does a computer program perform animation? How does a computer card game produce a random card number in a specific range of values? Choose students “randomly” to answer the questions.
Have the students try to complete the interactive exercises and complete a reflection in their portfolio. If students do not finish the reflection in class, have them finish it for homework.
4.2.2. Professional Development Reflection¶
Discuss the following questions with other teachers in your professional development program.
- Is there anything else you would need to have or know to teach this lesson effectively?
- What specific elements of this lesson (examples, activities, etc.) would you change?
- How would you modify or add to the interactive exercises (formative assessments)?
-
I am confident I can teach this lesson to my students.
- 1. Strongly Agree
- 2. Agree
- 3. Neutral
- 4. Disagree
- 5. Strongly Disagree