Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Pygame Shapes

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.

How do I import the pygame library?

a)

import pygame

b)

pygame.init()

c)

surface = pygame.display.set_mode((400,300))

d)

pygame.display.flip()

2.

How do I initialize the pygame?

a)

import pygame

b)

pygame.init()

c)

surface = pygame.display.set_mode((400,300))

d)

pygame.display.flip()

3.

How do I initialize the surface?

a)

import pygame

b)

pygame.init()

c)

DISPLAY = pygame.display.set_mode((400,300))

d)

pygame.display.flip()

4.

How do I update the screen?

a)

import pygame

b)

pygame.init()

c)

surface = pygame.display.set_mode((400,300))

d)

pygame.display.flip()

5.

What does display.flip() do?

a)

will update the contents of the entire display

b)

allows to update a portion of the screen, instead of the entire area of the screen

6.

Draw a Rectangle

a)

DISPLAY = pygame.display.set_mode([400,300])

b)

pygame.draw.rect(DISPLAY, color, [30, 30, 60, 60])

c)

pygame.draw.line(DISPLAY, color, [20, 50], [180, 50], 3)

d)

pygame.draw.circle(DISPLAY, color, [300, 300], 200, 3)

7.

Draw a Circle

a)

pygame.draw.arc(DISPLAY, color, [50, 50, 200, 200], 0, pi, 2)

b)

pygame.draw.rect(DISPLAY, color, [30, 30, 60, 60])

c)

pygame.draw.circle(DISPLAY, color, [20, 50], [180, 50], 3)

d)

pygame.draw.circle(DISPLAY, color, (300, 300), 20)

8.

Draw a Polygon

a)

pygame.draw.arc(DISPLAY, color, [50, 50, 200, 200], 0, pi, 2)

b)

pygame.draw.rect(DISPLAY, color, [30, 30, 60, 60])

c)

pygame.draw.polygon(DISPLAY, color, [[300, 100], [100,500], [500,500]])

d)

pygame.draw.polygon(DISPLAY, color, [300, 300], 200, 3)

9.

What is Pygame?

a)

An online store for games

b)

A best-selling online game

c)

A website to create and/or upload game assets for Python

d)

A Python Programming library to create games

10.

How can we create displays/screens with Pygame?

a)

pygame.display.set_mode()

b)

pygame.draw.rect()

c)

pygame.display.set_caption()

d)

pygame.key.get_pressed()

11.

What is the size of the pygame display?

a)

250 x 250

b)

500 x 500

c)

2500 x 2500

d)

5000 x 5000

12.

Which function is used to fill the screen with a color in Pygame?

a)

pygame.display.fill(color)

b)

screen.fill(color)

c)

pygame.fill(color)

d)

surface.fill(DISPLAY)

13.

What function is used to draw a line in Pygame?

a)

pygame.draw.line(DISPLAY, color, [start_coord], [end_coord], width)

b)

pygame.draw.rect(DISPLAY, color, [coordinate, width, height])

c)

pygame.draw.circle(DISPLAY, color, (coordinate), radius)

d)

pygame.draw.polygon(DISPLAY, color, [points])

14.

How do you set the caption of a Pygame window?

a)

pygame.display.set_caption('My Game')

b)

pygame.display.set_mode((width, height))

c)

pygame.display.flip()

d)

pygame.init()

15.

How do you draw an arc in pygame?

a)

Use pygame.draw.circle(DISPLAY, color, (x, y), radius) to draw an arc.

b)

Use pygame.draw.line(DISPLAY, color, [start_pos], [end_pos], thickness) to create an arc.

c)

Use pygame.draw.polygon(DISPLAY, color, [[x1,y1],[x2,y2],[x3,y3]]) to draw an arc.

d)

Use pygame.draw.arc(DISPLAY, color, [x, y, width, height], start_angle, end_angle, thickness) to draw an arc.