Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

6th August

Total questions: 30

Worksheet time: 15mins

Name
Class
Date
1.

What does pygame.display.set_mode((width, height)) do?

a)

Sets the game's FPS

b)

Opens a window with given dimensions

c)

Fills the screen with color

d)

Initializes the game engine

2.

What is the use of pygame.display.set_caption("Title")?

a)

Changes font of text

b)

Sets the title of the game window

c)

Adds title to a sprite

d)

Creates a text label

3.

What does pygame.Rect(x, y, width, height) create?

a)

A rectangle shape

b)

A clock

c)

A button

d)

A sprite

4.

What is the role of pygame.time.Clock()?

a)

Returns system time

b)

Creates a timer for FPS control

c)

Displays current date

d)

Checks keypress duration

5.

Which function retrieves events like keypresses or mouse clicks?

a)

pygame.wait()

b)

pygame.event.get()

c)

pygame.key.get()

d)

pygame.handle()

6.

What is event.type == pygame.QUIT used for?

a)

Detects mouse clicks

b)

Detects keypresses

c)

Checks if window is closed

d)

Stops drawing

7.

What does pygame.quit() do?

a)

Quits Python

b)

Closes the Pygame window and uninitializes modules

c)

Stops music

d)

Restarts game

8.

Which function is used to check multiple keys being held down?

a)

key.get()

b)

pygame.key.get_pressed()

c)

key.is_down()

d)

pygame.key.get()

9.

What does screen.fill((0, 0, 0)) do?

a)

Paints a black background

b)

Clears text

c)

Loads image

d)

Fills font

10.

What does pygame.draw.rect(screen, color, rect) do?

a)

Fills screen with color

b)

Draws a rectangle

c)

Detects collision

d)

Rotates an image

11.

What is the purpose of rect.colliderect(other_rect)?

a)

Fills the rect

b)

Checks for collision

c)

Moves rect

d)

Changes color

12.

What is screen.blit(image, (x, y)) used for?

a)

Create buttons

b)

Fill text

c)

Draw images/surfaces

d)

Set screen size

13.

What does font.render("Hello", True, color) return?

a)

Font object

b)

Rendered text surface

c)

String output

d)

Color image

14.

What is the purpose of pygame.time.delay(ms)?

a)

Delay key press

b)

Waits for a specified time in milliseconds

c)

Pause font rendering

d)

Syncs frame rate

15.

Which method updates the Pygame display?

a)

refresh()

b)

flip()

c)

pygame.display.update()

d)

screen.update()

16.

What does clock.tick(60) control?

a)

Game resolution

b)

Frame rate (FPS)

c)

Keyboard speed

d)

Sound delay

17.

Which method loads a system font?

a)

pygame.font.SysFont()

b)

pygame.font.load()

c)

pygame.font.open()

d)

pygame.font.ttf()

18.

What does rect.y += 5 do?

a)

Moves rect left

b)

Moves rect up

c)

Moves rect down

d)

Stretches rect

19.

What does rect.x -= speed do?

a)

Moves rect left

b)

Moves rect right

c)

Increases size

d)

Resets position

20.

What happens if rect.bottom >= screen_height?

a)

The rect bounces

b)

Rect goes off screen

c)

Rect hits bottom edge

d)

Nothing

21.

Which method draws a line in Pygame?

a)

draw.line()

b)

pygame.line()

c)

pygame.draw.line()

d)

line.draw()

22.

What happens if pygame.K_UP is detected?

a)

Player moves right

b)

Player jumps or moves up

c)

Game ends

d)

Image is loaded

23.

Which parameter in font.render() enables anti-aliasing?

a)

True

b)

False

c)

1

d)

None

24.

What is the output of print(pygame.key.get_pressed())?

a)

Current mouse position

b)

A list of key states (pressed/unpressed)

c)

Key name

d)

None

25.

Which of the following is required before rendering text?

a)

Load music

b)

Load font using SysFont()

c)

Call tick()

d)

Check for events

26.

What does rect.centery return?

a)

Width of the rect

b)

Y-coordinate of center of rect

c)

Center of screen

d)

Top of rect

27.

What is the purpose of rect.top?

a)

Height of the rect

b)

Top coordinate of the rect

c)

Center position

d)

Text value

28.

Which surface method displays an image or text on screen?

a)

write()

b)

blit()

c)

show()

d)

put()

29.

What does pygame.font.Font(None, 36) do?

a)

Uses system font

b)

Loads custom font

c)

Uses default font of size 36

d)

Loads a bold font

30.

What is required to update the Pygame screen continuously?

a)

while loop

b)

pygame.display.update()

c)

pygame.event.get()

d)

All of the above