< Course F (2024)

Lesson 11: Mini-Project: Collector Game

45 minutes

Overview

In this mini-project lesson, students will create a customized "collector game", in which the user moves a sprite around to collect objects.

Purpose

This project is designed to allow students to apply their new knowledge of variables in a fun way. By understanding how to modify the value stored in a variable, students can create a game that automatically keeps the score based on the player's actions.

CSTA K-12 Computer Science Standards (2017)
    • 1B-AP-08 - Compare and refine multiple algorithms for the same task and determine which is the most appropriate.
    • 1B-AP-09 - Create programs that use variables to store and modify data.
    • 1B-AP-10 - Create programs that include sequences, events, loops, and conditionals.
    • 1B-AP-12 - Modify, remix or incorporate portions of an existing program into one's own work, to develop something new or add more advanced features.
    • 1B-AP-15 - Test and debug (identify and fix errors) a program or algorithm to ensure it runs as intended.
    • 1B-AP-16 - Take on varying roles, with teacher guidance, when collaborating with peers during the design, implementation and review stages of program development.

Agenda

Objectives

Students will be able to:
  • Create their own collector game in Sprite Lab using multiple sprites which are controlled individually and variables to track the player’s score

Preparation

Play through the levels and review the lesson slides.

Links

Heads Up! Please make a copy of any documents you plan to share with students.

For the teachers

Teaching Guide

Warm Up (5 minutes)

Introduction

Display: Show “Reflect” slide

Reflect: What makes an activity a game?

Discussion Goal: Students should understand that games usually involve players, score(s), a win or lose condition, and different outcomes. Each time a user plays through a game they might have a different outcome or score.

Main Activity (30 minutes)

Mini-Project: Collector Game

Exploration (10 mins)

Display: Show “Level 1 - Exploration” slide

Goal: Today, students will be creating their own interactive collector game in Sprite Lab! They'll begin by exploring a few examples. Then, after a quick introduction on customizing sprite behavior and keeping track of the score, students will work on designing their own game.

Remarks

Now it is time to explore some projects on your own. For each project, think about:

  • What do all of these projects have in common?
  • How are they different from each other?
  • What do you notice about the code in each project?

When you finish exploring, click “Finish” and move on to the next level.

Transition: Move students to their computers.

Do This: Before students start the mini-project, have them explore the example projects in level 1. When they are ready to start planning their own program they can press "Finish" and continue on.

Mini-Project (20 mins)

Display: Show “Levels 2-8 - Mini-Project: Collector Game” slide

Do This: Encourage students to follow the instructions for each level. In the last level they can add whatever they like to their code. For example, they can change the background at the end of the game or add sounds.

Wrap Up (10 minutes)

Showcase

Display: Show “Showcase” slide

Do This: To celebrate students' work, spend the last 10 minutes or so allowing them to showcase their projects. This can be done in many ways, but here are a few:

  • Public Demo: Select a few exemplary volunteers to briefly demo their projects in front of the class. As they do so, have them touch on what the planning-to-coding experience was like for them, including ideas they'd still like to implement.

  • Pair Playtesting: Have students or groups pair up and playtest each other's projects. As they do, ask them to provide positive and constructive feedback to each other. The benefit here is that students will have the opportunity to provide and respond to feedback in a smaller setting.

  • Gallery Walk: Ensure all students have their projects ready for testing. Have students move "musical chairs"-style to another computer and play/test the project there for a few minutes, until they receive a signal from you to move to another computer. Repeat this every few minutes. While there is less opportunity for structured communication here, this ensures students get to demo as many of their peers' projects as possible.

Reflect

Display: Show “Reflect” slide

Reflect: What did you like about the games that your classmates made? What surprised you?

Creative Commons License (CC BY-NC-SA 4.0).

This work is available under a Creative Commons License (CC BY-NC-SA 4.0).

If you are interested in licensing Code.org materials for commercial purposes contact us.