Presentation is loading. Please wait.

Presentation is loading. Please wait.

Intro CS – Costumes and Variables Lesson Plan 6. Goals  Understanding Costumes, Ordering, Naming  Switching Costumes with Switch and Next  Using Variables.

Similar presentations


Presentation on theme: "Intro CS – Costumes and Variables Lesson Plan 6. Goals  Understanding Costumes, Ordering, Naming  Switching Costumes with Switch and Next  Using Variables."— Presentation transcript:

1 Intro CS – Costumes and Variables Lesson Plan 6

2 Goals  Understanding Costumes, Ordering, Naming  Switching Costumes with Switch and Next  Using Variables to control state  Changing costumes in a loop to animate a sprite  Show and Hide  Layering

3 Objectives  Students are introduced to the topic and given examples of costumes, animation through loops, and showing/hiding sprites based on conditions  Students are introduced to variables to store and retrieve information  Students are given real problems to code and solve  Results are demonstrated through demos of running code and displayed results

4 Pre Requisites  Repeat loops  Basic Understanding of Scratch, Sprites, IF blocks

5 Materials  Slides with examples (or present on whiteboard)  PCs with development environments installed

6 Lesson Description  Students use variables to track sprite state, and animate sprites using costumes  Students practice and extend examples to their own wishes, and create costume animations  Students present their solutions, typically F2F with the instructor(s) at their desk  Students analyze their and others’ solutions for bugs

7 Lesson Procedure  Review last lessons: Repeat loops, IF blocks  Intro/examples of multiple costumes to show animation within a sprite  Using Next Costume to cycle through costumes  Setting a costume by name  Using variables to control speed of animation, applied color and graphics effects  Give exercises for in class practice (create their name with multiple sprites for each letter), and animate the sprites both through costumes and with movement (wiggle in place, slide across the screen, etc.)  Walk the room answering questions, looking over the shoulder, asking questions, etc.

8 Closure/Conclusion  Discussion  How can you use costumes for your Galaga enemy ships or Defender ship?  How can you use variables in your Galaga project?  Track/show score  Enemy lives  Defender hits before death  Power ups  Summary  Costumes are an easy way to make better looking programs  Variables are powerful for storing information for later use  Decisions/IF statements based on variables (bonus lives after score reaches a certain point?)  Storing information for later use  Tracking state  Ask questions on what is confusing or needs more time/practice

9 Costumes and Variables Lesson Plan 6

10 Example Demo  Today we will learn about variables and costumes, using these concepts and ones we have already learned we will create an animated billboard with our names (or whatever appropriate word or collection of sprites that you wish).  Demo – Name animation

11 Costume  What is a costume?  Costumes are an attribute, characteristic, or property of a sprite that helps change the look of the sprite.  What can we use costumes for?  Change the action of a sprite  Turn a sprite into something completely new  Change the background

12 Costume  What do these costume blocks do?  Switch the costume to #2  Switch the costume to the next one  Variable costume number

13 Variable  What is a variable?  Stores a value that can be reused in code.  Pros: if you want to change a number, you will only have to change it in one place.  Example how to create a variable and use it.

14 Example Demo  Demo of variable use (ballerina and animated name)

15 Daily project  By the next class: create an animated billboard.  Worth 10 points total. Save your project:  File format: LP6-YourLastName_YourFirstName.sb Grade Breakdown – Must IncludePoints Sprite initial positions are set in code 1 Contains at least 4 sprites2 Contains at least 3 costumes per sprite2 Contains 1-2 variables to control the animation2 Sprites animate through the costumes2 Sprites move and/or change effects1  Extra ideas if you want more challenges:  Use mouse or keyboard to trigger animation  Have one letter follow the mouse, and each letter follow the one in front of it  Use ghost effects to create fade-in movie banners

16 Extra activity 0 Use a variable to keep track of the score in a mini- game you create. 0 Add and remove from the variable when appropriate 0 Show the score during the game


Download ppt "Intro CS – Costumes and Variables Lesson Plan 6. Goals  Understanding Costumes, Ordering, Naming  Switching Costumes with Switch and Next  Using Variables."

Similar presentations


Ads by Google