1 of 22

The Arizona STEM Acceleration Project

Intro To Coding (Clicking Game)

2 of 22

Intro to Coding

(Clicking Game)

An 8th Grade STEM Lesson

Phil Oliver

Date: 1/25/23

3 of 22

Notes for Teachers

Context: This lesson takes place in a classroom or computer lab for two 50-minutes class periods.

​

List of Materials

  • 1-to-1 computer/Chromebook or Ipad
  • Pencil and paper
  • Additional materials

4 of 22

Arizona Standards

Computer Science

Algorithms & Programming

​

7 & 8 AP.C.1: Design & develop programs that combine control structures including nested loops and compound conditionals.

​

7 & 8 AP.M.2: Create procedures with parameters to organize code and make it easier to reuse.

Science & Engineering Practices

​

● use mathematics and computational thinking

● construct explanations and design solutions

● obtain, evaluate, and communicate information

​

Ed Technology

6-8.5.d. Students understand how automation works and apply algorithmic thinking to design and automate solutions.

5 of 22

Objective(s):

Today we will be introduced to basic coding with the use of scratch.mit.edu.

Students will play a clicking game designed and created in scratch.mit.edu.

Students will design and then create a similar game in scratch.mit.edu.

Students will test their game and evaluate their game design.

6 of 22

Agenda (Day 1 - 55 minutes)

Intro to coding what is it and how can we use it?

Play example game 5 min

  • 1-2 minutes for self-exploration
  • 1 min. challenge who can get the highest score
  • 1 min. challenge who can get the highest score

Create teacher-designed clicking game

  • Students copy the teacher design.
  • If time permits, students will add their own sprite/level.

7 of 22

Agenda (Day 2 - 55 minutes)

Design a clicking game

  • Based on day 1 students will use pencil and paper to plan out and design their own clicker game.

Create the clicking game.

Test or share game.

8 of 22

Coding what is it? What can you do with it?

​

​

9 of 22

Hands-on Activity Instructions

Day 1

  • Groups of 2
  • As a group and individuals, students will create the teacher-designed clicking game (follow step-by-step instructions on slides 10-20). I shared this slides on my board and then created each step on my board with them.

​

​

Day 2

  • Groups will use pencil and paper to design the and plan out their clicking game.
  • Once the design has been approved students work together to create their clicking game.
  • individual group members will create the same game as their partner.
  • If students create an account with Scratch.mit.edu, they can share it as a website or they can just download the code and share it with you.

​

​

10 of 22

SCRATCH

CREATING A CLICKER GAME

11 of 22

12 of 22

Delete cat sprite and add the baseball sprite

13 of 22

  • Make two new variables
    • Points
    • Points Per Second
  • Delete “my variable

14 of 22

  • Create a reset script

​

This will act like a start button

15 of 22

This script will add one point every time the baseball sprite is clicked.

The set size script will make it look like “explodes” when clicked and the sound pop will play.

You may want to save this part for last as it is not necessary and the students will get off task changing the sound or just playing the sound. This can get old real fast.

16 of 22

  • Create a second sprite (batter)
  • Add a costume

​

17 of 22

  • This script will give the sprite a ghost affect until you have 10 points or more

​

18 of 22

  • This script makes it so nothing happens when there is less than 10 points. But when there is more than 10 points and you click on this sprite it will take away 10 points and then change the points per second by 1.

​

​

19 of 22

  • This last script will add your points per second to your points. You may need to click on the green flag to make it work.

20 of 22

AS TIME ALLOWS

Allow the students to go back and add sounds to the sprites when they are clicked on. They can also add a backdrop.

21 of 22

Assessment

Formative: Check that each Sprite works correctly.

Summative: Does the game work and meet all criteria?

Did students plan out their own game on paper prior to coding?

Students can answer self-reflection questions after the lesson.

Example Questions:

  1. What was the most significant insight or lesson learned during the coding process?
  2. How can you apply what you learned to future coding activities?

22 of 22

Differentiation

Day 2 could be used to correct any issues students had with the teacher-designed game.

Another option: instead of creating their own game, they could add a new sprite with it’s own set of rewards.

​

Strategically pair students as needed.

​

Provide additional video resources for students as needed.

​

Create a word wall with key vocabulary and images.

Remediation

Extension/Enrichment

Student could add multiple sprites with positive and negative rewards.

Students can add motion to their sprites.