Unit 3 - Warm Ups and Wrap Ups

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 141

Interactive Animations and

Games
Lesson 1: Programming for Entertainment Lesson 15: Keyboard Input
Lesson 2: Plotting Shapes Lesson 16: Mouse Input
Lesson 3: Drawing in Game Lab Lesson 17: Project: Interactive Card
Lesson 4: Shapes and Parameters Lesson 18: Velocity
Lesson 5: Variables Lesson 19: Collision Detection
Lesson 6: Random Numbers Lesson 20: Mini-Project: Side Scroller
Lesson 7: Sprites Lesson 21: Complex Sprite Movement
Lesson 8: Sprite Properties Lesson 22: Collisions
Lesson 9: Text Lesson 23: Mini-Project: Flyer Game
Lesson 10: Mini-Project: Captioned Scenes Lesson 24: Functions
Lesson 11: The Draw Loop Lesson 25: The Game Design Process
Lesson 12: Sprite Movement Lesson 26:
Lesson 13: Mini-Project: Animations Using the Game Design Proce
Lesson 14: Conditionals ss
Lesson 27: Project: Design a Game
Interactive Animations and
Games
Lesson 1
Programming for Entertainment
Interactive Animations and Games Lesson 1 - Warm Up

What is your favorite form of entertainment, and


what problem does it solve for you?
Games. It cures my boredom
Interactive Animations and Games Lesson 1 - Wrap Up

How is computer science used in entertainment?


● By giving more options for entertainment
Interactive Animations and
Games
Lesson 2
Plotting Shapes
Interactive Animations and Games Lesson 2 - Warm Up

Drawing Challenge
• The class will listen to the teacher explain how to
draw a picture.
• All students will attempt to draw it on the
Drawing Challenge template.
• Once this task is complete, answer the 3
questions about the challenge on the
template/worksheet that was provided.
Interactive Animations and Games Lesson 2 - Wrap Up

How can we clearly communicate how to draw


something on a screen?
By giving the exact directions of how an image is
drawn
Interactive Animations and
Games
Lesson 3
Drawing in Game Lab
Interactive Animations and Games Lesson 3 - Warm Up

Based on what you know about computers, what do


you think will be different between telling a person
about your image and telling a computer about your
image?
Telling a computer can exactly follow and algorithm
and a person might forget some of the steps to make
the image.
Interactive Animations and Games Lesson 3 - Wrap Up

How can we communicate to a


computer how to draw shapes on the
screen?
By giving code of where we want
a shape to be exactly
Interactive Animations and
Games
Lesson 4
Shapes and Parameters
Interactive Animations and Games Lesson 4 - Warm Up

The ‘rect()’ block has two inputs that control where


it's drawn - the x and y position. If you wanted these
commands to draw different sizes of rectangles, what
additional inputs would you need to give the blocks?
Stroke weight
Interactive Animations and Games Lesson 4 - Wrap Up

You use parameters to control your shape's


location and size.

Can you think of any other situations in which


parameters might be useful?

Measuring in coding
Interactive Animations and
Games
Lesson 5
Variables
Interactive Animations and Games Lesson 5 - Warm Up

At the beginning of the course, we learned that


input, output, storage, and processing were
common to all computers.

Where do you see input, output, storage, and


processing in Game Lab?

You see them when you are


affecting the Game Lab.
Interactive Animations and Games Lesson 5 - Wrap Up

What is your own definition of a variable?


A word or letter that represents a number

Why are variables useful in programs?


So we can input numbers easier
Interactive Animations and
Games
Lesson 6
Random Numbers
Interactive Animations and Games Lesson 6 - Warm Up

So far, our programs have done the same thing


every time that we run them.

Are there any times that you'd want a program to


do something differently each time it was run?
When I would want a shape to appear in
different places each time
Interactive Animations and Games Lesson 6 - Wrap Up

So far, we've only looked at random numbers. Are


there any other things that you might like to be
random in your program?
Random shapes
Interactive Animations and
Games
Lesson 7
Sprites
Interactive Animations and Games Lesson 7 - Warm Up

