Intro CS – Costumes and Variables

Slides:



Advertisements
Similar presentations
Code Club Session 3 Shark Eats Fish. Picture of finished product here.
Advertisements

Scratch Programming Session 6 of 10 If-then-else statements interactions Final projects specifications.
INTRODUCTION TO SCRATCH. About Me Resources Scratch Website Learn Scratch Washington-Lee Computer.
SCRATCH This Design Notebook belongs to:. 3 What are the different ways you interact with computers? List your answers here: 5.
Mr. Wortzman. Tabs (Block Categories) Available Blocks Script Area Sprite Stage All sprites in this project.
GAME:IT Junior Bouncing Ball Objectives: Create Sprites Create Sounds Create Objects Create Room Program simple game.
Fish Chomp. The screen where you can see what happens when you play your game is called the STAGE. The SCRIPT BANK is where the types of instructions.
Every week: Sign in at the door If you are new: Fill in Registration Form Ask a Mentor how to get started Make sure you are on the Athenry Parents/Kids.
CSCI 101 Introduction to Software Development and Design.
Line up By Melissa Dalis Professor Susan Rodger Duke University June 2011.
INTRODUCTION TO THE SCRATCH PROGRAMMING ENVIRONMENT.
CATCH SCRATCH! Programming from Scratch. Remember Scratch?
Exploring Computer Science 2/23/15 2/23 Develop a Scratch story project -Brainstorming 2/24 Develop a Scratch story project –Developing 2/25 Develop a.
Every week: Sign in at the door If you are new: Fill in Registration Form Ask a Mentor how to get started Make sure you are on the Athenry Parents/Kids.
Exploring Computer Science 2/16/15
Computer Science 1172 Scratch Project on Artificial Intelligence and Computational Thinking Nicholas Crabtree Jiang Jiang Liu Thinking Speaking Writing.
CoderDojo Roscommon. Today's Ninja Challenge: Create a GhostBuster Game Like This.
Moving Around in Scratch The Basics… -You do want to have Scratch open as you will be creating a program. -Follow the instructions and if you have questions.
Exploring Computer Science 2/9/15 2/9Moving Scratch 2/10Moving Scratch worksheet 2/11 Scratch Baseball Game 2/12Scratch Alphabet Learning Game 2/13Game.
Fish Chomp. The screen where you can see what happens when you play your game is called the STAGE. The SCRIPT BANK is where the types of instructions.
Intro CS – Screens and Variables Lesson Plan 9. Goals  Using sprites as full screens (Start screen, Game over)  Using layering to control ordering of.
University Learning in Schools Computing Games Programming Lesson 5.
Today's Ninja Challenge: Write Your First Computer Game!
Making a Flappy Birds Game PART 2 – MAKING THE BIRD FLAP AND FALL – AND DEVELOPING THE GAME FURTHER (ADDING ADDITIONAL CHARACTERS, GOODIES, ENEMIES AND.
Intro CS – Costumes and Variables Lesson Plan 6. Goals  Understanding Costumes, Ordering, Naming  Switching Costumes with Switch and Next  Using Variables.
Intro CS – Broadcasting Messages Lesson Plan 8. Goals  Using broadcasting to track events across sprites and act on them.
Intro CS – Logic & Operators Lesson Plan 5. Goals  Students can explain basic logical operators  AND, OR, NOT  Students can create truth tables for.
Intro CS – Probability and Random Numbers Lesson Plan 6a.
Intro CS – Loops, making animations & films Lesson Plan 3.
Event Driven Programs Exploring Computer Science – Lesson 4-5.
Index Background Costumes Making object walk smoothly Controlling an object with the keyboard Control an object with the mouse Changing costume when hit.
Intro CS – Keyboard and mouse input Lesson Plan 7.
Introduction to Scratch
Movement Game Design (Scratch).
Customise & Explain your game
Intro CS – Screens and Variables
Broadcasting (Adding a new level)
Games Programming in Scratch
Intro CS – Loops, making animations & films
Intro CS – Loops & Creating Shapes
Madlib-Input, Strings, and Lists in Scratch
How to work with your sprite
Spanish Mad libs with Scratch
Exploring Computer Science – Lesson 4-5
Intro CS – Probability and Random Numbers
Intro CS – Keyboard and mouse input
Randomising the behaviour of Sprites
Intro to Programming with Scratch
Scratch – Simple Programming
Stopwatch Cards Stopwatch Cards
Playing with Pictures Module 1 Lesson 3.
Module 5 Lesson 3 Extreme Scratch Cards
Getting Started with Scratch
Scratch – Simple Programming
An Introduction to VEX IQ Programming with Modkit
An Introduction to VEX IQ Programming with Modkit
Stopwatch Cards Stopwatch Cards
Intro to Programming Mod 5 Lesson 2 10/19/2010.
ICT Gaming Lesson 3.
Stopwatch Cards Stopwatch Cards
Building a Game in Scratch
Game Over Module 4 Lesson 2.
Getting Started with Scratch
Stopwatch Cards Stopwatch Cards
Mod 5 Lesson 1 Scratch Cards: Easy
Stopwatch Cards Stopwatch Cards
Lesson Nine Variables.
Stopwatch Cards Stopwatch Cards
Animate a Sprite. By M, M and C P6
Scratch – Simple Programming
Presentation transcript:

Intro CS – Costumes and Variables Lesson Plan 6

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

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

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

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

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

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.

Closure/Conclusion Discussion Summary 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

Costumes and Variables Lesson Plan 6 Review what we learned in the last lecture: mainly how to have a sprite bounce off walls and other sprites using if decision blocks. Also review how to change the sprites on touch/bounce. Ask if there were any difficulties. What the kids thought was interesting.

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 Show them the cool game they will be creating today :D

Costume What is a costume? What can we use costumes for? 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 First ask the kids, a raise of hands who have used costumes before. Review that we used costumes to make the cat/other sprite in our first daily project seem like he was walking. Ask what other cool things we can do with costumes. For example: making it look like a sprite is dancing, or changes their expression. We also use costumes to change the background. Make sure to demo how to switch and do next costume.

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

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. Ask students who has used a variable so far. What is a variable? Ask how many students have found it annoying that every time they need to change a number in many different places they need to go one by one and change them. Wouldn’t it be nice if we only had to change the number once? Since we are lazy, CS has a perfect solution for this, and it’s called a variable. Then give an example in Scratch how to create a variable, show some of the cool things you can do: show/hide variable. Show how to set variables, ideally in the background code

Example Demo Demo of variable use (ballerina and animated name) Show how to create the project – where the variables go, how to use them. Builds upon already known pieces.

File format: LP6-YourLastName_YourFirstName.sb 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 Include Points Sprite initial positions are set in code 1 Contains at least 4 sprites 2 Contains at least 3 costumes per sprite Contains 2 variables to control the animation in 2 different ways Sprites animate through the costumes Sprites move and/or change effects 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

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