← All 2D Game Development Flashcard Decks

2D Game Programming Concepts Flashcards

6 cards from real 2D Game Development practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.

Read the first 6 2D Game Programming Concepts flashcards as text
  1. What is the 'observer pattern' used for in 2D game development?

    Answer: Notifying multiple subscriber objects automatically when a subject's state changes

    The observer pattern lets objects subscribe to events on another object, receiving automatic notifications without requiring the subject to know about all its listeners.

  2. What is a 'scriptable object' (or data asset) pattern used for in 2D games?

    Answer: Storing reusable, designer-editable data (stats, configs) separately from gameplay code

    Scriptable objects store configuration data (weapon stats, enemy properties) as assets, making them easily editable by designers without touching code.

  3. What is 'frame-rate independence' and why is it important in 2D games?

    Answer: Ensuring game logic runs at the same speed regardless of frame rate by using delta time

    Frame-rate independence ensures that game simulation speed (movement, timers) is consistent whether the game runs at 30 or 120 fps by scaling values with delta time.

  4. What is a 'raycast' used for in 2D game programming?

    Answer: Shooting an invisible ray in a direction to detect the first object it hits

    A 2D raycast fires a line segment and returns hit information (object, point, normal) for the first collider it intersects, used for line-of-sight, shooting, and ground detection.

  5. What is 'dependency injection' (DI) useful for in 2D game architecture?

    Answer: Supplying required objects to a class from outside rather than having it create them internally

    DI provides a class with its dependencies via constructor or setter, making systems easier to test, swap, and maintain without tightly coupling components.

  6. What is 'bitmasking' used for in 2D game programming?

    Answer: Efficiently storing and querying multiple boolean flags in a single integer variable

    Bitmasking uses bitwise AND/OR operations on integer flags to compactly represent sets of boolean states such as collision layers or ability flags.