Review:
So far we've written programs that put simple shapes on the
screen.

List of all of the different pieces of information that you have


used to control how these shapes are drawn.
Can change size, color, height, width
Interactive Animations and Games Lesson 7 - Warm Up

If you wanted to create programs with more detailed


images, maybe even characters that you could
interact with, what other pieces of information might
you need in your code?
What the character looks like, what
the character does when it's
interacted with.
Interactive Animations and Games Lesson 7 - Wrap Up

So far we've been able to change a sprite's


location and image. What else might you want to
change about your sprites? The sprites size and
the direction it's turning.
Interactive Animations and
Games
Lesson 8
Sprite Properties
Interactive Animations and Games Lesson 8 - Warm Up

What is your definition of a sprite?


An image used in a code
What sprite properties do you know how to use?
Create Sprite
What other sprite properties might be useful?
Size and direction
Interactive Animations and Games Lesson 8 - Wrap Up

What is one way sprite properties are the same as


variables?
Sprite properties and variables both store
information
What's one way that sprite properties are different
from variables?
Variables are typically just one letter when sprites
are names of images
Interactive Animations and
Games
Lesson 9
Text
Interactive Animations and Games Lesson 9 - Warm Up

Look at this cartoon that was made


in Game Lab.

What do you think the alien should


be saying? Look at me!!!
Interactive Animations and Games Lesson 9 - Wrap Up

You've drawn with both text and shapes to the


screen.
What are two ways drawing with text is similar to
drawing shapes?
You can control the size and shape of both
What is one way that drawing with text is different
from drawing with shapes?
Drawing with text include words and
letter, while drawing with shapes is just
shapes
Interactive Animations and
Games
Lesson 10
Mini-Project: Captioned Scenes
Interactive Animations and Games Lesson 10 - Warm Up

Write down as many blocks as you can remember from Game


Lab.
Textsize, fill, text, var sprite = createsprite

Make sure you know what each one does, especially the
inputs, or parameters, for each of the blocks.
Interactive Animations and Games Lesson 10 - Wrap
Up

What was one especially creative way you saw


someone else use the blocks today?
Someone used the sprite.rotation block
to make their image the exact angle
they want it at.
Interactive Animations and
Games
Lesson 11
The Draw Loop
Interactive Animations and Games Lesson 11 - Warm Up

This YouTube
video from Marnic
Bos shows
animation using a
flip book.

How does the flip book work?


As the person flips the pages it creates this animation kind of thing.

How does it "trick our eyes" into thinking something is moving?

By the quickness of the pages flipping


Interactive Animations and Games Lesson 11 - Wrap
Up

How does the draw loop help us make animations?


It allows us to make our sprites move to
create an animation
Interactive Animations and
Games
Lesson 12
Sprite Movement
Interactive Animations and Games Lesson 12 - Warm Up

Review:
List out all of the sprite properties you can think of and what
aspect of a sprite they affect.
Sprite,y – change the y-axis of the sprite, sprite.x - changes the x-
axis of the sprite, sprite.rotation - changes the way the sprite is
rotated
Interactive Animations and Games Lesson 12 - Warm Up

What kinds of animations could you make if you


could control these properties?

Think about adding and subtracting from


properties, or even updating multiple properties at
the same time.
You could make sprites move up
and down, and left to right.
Interactive Animations and Games Lesson 12 - Wrap
Up

You've seen two ways to create animations with


the draw loop: random numbers and the counter
pattern

What is one type of movement that you'd want to use random numbers for?
When a sprite is shaking.
What is one type of movement that you would want to use the counter
pattern for?
When a sprite is spinning
Are there any movements that might combine the counter pattern and
random numbers?

When a sprite is moving up and down


Interactive Animations and
Games
Lesson 13
Mini Project: Animation
Interactive Animations and Games Lesson 13 - Warm Up

Write down as many types of movement and animations as you can


remember from the previous lesson.
Vertical, horizontal, diagonal, shake

