Player Class implementation in a 2D Elevated Grid World. Using Screenspace Raycast for movement & aiming directions.

For this project, I handled the full player gameplay logic. The movement system is built around directional inputs using WASD, supporting both primary directions and diagonals (e.g., top-right, bottom-left). Aiming is handled using a screenspace raycasting system, which I implemented first for a perspective camera and later adapted to orthographic when the project changed direction.

I created a Projectile Pool for performance-efficient ability casting. The player has four weapon types, each managed through an enum-based state system to switch behavior and cooldowns cleanly. Ability inputs are context-aware — for example, if the player is rolling, they can't shoot or switch directions until the animation completes.

View Projectile Pool on GitHub

Key Features Implemented:

  • Screenspace raycasting (Perspective & Orthographic support)
  • 8-direction WASD movement with diagonal support
  • Projectile Pool system for ability reuse
  • Weapon switching via enum state handling
  • Cooldown timers for actions and abilities
  • Input-locking during specific player states (rolling, shooting etc)