2D Game Development 2D Game Design and Development 3 — Questions and Answers
Question 1: What is 'collision detection' in a 2D game?
- Determining when two game objects overlap or touch (Correct answer)
- Rendering shadows under sprites
- Loading textures from disk
- Compressing the game build
Correct answer: Determining when two game objects overlap or touch
Collision detection checks whether objects intersect so the game can respond.
Question 2: An 'AABB' collision check refers to colliding what kind of shapes?
- Axis-aligned bounding boxes (Correct answer)
- Arbitrary angled polygons
- Animated bezier curves
- Audio buffer blocks
Correct answer: Axis-aligned bounding boxes
AABB stands for axis-aligned bounding box, a fast rectangle-overlap test.
Question 3: Why is 'delta time' used in game update loops?
- To make movement frame-rate independent (Correct answer)
- To increase texture quality
- To reduce memory usage
- To encrypt save files
Correct answer: To make movement frame-rate independent
Multiplying movement by delta time keeps motion consistent regardless of frame rate.
Question 4: In 2D physics, what does 'velocity' represent?
- The rate of change of position over time (Correct answer)
- The total mass of an object
- The color of a sprite
- The friction coefficient only
Correct answer: The rate of change of position over time
Velocity is how fast and in what direction an object's position changes.
Question 5: What is a common technique to handle a character jumping in a 2D platformer?
- Apply an upward velocity then a constant downward gravity each frame (Correct answer)
- Teleport the player to a fixed height instantly
- Disable collision while jumping
- Increase the frame rate during the jump
Correct answer: Apply an upward velocity then a constant downward gravity each frame
Jumping sets an initial upward velocity that gravity gradually reduces and reverses.
Question 6: What does 'pixel-perfect' collision detection mean?
- Collisions based on overlapping non-transparent pixels (Correct answer)
- Collisions only on screen edges
- Collisions checked once per level
- Collisions using only bounding circles
Correct answer: Collisions based on overlapping non-transparent pixels
Pixel-perfect collision tests the actual opaque pixels rather than bounding shapes.
Question 7: Which is an advantage of bounding-box collision over pixel-perfect collision?
- It is much faster to compute (Correct answer)
- It is always more accurate
- It uses no CPU at all
- It works only in 3D
Correct answer: It is much faster to compute
Bounding-box checks are simple comparisons, making them far cheaper than pixel tests.
What is 'collision detection' in a 2D game?