Skip to content

michalsobr/TurnBasedBattle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

2 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฎ Turn-Based Battle System (Unity, C#)

A polished 2D turn-based battle system built in Unity, focusing on clean architecture, modular systems, and responsive UI/UX.
This project demonstrates a complete combat loop with multiple enemies, player abilities, and dynamic UI feedback.


โ–ถ๏ธ How to Play

The game is available as a downloadable build:

๐Ÿ‘‰ Play on itch.io

Option 1 โ€“ Run Build (Windows)

Download the build and run:

TurnBasedBattle.exe

Make sure all files in the folder remain together.

Option 2 โ€“ Run Build (MacOS)

Download the build and run:

TurnBasedBattle.app

Option 3 โ€“ Run in Unity

  1. Open project in Unity
  2. Load main scene
  3. Press Play

๐ŸŽฌ Gameplay

โš”๏ธ Basic Combat

Basic Combat

๐Ÿ’ฅ Skill Combo

Skill Combo

๐Ÿ›ก๏ธ Defend & Block

Defend

โธ๏ธ Pause Menu

Pause Menu


๐Ÿš€ Features

  • ๐Ÿ” Turn-based combat loop (Player โ†’ Enemy โ†’ Player)
  • โš”๏ธ Multiple enemies with independent behavior
  • ๐Ÿ›ก๏ธ Defend system (player & enemies)
  • ๐Ÿ’ฅ Skill combo system (multi-hit animation + SFX logic)
  • โค๏ธ Heal system using skill points
  • ๐ŸŽฏ Target selection (keyboard + mouse support)
  • ๐ŸŽต Centralized SFX system
  • ๐Ÿ–ฑ๏ธ Hover feedback (UI + enemies)
  • โธ๏ธ Pause menu with resume / restart / exit
  • ๐Ÿ Win / Lose states with UI transitions

๐Ÿ› ๏ธ Technologies Used

  • Unity (Version: 6.4)
  • C#
  • Unity Input System
  • TextMeshPro

๐Ÿ“ Project Structure

TurnBasedBattle/
โ”‚
โ”œโ”€โ”€ Assets/
โ”‚   โ”œโ”€โ”€ _Project/
โ”‚   โ”‚   โ”œโ”€โ”€ Animations/
โ”‚   โ”‚   โ”œโ”€โ”€ Audio/
โ”‚   โ”‚   โ”œโ”€โ”€ Materials/
โ”‚   โ”‚   โ”œโ”€โ”€ Prefabs/
โ”‚   โ”‚   โ”œโ”€โ”€ Scenes/
โ”‚   โ”‚   โ”œโ”€โ”€ Scripts/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Animation/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Audio/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Combat/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Core/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Environment/
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ UI/
โ”‚   โ”‚   โ”œโ”€โ”€ Settings/
โ”‚   โ”‚   โ””โ”€โ”€ Sprites/
โ”‚   โ”œโ”€โ”€ TextMesh Pro/
โ”‚   โ””โ”€โ”€ ThirdParty/
โ”‚
โ”œโ”€โ”€ Packages/
โ””โ”€โ”€ ProjectSettings/

๐Ÿง  Architecture

The project follows a clean separation of responsibilities:

Core Scripts

  • BattleManager โ†’ game logic, turn flow, combat rules
  • BattleUI โ†’ UI rendering and interaction
  • BattleCharacterAnimator โ†’ animation control only
  • SFXManager โ†’ centralized audio playback

Design Principles

  • No gameplay logic in UI
  • Modular and readable code
  • Minimal duplication
  • Clear separation of concerns

๐ŸŽฎ Controls

Action Key
Select Action W / S
Select Enemy A / D
Confirm Enter
Pause Menu ESC
Skip Turn P

๐Ÿ“š What I Learned

  • Designing a modular turn-based combat system with clear separation of concerns
  • Structuring Unity projects for readability and maintainability
  • Managing game state and turn flow using a centralized controller (BattleManager)
  • Implementing responsive UI systems without embedding gameplay logic in UI scripts
  • Creating reusable animation wrappers to decouple logic from presentation
  • Designing and implementing a flexible input system using Unity's new Input System
  • Handling edge cases in gameplay (defend mechanics, target validation, action availability)
  • Improving user experience through audio feedback, hover states, and UI responsiveness
  • Refactoring and cleaning up code to achieve a consistent and professional codebase

๐Ÿ“Œ Future Improvements

  • Status effects (poison, stun, buffs)
  • Enemy AI patterns
  • Data-driven abilities
  • Save system
  • Expanded UI polish

๐ŸŽจ Assets & Credits

The following third-party assets were used in this project:

๐ŸŽต Music

๐Ÿ”Š Sound Effects

๐Ÿ–ฅ๏ธ UI

๐ŸŒ„ Background

๐Ÿง Player Character

๐Ÿ—ก๏ธ Enemy Characters

๐Ÿค– AI-Generated Assets


All assets are used under their respective licenses for educational and portfolio purposes.

๐Ÿ“„ License

This project is made for my portfolio, for educational purposes only.

About

A 2D turn-based battle system built in Unity, focusing on clean architecture, modular systems, and responsive UI/UX.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors