NEW
Font size
WorksheetsPygame Tutorial 4 Optimization & OOP Quiz
Total questions: 15
Worksheet time: 8mins
What is the main focus of the tutorial?
Implementing a new game
Optimizing code using OOP
Creating a new game engine
Learning Python basics
What library is used in the tutorial?
Tkinter
PyQt
Kivy
Pygame
What is the purpose of the 'player' class in the code?
To handle game physics
To load game assets
To manage player attributes and actions
To create a game map
Which function is responsible for updating the game window?
updateWindow()
redrawGameWindow()
displayUpdate()
refreshScreen()
What is the initial value of 'man.jumpCount'?
15
10
5
20
What does the 'pygame.display.set_mode' function do?
Creates a window for display
Initializes the game clock
Loads game images
Sets the game title
Which key is used to make the player jump?
pygame.K_RETURN
pygame.K_DOWN
pygame.K_UP
pygame.K_SPACE
What happens when 'man.walkCount + 1' is greater than or equal to 27?
The walkCount is reset to 0
The player jumps
The player stops moving
The game restarts
What is the purpose of 'pygame.quit()'?
To close the game window
To save the game state
To pause the game
To restart the game
What is the frame rate set by 'clock.tick(27)'?
15 FPS
27 FPS
30 FPS
60 FPS
What does 'pygame.image.load' do?
Loads sound files
Loads image files
Loads text files
Loads video files
What is the initial position of the player on the x-axis?
100
200
300
400
Which attribute of the player class indicates if the player is jumping?
isFalling
isRunning
isMoving
isJump
What is the purpose of 'pygame.key.get_pressed()'?
To detect key presses
To check for mouse clicks
To update the display
To load game assets
What does the 'neg' variable control during jumping?
Jump height
Jump direction
Jump speed
Jump duration
