Skip to content

Camera Manager

Jack X. edited this page May 26, 2026 · 16 revisions

System Summary

The Camera System controls how the game camera behaves in both Editor Mode (EDIT) and Play Mode (PLAY) using a single Camera2D node.

It supports:

  • Free camera movement in editor mode (WASD + edge scrolling)
  • Smooth player-follow camera in play mode
  • Zoom in/out using mouse wheel
  • level boundary clamping to prevent losing the level view
  • State switching through a global game state system

This system replaces multiple camera controllers with a single unified state-based camera.

Connected Systems

  • MasterManager (state switching signals)
  • Player CharacterBody2D
  • TileMap System

Related Controls

Editor Mode

  • WASD → Move camera (optional currently disabled in code)
  • Mouse at screen edges → Move camera
  • Mouse wheel → Zoom in/out

Play Mode

  • Camera follows player automatically
  • No manual input

Feature List

  • Edge scrolling camera movement
  • Zoom system with limits
  • tilemap boundary clamp
  • Smooth camera interpolation (lerp)
  • Automatic tilemap-centering on start

Future Work / Risks (Global)

  • EDIT / PLAY state switching
  • WASD camera movement
  • Player-follow camera mode

Miscellaneous Notes

  • System is single-node for simplicity
  • State switching is handled externally by MasterManager
  • Camera assumes a rectangular tilemap level world
  • Code follows modular function separation for readability

Clone this wiki locally