Make sure you know what blocks and patterns you need to make
those movements, and when those movements would be useful.
Interactive Animations and Games Lesson 13 - Wrap
Up

What was one interesting way that you saw sprite movement
used today?
Someone had a spinning sprite while it
was moving diagonally.
Interactive Animations and
Games
Lesson 14
Conditionals
Interactive Animations and Games Lesson 14 - Warm Up

1. If your last name has more than five letters, draw a square on your paper.
2. If your last name less than seven letters, draw a circle.
3. If you are wearing anything green, add 3 + 2.
4. If the teacher is tapping their pencil, draw an 'X'.
5. If the teacher is in the front of the room, fold your paper in half.
Interactive Animations and Games Lesson 14 - Warm Up

When we program, we give the computer


instructions of what to do.

How are these instructions different from the instructions that we


have been giving in Game Lab?
Interactive Animations and Games Lesson 14 - Wrap
Up

Now that you know how conditionals work, where you do


think that they are used in games or other programs and
apps that you already use?
Interactive Animations and
Games
Lesson 15
Keyboard Input
Interactive Animations and Games Lesson 15 - Warm Up

So far all of the programs you've written run without any input from
the user.

How might adding user interaction make your programs more


useful, effective, or entertaining?
How might a user provide input into your program?
Interactive Animations and Games Lesson 15 - Wrap
Up

Think back to all of the programs you've written


so far.

How might you use user interaction to improve one of your programs
from past lessons?

What condition would you check, and how would you respond to it?
Interactive Animations and
Games
Lesson 16
Mouse Input
Interactive Animations and Games Lesson 16 - Warm Up

3-2-1 Review:
What are three different things that you've been able to do with
conditionals?
What are two big things that everyone should remember when
using conditionals?
What's one thing you still want to learn how to program?
Interactive Animations and Games Lesson 16 - Wrap
Up

You now have many different ways to detect user input.

With a partner, choose three different user input commands and think
of an example of when you might use them.

Be ready to share with the class!


Interactive Animations and
Games
Lesson 17
Project: Interactive Card
Interactive Animations and Games Lesson 17 - Warm Up

Think of one time you gave or received a card from


someone.

Who was that person?

What was the purpose of the card?

What about the card made it specific to that purpose?


Interactive Animations and Games Lesson 17 - Wrap
Up
Choose one of the five practices in which you believe you
demonstrated growth in this lesson.
problem solving, persistence, creativity, collaboration,
communication

What is something you did that exemplified this practice?


Choose one practice you think you can continue to grow in. What’s one thing you’d like
to do better?
Choose one practice you thought was especially important for this project. What made
it so important?
Interactive Animations and
Games
Lesson 18
Velocity
Interactive Animations and Games Lesson 18 - Warm Up

Volunteers?

I will need a couple of volunteers to act


as my “sprites” at the beginning of this
lesson.
Interactive Animations and Games Lesson 18 - Warm Up

I was just giving instructions to my "sprite", but


they seemed to get pretty repetitive.

How could I have simplified my instructions?


Interactive Animations and Games Lesson 18 - Wrap
Up

As you went through the puzzles, though, you started doing some interesting
movements that we hadn't been able to do before.

Describe one of those movements, and how you made it.

Describe another block that you'd like to have.

What would you name it?

What would it do?

What code would it hide inside?

How would it help you?


Interactive Animations and
Games
Lesson 19
Collision Detection
Interactive Animations and Games Lesson 19 - Warm Up

Example Animation
Interactive Animations and Games Lesson 19 - Warm Up

An interesting aspect of this animation is that the sprites


change when they touch each other.

Can you think of any way that the computer could use the
sprites’ properties to figure out whether they are touching
each other?
Interactive Animations and Games Lesson 19 - Wrap
Up

At the beginning of the lesson, you saw that it's possible to do


everything that the isTouching block does without using the
block at all.

What makes this block useful?


