2D Game Development Engine 3 — Questions and Answers
Question 1: What is a sprite atlas (texture atlas) used for in a 2D engine?
- Packing many images into one texture to reduce draw calls (Correct answer)
- Storing audio clips
- Saving player progress
- Defining collision rules
Correct answer: Packing many images into one texture to reduce draw calls
A texture atlas combines many sprites into one texture, reducing draw calls and improving performance.
Question 2: Which technique batches many sprites into a single draw call?
- Sprite batching (Correct answer)
- Mip-mapping
- Ray casting
- Tessellation
Correct answer: Sprite batching
Sprite batching groups sprites sharing a texture into one draw call for efficiency.
Question 3: In a tile-based 2D engine, what is a tilemap?
- A grid of indexed tiles forming a level (Correct answer)
- A list of audio events
- A shader program
- A physics solver
Correct answer: A grid of indexed tiles forming a level
A tilemap is a grid referencing tiles from a tileset to build levels efficiently.
Question 4: What is the benefit of object pooling in a 2D engine?
- Reusing objects to reduce allocation and garbage collection (Correct answer)
- Increasing screen resolution
- Encrypting network traffic
- Compressing textures
Correct answer: Reusing objects to reduce allocation and garbage collection
Object pooling reuses pre-allocated objects, reducing runtime allocations and GC spikes.
Question 5: What does a camera component typically control in a 2D engine?
- The viewport's position, zoom, and what is visible (Correct answer)
- The audio volume
- The save file format
- The frame rate cap
Correct answer: The viewport's position, zoom, and what is visible
The camera defines the visible viewport, including position and zoom over the game world.
Question 6: Which coordinate concept lets a sprite move correctly relative to its parent in a scene graph?
- Local vs world transforms (Correct answer)
- Screen DPI scaling
- Audio panning
- Texture filtering
Correct answer: Local vs world transforms
Local transforms are combined with parent transforms to produce world-space positions.
Question 7: What is culling in the context of 2D rendering?
- Skipping off-screen objects to save rendering work (Correct answer)
- Adding extra lighting
- Doubling sprite size
- Generating collision meshes
Correct answer: Skipping off-screen objects to save rendering work
Culling avoids rendering objects outside the camera view to improve performance.
What is a sprite atlas (texture atlas) used for in a 2D engine?