Basketball-TeacherGuide.pdf - Google Drive

0 downloads 194 Views 297KB Size Report
is access to a netbook, laptop, or desktop computer and an internet connection. ... Sprite:​A sprite is a character or
 

Hour of Code Teacher Guide Basketball Project Overview: ​ Students will program a basketball game with player controls. Teacher/Mentor Guidance: Before: ● Check your equipment and connection: All students need to complete this hour of code is access to a netbook, laptop, or desktop computer and an internet connection. (Note: Codesters is not compatible with touch screens at this time. Codesters is compatible across platforms and runs best in a Chrome browser.) ● Review the content (optional): Read this teacher guide and the ​ Teacher Debugging Guide​ . Work through the Basketball lesson at: https://www.codesters.com/HoC/Basketball/1/​ . During: ● Introduce the Hour of Code using materials at: ​ https://hourofcode.com/us.​ ● Show students how to navigate to the Basketball Hour of Code lesson at: https://www.codesters.com/HoC/​ . ● Circulate the room and provide assistance to students as they work-through the self-guided lesson. Even if you’ve never written a single line of code, you can help your students by using some of the strategies found in the ​ Teacher Debugging Guide.​ ● Assist students in printing their Hour of Code certificate and celebrate their success! After: ● Students who finish early or want to go beyond one hour can complete the extend activity or complete other self-guided lessons at: ​ https://www.codesters.com/HoC/​ . ● If students would like to save or share their project, they can create a free account after completing the lesson. ● If you are interested in using Codesters in your classroom, you can create a free teacher account at: ​ https://www.codesters.com/​ . Check out our learning management system, curriculum, and sample projects.

Vocabulary Code:​ Code is the language we use to communicate with a computer. Python is the type of code, or programming language, used in this lesson as well as in companies around the globe. Program:​ We use code to write programs. A program is a set of code that give instructions for performing a specific task or function. Programs run the lines of code in order from top to bottom. Sprite:​ A sprite is a character or object that students can move around the stage.

 

Variable: ​ A variable stores a value to be used later in the program. Hints and Common Errors: ● The stage is a coordinate plane with the coordinate (0, 0) at the center. Students can place new sprite, then can go to Actions and drag out a Go To block. Then they change the numbers to the (x, y) coordinate that they want. For example:

● Rename sprites and use their names to assign commands to specific sprites. ○ A sprite’s name is the orange word before the equals sign. ○ All sprite’s need a unique name. ○ To assign an action command to a sprite, change the name before the dot to the sprite’s name. This is called ​ dot notation​ .

student​= codesters.Sprite(​ "person1"​ ) This sprite’s name is student. student​ .say(​ "Welcome to my school!"​ ) By putting the sprite’s name before the .say(), we are telling the program which sprite should say “Welcome to my school!” ● Events ​ run only when they are given a signal like clicking on a sprite or pressing a key. ○ Commands that run as part of events need to be inside the event. This means they are in between the two lines of code that run the event, and they have a green block next to them showing that they are indented 4 spaces.

This line defines the event. This command is inside the event. This command is inside the event. This line listens for the signal.

def click(​ my_sprite​ ): ····​ my_sprite​ .turn_left(​ 360​ ) ····​ my_sprite​ .say(​ "Hello World!"​ ) my_sprite​ .event_click(​ click​ )