|
Computer Science Home
6th Grade Tech Ed
7th Grade Computer Science
8th Grade Computer Science A
Gmail
Google Drive
Google Classroom
Infinite Campus
Typing.com
(Join Class through Google Classroom)
Schoology
Code.org
Tynker Coding Website
Tynker Resource Page
Tynker Online Support Video Help
Quizlet | Quizlet LIVE
Everfi
Khan Academy
Social Media Tips
Netsmartz
Code HS
Karel the Dog class code: 1251
CSTA Standards
ISTE Standards
|
Detecting Colors (Lesson 5)
Introduction
In this lesson, you will learn how to detect when an Actor is touching a certain color, another Actor, or the edges of the Stage. Additionally, you will create a car sketching game!
New Code Blocks
- : If the condition is true, then run the code inside the block.
Objectives
you will...
- Use code blocks to detect when an Actor is touching a certain color, another Actor, or the edges of the Stage
- Create a sketching game
Warm-Up (15 minutes)
- You will learn how to detect when an Actor is touching a certain color, another Actor, or the edges of the Stage.
- As a class, brainstorm different situations when you would want your Actor to detect another color, another Actor, or the edges of the Stage. For example,
- If you’re creating a maze game, you can program an Actor to return to the beginning of the maze if it touches the maze wall.
- You can program your Actor to react (e.g., grow, shrink, explode) when it touches another Actor.
- You can program your Actor to detect the edges of the Stage and never leave the screen.
1. Introduction (Video)
- A friendly alien introduces two coding concepts:
- Touching Color?- you will watch Codey demonstrate how the “touching color” block checks if an Actor is touching a specific color.
- Touching?- you will watch Codey and the friendly alien demonstrate how the “touching?” block can be applied to different situations.
2. Explode on Impact Example (Example)
- you will play a completed Explode on Impact game. You’ll create their own version of this game in the next module!
- How to play: You to use the arrow keys to move the racer. If the racer touches an enemy trail, it’s game over!
3. Explode on Impact (DIY)
- In this DIY (do-it-yourself) project, you will program a racer game where racers explode if You touch other racers’ pen trails!
- Activities include animating explosion and detecting when Actors touch certain colors.
4. Enemy Racers Explode on Impact (Puzzle)
- To solve this puzzle module, you will need to program two enemy racers to explode when You touch the green line.
- Give a hint: Ask you…
- There are 9 costumes for both of the cars SO:
you need to use the 8x loop to go thru all of the costumes before hiding the enemy cars!
- What coding block should we add to each of the racers’ code so You explode when touching the green line?
- How do we get the racer to look like it exploded?
5. Detect Color Example (Example)
- you will view a completed Detect Color project. You’ll create their own version of this project in the next module!
- What happens when one car touches the other car’s line.
6. Detect Color (DIY)
- In this DIY (do-it-yourself) project, you will program a car sketching game. Both cars will follow the student’s mouse pointer, and the game will restart if either car touches the other, or the other’s trail.
- You will need to program the red car to follow their mouse or finger, leave a pen trail, and start over. The yellow car’s code is already complete.
- How long can your you keep the cars separated?
7. Quiz (Multiple-choice)
- you will answer 5 multiple-choice questions to review concepts from this lesson.
Are you already done???? Extended Activities (10 minutes)
More Practice
- Challenge: practice the skills you’ve learned in this course by creating a game that uses
- “change size by”
- “play sound”
- “touching?” code blocks.
- For example, you could create a game with a garden scene with a bee that lands on flowers. When the bee lands on a specific color or Actor, the bee can make a buzzing sound and grow larger. Bonus: Program other Actors to chase the bee.
U.S. Standards
- K-12 CTSA Computer Science Standards (Revised 2017)
Computer Science Teachers Association:
- 1B-AP-10
- 1B-AP-11
- 1B-AP-12
- 1B-AP-15
- 2-AP-12
- 2-AP-13
- 2-AP-15
- 2-AP-16
- 2-AP-17
CCSS-Math: MP.1
- CCSS-ELA: RF.5.4.A, 6-8.RST.3, 6-8.RST.4, 6-8.RST.7
- CS CA: 3-5.AP.10, 3-5.AP.12, 3-5.AP.13, 3-5.AP.14, 3-5.AP.17, 6-8.AP.12, 6-8.AP.13, 6-8.AP.16, 6-8.AP.17
- ISTE: 1.c, 1.d, 4.d, 5.c, 5.d, 6.b
|