Interactive Animations and
Games
Lesson 20
Mini-Project: Side Scroller
Interactive Animations and Games Lesson 20 - Warm Up

Review:
Think of all of the things that you have learned how
to do in this unit so far.

Be ready to share with the class!


Interactive Animations and Games Lesson 20 - Wrap
Up

What was one challenge in making this game?

What is your advice for someone else who has the same challenge?
Interactive Animations and
Games
Lesson 21
Complex Sprite Movement
Interactive Animations and Games Lesson 21 - Warm Up

What is the difference between these two kinds of jumping?

How would you create the second kind of jumping?


Interactive Animations and Games Lesson 21 - Wrap
Up

Make a list of new things you can program to do after


today's lesson.

Then, write down a list of all the new blocks you


learned today.
Interactive Animations and Games Lesson 21 - Wrap
Up

Review:
Today we built lots of new sprite movements like gravity and
jumping, but none of this required us to learn new blocks.

How were you able to do new things without learning any new
blocks?
Interactive Animations and
Games
Lesson 22
Collisions
Interactive Animations and Games Lesson 22 - Warm Up

Using the blocks we already know how to use, how could we create the
sprite interaction we can see in this program?

Here are some blocks to consider:


○ sprite.isTouching()
○ sprite.velocityX
○ sprite.velocityY
○ sprite.x
○ sprite.y
Interactive Animations and Games Lesson 22 - Wrap
Up

How did having the "isTouching" block and the


"velocityX" block make it easier to solve the
problem of one sprite pushing another?
Interactive Animations and
Games
Lesson 23
Mini-Project: Flyer Game
Interactive Animations and Games Lesson 23 - Warm Up

Review:
Think of all of the things that you have learned how
to do in this unit so far.

Be ready to share with the class!


Interactive Animations and Games Lesson 23 - Wrap
Up

Journal 3-2-1:
Take some time to play each others' games if you haven't
already!

What are three things you saw in someone else's game that you really liked?

What are two improvements you'd make to your game if you had more time?

What's one piece of advice you'd give to someone making this type of
game?
Interactive Animations and
Games
Lesson 24
Functions
Interactive Animations and Games Lesson 24 - Warm Up

What's one block you'd like to have in Game Lab?


What would it do?
What code would it use to work?
Interactive Animations and Games Lesson 24 - Wrap
Up

Why would we say that functions allow us to "create our own


blocks"?

Why is this something we'd want to do?

Why would a function count as an abstraction?


Interactive Animations and
Games
Lesson 25
The Game Design Process
Interactive Animations and Games Lesson 25 - Warm Up

Play Cake Defender


If you were making this program…

What sprites would you need?

What variables would you need?

What functions would you use?


Interactive Animations and Games Lesson 25 - Wrap
Up

Today, you used a filled-out project guide as you


completed your program.

How did the project guide help you as you coded?

What do you think will be important to remember when you fill out
your own project guide?
Interactive Animations and
Games
Lesson 26
Using the Game Design Process
Interactive Animations and Games Lesson 26 - Warm Up

The Problem Solving Process helps us work through all kinds of


problems. Think about the problem of building a larger piece of
software, like the game we built in the last lesson.

What did each of the four steps look like in the game from last
lesson?

Why were they important?


Interactive Animations and Games Lesson 26 - Wrap
Up

Before you started coding your game, you first had to fill out a
project guide with a plan.

How did having a plan change the way that you coded your
game?

Will you do anything differently when you make your plan for
your final project?
Interactive Animations and
Games
Lesson 27
Project: Design a Game
Interactive Animations and Games Lesson 27 - Warm Up

Today, you'll start the final project of the unit, in which you will design and
code your own game.

Before you start, what are three skills or qualities that you think will be
important as you complete this project?
Interactive Animations and Games Lesson 27 - Wrap
Up

Of the five practices of CS Discoveries


(Problem Solving, Persistence, Creativity,
Collaboration, Communication)

Choose one of the five practices in which you believe you demonstrated growth
in this unit.

Write something you did that exemplified this practice

You might also like