
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
34 questions
Pax Romana & Contributions
Presentation
•
9th Grade
33 questions
Reading and Writing Files
Presentation
•
9th Grade
33 questions
Diffusion and Osmosis Notes
Presentation
•
9th Grade
32 questions
Protein Synthesis
Presentation
•
9th - 10th Grade
29 questions
Reti e sicurezza per tecnologici - I Parte
Presentation
•
9th Grade
32 questions
BERFIKIR KOMPUTASIONAL 2
Presentation
•
8th Grade
35 questions
Transitions
Presentation
•
9th Grade
35 questions
Data Protection Act
Presentation
•
9th - 10th Grade
Popular Resources on Wayground
24 questions
PBIS-HGMS Day 10
Quiz
•
6th - 8th Grade
10 questions
HCS SCI 03 Summer School Review 3
Quiz
•
3rd Grade
11 questions
Home Scope
Quiz
•
7th - 8th Grade
15 questions
HCS SCI 05 Summer School Assessment 3 Review
Quiz
•
5th Grade
35 questions
Lufkin Road Middle School Student Handbook & Policies Assessment
Quiz
•
7th Grade
18 questions
Geo 11.3 Area of Circles and Sectors
Quiz
•
9th - 11th Grade