2D Game Development 2D Physics and Collision Detection 1 — Questions and Answers
Question 1: Which collision detection method checks if the bounding boxes of two objects overlap?
- AABB (Axis-Aligned Bounding Box) (Correct answer)
- Circle-circle collision
- Pixel-perfect collision
- SAT (Separating Axis Theorem)
Correct answer: AABB (Axis-Aligned Bounding Box)
AABB collision detection checks whether the rectangular boundaries of two objects overlap along both axes.
Question 2: What is the purpose of a physics timestep in 2D games?
- To limit frame rate
- To ensure consistent physics simulation regardless of frame rate (Correct answer)
- To calculate rendering resolution
- To manage audio synchronization
Correct answer: To ensure consistent physics simulation regardless of frame rate
A fixed physics timestep ensures that physics calculations produce consistent results independent of how fast the game renders frames.
Question 3: What does 'restitution' control in a 2D physics engine?
- Object mass
- Bounciness after a collision (Correct answer)
- Friction between surfaces
- Gravity strength
Correct answer: Bounciness after a collision
Restitution (coefficient of restitution) determines how much kinetic energy is preserved after a collision, controlling bounciness.
Question 4: Which data structure is commonly used to optimize broad-phase collision detection?
- Linked list
- Spatial hash grid (Correct answer)
- Queue
- Stack
Correct answer: Spatial hash grid
A spatial hash grid partitions space into cells so only nearby objects need to be checked for collisions, reducing comparisons.
Question 5: What is a 'trigger' collider in 2D game development?
- A collider that applies force
- A collider that detects overlap without physical response (Correct answer)
- A collider that destroys objects on contact
- A collider used for raycasting only
Correct answer: A collider that detects overlap without physical response
A trigger collider detects when objects enter its area but does not cause a physical collision response.
Question 6: What is 'tunneling' in 2D physics?
- An object passing through another due to high velocity (Correct answer)
- An underground level mechanic
- A rendering artifact from z-ordering
- A collision response algorithm
Correct answer: An object passing through another due to high velocity
Tunneling occurs when a fast-moving object moves so far in one frame that it passes completely through a thin collider without detection.
Which collision detection method checks if the bounding boxes of two objects overlap?