2D Game Development Engine 2 — Questions and Answers
Question 1: In a 2D game engine, what does the 'game loop' primarily coordinate each frame?
- Updating game state and rendering output (Correct answer)
- Compiling shader code
- Allocating disk storage
- Encrypting save files
Correct answer: Updating game state and rendering output
The game loop repeatedly processes input, updates game state, and renders each frame.
Question 2: What is the main advantage of a fixed timestep over a variable timestep for physics updates?
- Deterministic, stable simulation (Correct answer)
- Higher rendering resolution
- Smaller texture memory
- Faster asset loading
Correct answer: Deterministic, stable simulation
A fixed timestep keeps physics deterministic and stable regardless of frame rate fluctuations.
Question 3: Which engine subsystem is responsible for drawing sprites to the screen?
- The renderer (Correct answer)
- The audio mixer
- The input manager
- The file loader
Correct answer: The renderer
The renderer handles converting sprite and scene data into pixels on screen.
Question 4: What does 'delta time' represent in a game engine?
- Time elapsed since the last frame (Correct answer)
- Total game runtime
- GPU memory usage
- Number of active sprites
Correct answer: Time elapsed since the last frame
Delta time is the elapsed time between frames, used to make movement frame-rate independent.
Question 5: In an entity-component system (ECS), what holds the actual data for behavior like position?
- Components (Correct answer)
- Systems
- Render passes
- Shaders
Correct answer: Components
Components store data such as position, while systems operate on that data.
Question 6: Why do many 2D engines use a scene graph or layered structure?
- To organize draw order and transforms hierarchically (Correct answer)
- To compress audio
- To handle network packets
- To manage GPU drivers
Correct answer: To organize draw order and transforms hierarchically
A scene graph organizes objects hierarchically, controlling draw order and inherited transforms.
Question 7: What is the purpose of double buffering in a 2D engine's renderer?
- Prevent visible tearing and flicker (Correct answer)
- Double the frame rate automatically
- Halve memory usage
- Skip input handling
Correct answer: Prevent visible tearing and flicker
Double buffering draws to an off-screen buffer then swaps it, avoiding flicker and tearing.
In a 2D game engine, what does the 'game loop' primarily coordinate each frame?