
Lesson 9 : Game Design Python 101
Presentation
•
Computers
•
9th Grade
•
Practice Problem
•
Easy
Maria Cruz Farooqi
Used 3+ times
FREE Resource
16 Slides • 22 Questions
1
Learning Target:
I can create a sprite to represent the player, apply coding concepts to clone, loop through a list, and more, in order to program a basic game with just a couple of sprites, one of which is controlled by keyboard input.
2
3
4
Dropdown
What Is a Sprite?
Most games have We call these characters sprites. Sprites can move around the screen and
5
Dropdown
Creating a Sprite with Turtle
When working with Python's Turtle module, you can use a 6
Dropdown
Setting a Sprite's Initial Values
You can set the sprite's Often you'll want to use the
7
Dropdown
Clone the Prototype
Once you've created one sprite and set its initial values in a way that you like, you can Any clones of the original will
8
9
I copied the code on the lesson sheet. Then modified it to clone turtles.
Then I assigned two different colors. Success! "Check Code" says I was successful.
Teacher's Answer:
10
Multiple Choice
What is a sprite?
A sprite is a graphical representation of an object
A sprite is a function
A sprite is a game
A sprite is a string
11
12
Dropdown
What Are Game Loops?
Most games consist of a These steps often include tasks like:
Setting and updating
Checking on important
This is called a game loop. Let's see how
13
Dropdown
A Function That Calls Itself: Game Loop Basics
We can implement a game loop using a You'll need to call the
14
Dropdown
15
Dropdown
Another Game Loop
This example is similar to the previous one, except the Press
16
Define an update( ) function and call it to kickstart the loop.
Perform actions with the sprite in the game loop to do something interesting. Need ideas? You might change the pen's color, clone a sprite, or change the shape of a sprite.
Do It Yourself
This code has a sprite, but not much else. Try to write a game loop of your own.
17
Teacher's
Answer:
18
Multiple Choice
What is the interval of this game loop?
Every 10 seconds
Every 1000 seconds
Every 1 second
It does not loop
19
20
More on Lists
To make more advanced games, you'll need to learn more about lists.
21
Dropdown
Looping
The 22
Drag and Drop
Append
To add more 23
Drag and Drop
Insert
Another important method is 24
Drag and Drop
Pop
Pop( ) 25
Drag and Drop
In
in is another 26
Let's try out all these new tools in an application. You will be given a randomly generated unsorted list.
Can you use all the list methods you just learned to sort a list of numbers from least to greatest?
Coding Challenge: Sort a List
27
Here are the steps:
You must loop through each index of the list. For each index:
Loop through all earlier indices.
If the value at an earlier index is greater than the value at the current index:
Pop the value at the current index
Insert the popped value into the earlier index
Stop looking though the earlier indexes
28
Teacher's
Answer
29
Multiple Choice
Select correct answer:
30
Multiple Choice
Select correct answer:
31
Multiple Choice
Select correct answer:
32
33
Dropdown
More on Dictionaries
To make more advanced games, you'll also need to know some Keys, Values, Items
The dictionary is a 34
Dropdown
Looping
You can 35
36
Teacher's
Answer
37
Multiple Choice
Select correct answer:
apple
banana
cherry
Dictionaries require a number as a key
38
Multiple Choice
Select correct answer:
Learning Target:
I can create a sprite to represent the player, apply coding concepts to clone, loop through a list, and more, in order to program a basic game with just a couple of sprites, one of which is controlled by keyboard input.
Show answer
Auto Play
Slide 1 / 38
SLIDE
Similar Resources on Wayground
32 questions
Science 9 - Unit B Review Slides
Presentation
•
9th Grade
34 questions
For цикл
Presentation
•
KG
31 questions
Web design stages
Presentation
•
8th Grade
32 questions
Flow of Energy
Presentation
•
9th Grade
32 questions
History of Medical Terminology
Presentation
•
9th Grade
34 questions
Linear, Quadratic, or Exponential?
Presentation
•
9th Grade
33 questions
QUARTER 1 WEEK 3 - COMPUTER HARDWARE
Presentation
•
9th Grade
35 questions
Byzantine Empire
Presentation
•
9th Grade
Popular Resources on Wayground
5 questions
A Home on the Shore
Quiz
•
3rd Grade
28 questions
US History Regents Review
Quiz
•
11th Grade
6 questions
A Horse Tale
Quiz
•
3rd Grade
20 questions
Math Review
Quiz
•
3rd Grade
10 questions
Juneteenth History and Significance
Interactive video
•
5th - 8th Grade
20 questions
Dividing Fractions
Quiz
•
5th Grade
55 questions
A Long Walk to Water Final Review
Quiz
•
6th - 8th Grade
10 questions
Equation Word Problems
Quiz
•
7th Grade
Discover more resources for Computers
20 questions
Insurance
Quiz
•
9th - 12th Grade
10 questions
Juneteenth: History and Significance
Interactive video
•
7th - 12th Grade
20 questions
Summer Geometry QUIZ (Week 2)
Quiz
•
9th Grade
6 questions
Mayan Mathematics part 1
Presentation
•
9th - 12th Grade
25 questions
Biology Regents Review
Quiz
•
9th Grade
40 questions
Flags of the World
Quiz
•
KG - Professional Dev...
10 questions
Unit 9 Quiz
Quiz
•
9th - 12th Grade
60 questions
Biology Regents Review
Quiz
•
9th Grade