
PyGame: Primitives
Presentation
•
Computers
•
12th Grade
•
Practice Problem
•
Medium
Аңсар Әкім
Used 41+ times
FREE Resource
7 Slides • 10 Questions
1
Graphic primitives. |
Assessment Criteria:
Remember (Knowledge):
Identify the Pygame functions for drawing basic graphic primitives.
List the parameters required to draw a rectangle or circle.
Understand (Comprehension):
Explain the purpose and use of Pygame's drawing functions.
Describe how coordinates and dimensions are used to position and size graphic primitives on the window.
Apply (Application):
Demonstrate the ability to draw rectangles and circles on the Pygame window.
Adjust the parameters to create variations in size, position, and color.
Analyze (Analysis):
Analyze the impact of different parameters on the appearance of graphic primitives.
Identify and troubleshoot common errors in drawing graphic primitives.
2
Word Cloud
Pygame library
3
Multiple Choice
What function is used to initialize Pygame?
4
Multiple Choice
How do you create a Pygame window of dimensions 800x600 pixels?
window = pygame.create_window(800, 600)
window = pygame.Window(800, 600)
window = pygame.display.create_window(800, 600)
window = pygame.display.set_mode((800, 600))
5
Multiple Choice
What is the purpose of the Pygame main loop?
To initialize the game
To handle user events
To draw graphics on the screen
All of the above
6
Multiple Choice
How do you handle the quit event in the Pygame main loop?
if event.type == pygame.QUIT: pygame.end()
if event.type == pygame.EXIT: pygame.quit()
if event == pygame.QUIT: sys.exit()
d. if event.type == QUIT: pygame.quit()
7
Graphic primitives. |
Assessment Criteria:
Remember (Knowledge):
Identify the Pygame functions for drawing basic graphic primitives.
List the parameters required to draw a rectangle or circle.
Understand (Comprehension):
Explain the purpose and use of Pygame's drawing functions.
Describe how coordinates and dimensions are used to position and size graphic primitives on the window.
Apply (Application):
Demonstrate the ability to draw rectangles and circles on the Pygame window.
Adjust the parameters to create variations in size, position, and color.
Analyze (Analysis):
Analyze the impact of different parameters on the appearance of graphic primitives.
Identify and troubleshoot common errors in drawing graphic primitives.
8
# Draw a red rectangle
rect_color = (255, 0, 0)
rect_dimensions = pygame.Rect(50, 50, 100, 75)
pygame.draw.rect(screen, rect_color, rect_dimensions)
Rectangle https://trinket.io/pygame/b16a964027
Circle https://trinket.io/pygame/c770ca8d10
9
# Define the points for the polygon (vertices)
polygon_points = [(200, 100), (300, 50), (400, 100), (300, 200)]
# Set colors
BLACK = (0, 0, 0)
GREEN = (0, 255, 0)
# Draw the polygon
pygame.draw.polygon(screen, GREEN, polygon_points)
https://trinket.io/pygame/6a602a4a52
10
Multiple Choice
How do you draw a rectangle in Pygame?
pygame.draw.rect(surface, color, dimensions)
pygame.draw.rectangle(surface, color, dimensions)
pygame.draw.square(surface, color, dimensions)
pygame.draw.rect(surface, dimensions, color)
11
Multiple Choice
What Pygame function is used to draw a polygon?
pygame.draw.polygon(surface, color, vertices)
pygame.draw.poly(surface, color, vertices)
pygame.draw.draw_polygon(surface, color, vertices)
pygame.draw.shape(surface, color, vertices)
12
Draw
Let's create some simple drawings.
Be creative, use different colours and graphical primitives: rectangle, line, polygon and circle.
13
Create similar drawing as in the previous task programmatically
14
Use the random library to change the colours and parameters of the primitives
Add movement within the main loop.
Example: https://trinket.io/pygame/0048ec3598
15
Poll
Practical tasks
1-2
3-5
6-7
8-9
16
Graphic primitives. |
Assessment Criteria:
Remember (Knowledge):
Identify the Pygame functions for drawing basic graphic primitives.
List the parameters required to draw a rectangle or circle.
Understand (Comprehension):
Explain the purpose and use of Pygame's drawing functions.
Describe how coordinates and dimensions are used to position and size graphic primitives on the window.
Apply (Application):
Demonstrate the ability to draw rectangles and circles on the Pygame window.
Adjust the parameters to create variations in size, position, and color.
Analyze (Analysis):
Analyze the impact of different parameters on the appearance of graphic primitives.
Identify and troubleshoot common errors in drawing graphic primitives.
17
Open Ended
Feedback
Graphic primitives. |
Assessment Criteria:
Remember (Knowledge):
Identify the Pygame functions for drawing basic graphic primitives.
List the parameters required to draw a rectangle or circle.
Understand (Comprehension):
Explain the purpose and use of Pygame's drawing functions.
Describe how coordinates and dimensions are used to position and size graphic primitives on the window.
Apply (Application):
Demonstrate the ability to draw rectangles and circles on the Pygame window.
Adjust the parameters to create variations in size, position, and color.
Analyze (Analysis):
Analyze the impact of different parameters on the appearance of graphic primitives.
Identify and troubleshoot common errors in drawing graphic primitives.
Show answer
Auto Play
Slide 1 / 17
SLIDE
Similar Resources on Wayground
11 questions
Scientific Inquiry
Presentation
•
12th Grade
12 questions
Draw With Sense
Presentation
•
12th Grade
12 questions
nonsense
Presentation
•
KG
12 questions
COLORS GAME FOR RED
Presentation
•
KG
12 questions
Algebra - Lesson Scatter Plots and Line of Best Fit
Presentation
•
12th Grade
12 questions
untitled
Presentation
•
KG - University
13 questions
Listening Skills - Part 3
Presentation
•
12th Grade
13 questions
AQA GCSE Images
Presentation
•
11th Grade
Popular Resources on Wayground
10 questions
Safety Day 2026 – Student Review
Quiz
•
9th Grade
21 questions
Continents and Oceans
Quiz
•
6th Grade
20 questions
Parts of Speech
Quiz
•
5th Grade
16 questions
Subject & Predicate
Quiz
•
5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
12 questions
Map Skills
Quiz
•
3rd Grade
22 questions
Continents and Oceans
Quiz
•
5th Grade
15 questions
Rounding Decimals
Quiz
•
5th Grade