wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Pygame Tutorial 4 Optimization & OOP Quiz

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.

What is the main focus of the tutorial?

a)

Implementing a new game

b)

Optimizing code using OOP

c)

Creating a new game engine

d)

Learning Python basics

2.

What library is used in the tutorial?

a)

Tkinter

b)

PyQt

c)

Kivy

d)

Pygame

3.

What is the purpose of the 'player' class in the code?

a)

To handle game physics

b)

To load game assets

c)

To manage player attributes and actions

d)

To create a game map

4.

Which function is responsible for updating the game window?

a)

updateWindow()

b)

redrawGameWindow()

c)

displayUpdate()

d)

refreshScreen()

5.

What is the initial value of 'man.jumpCount'?

a)

15

b)

10

c)

5

d)

20

6.

What does the 'pygame.display.set_mode' function do?

a)

Creates a window for display

b)

Initializes the game clock

c)

Loads game images

d)

Sets the game title

7.

Which key is used to make the player jump?

a)

pygame.K_RETURN

b)

pygame.K_DOWN

c)

pygame.K_UP

d)

pygame.K_SPACE

8.

What happens when 'man.walkCount + 1' is greater than or equal to 27?

a)

The walkCount is reset to 0

b)

The player jumps

c)

The player stops moving

d)

The game restarts

9.

What is the purpose of 'pygame.quit()'?

a)

To close the game window

b)

To save the game state

c)

To pause the game

d)

To restart the game

10.

What is the frame rate set by 'clock.tick(27)'?

a)

15 FPS

b)

27 FPS

c)

30 FPS

d)

60 FPS

11.

What does 'pygame.image.load' do?

a)

Loads sound files

b)

Loads image files

c)

Loads text files

d)

Loads video files

12.

What is the initial position of the player on the x-axis?

a)

100

b)

200

c)

300

d)

400

13.

Which attribute of the player class indicates if the player is jumping?

a)

isFalling

b)

isRunning

c)

isMoving

d)

isJump

14.

What is the purpose of 'pygame.key.get_pressed()'?

a)

To detect key presses

b)

To check for mouse clicks

c)

To update the display

d)

To load game assets

15.

What does the 'neg' variable control during jumping?

a)

Jump height

b)

Jump direction

c)

Jump speed

d)

Jump duration