This project is a 2D RPG-style defense game developed in Unity using C# scripting.
The game takes place in a single level where the player must protect a small girl (NPC) positioned at the center of the scene from waves of skeleton enemies. Skeletons continuously spawn from both sides of the screen and move toward the center, attempting to attack both the player and the girl. The player must defeat the enemies and prevent them from reaching the girl.
All gameplay systems and scripts were implemented by me from scratch while following a learning tutorial from AlexDev on youtube.
The player controls a character positioned near the center of the scene while protecting a small girl standing nearby. Skeleton enemies spawn from the left and right edges of the screen and walk toward the center. The player must intercept and defeat them before they reach the girl.
If enemies reach the girl or defeat the player, the game ends.
The goal of the game is to:
1- Protect the girl (NPC) in the center of the scene. 2- Defeat skeleton enemies before they reach her. 3- Survive the incoming enemy waves as long as possible.
The player character supports several core actions:
- Move left
- Move right
- Jump to reposition and avoid enemies
- The player can attack enemies
- Successful hits eliminate skeleton enemies
The game includes a basic 2D animation system using Unity’s Animator.
Animations implemented include:
- Player idle animation
- Player fall animation
- Player jump animation
- Player attack animation
- Player move animation
- Enemy move animation
- Enemy attack animation
- Enemy idle animation
Animations are controlled through the Animator Controller, which switches between states based on player movement, actions, and enemy behavior.
The game includes a simple but functional UI system that helps track gameplay progress and game state in real time.
- A timer is displayed on the screen during gameplay.
- It tracks how long the player has survived in the current run.
- This helps measure endurance against increasing enemy pressure.
- A kill counter is shown on the UI.
- It increases each time the player defeats a skeleton enemy.
- It provides feedback on player performance and combat efficiency.
- A Game Over UI appears when the player loses the game.
This happens if:
- The player is defeated or
- The girl (NPC) in the center is reached by enemies. -It gives a clear visual indication that the run has ended.
This project demonstrates implementation of:
- 2D character movement mechanics
- Combat and attack systems
- Enemy spawning systems
- Health and damage systems
- Sprite-based 2D animations
- Unity Animator Controller for animation state transitions
- Unity
- C#
- Unity Animator System
- 2D Sprite Animation
- Unity Physics