Core Gameplay Prototype

Introduction

So far, I’ve been building the foundation of the game by getting the core gameplay running: movement, shooting, and bullet ricochets. These mechanics define the entire feel of the game, so I wanted to make sure I nailed the basics before diving into level design or AI.

Movement & Rotation

I started by implementing 2D movement using Unity’s new Input System. The player can move using a joystick or keys, and optionally rotate toward the aim direction (in my current setup, that’s the mouse). A key aspect of the experience is that the player always faces where they’re aiming or moving, which makes the action feel more responsive. If you’re holding the "aim" button, the character rotates toward the cursor. Otherwise, the player rotates automatically based on movement direction.


Shooting System & Bullet Behavior

Next came the shooting system. Once the player picks up a gun, they can shoot in their current facing direction. Bullets are instantiated slightly ahead of the player to avoid self-collisions, and they inherit velocity in the direction the player is facing. Each bullet lasts up to 3 ricochets (reflections) before getting destroyed. This bouncing mechanic adds both a strategic layer and potential danger: your own bullets can come back and hit you o_o 



Each bullet uses Rigidbody2D physics, and I detect collisions via OnCollisionEnter2D. If a bullet hits the player and they’re not rolling, the game ends (or will, once I hook that up). On the other hand, if they’re rolling, bullets pass right through. Rolling grants temporary invulnerability and disables collisions with bullets via Physics2D.IgnoreCollision, which I reset after a short duration.

Camera System

The camera follows the player using a basic smooth follow script that interpolates the camera’s position toward the player with some offset. This keeps the action centered and avoids sudden jumps.

Summary

So right now, I have:

  • Basic 2D player movement

  • Smooth rotation toward aim or movement direction

  • Pick-up/drop gun functionality (Not really happy with how this was coded, so I'll change it in the future)

  • Bullet shooting and ricochet system

  • Rolling with invincibility frames

  • A basic follow camera

Comentarios

Entradas populares de este blog

Enemy AIs, UI logic and Adjusting Weapons Architecture

Final Game and Conclusion