Skip to content

DatNT-Coder/Megaman-Unity2D

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Megaman

🎮 Unity 2D Platformer – MegaMan Style Prototype

🎥 Gameplay Demo

Click the image below to watch the demo video:

Watch Gameplay Demo


📌 Overview

This is a 2D platformer prototype inspired by MegaMan, developed in Unity using C#.

The project focuses on:

  • Player movement mechanics
  • Shooting system
  • Enemy spawning architecture
  • Object Pooling for performance optimization
  • Score system and explosion damage logic

This project was built to practice clean system design and performance-aware gameplay programming.


🕹 Gameplay Description

👤 Player (MegaMan-style character)

The player can:

  • Move left and right
  • Jump
  • Shoot bullets
  • Take damage from enemies or explosions

👾 Enemies

There are 2 enemy types:

  • KillerBomb
  • Pepe

Enemies are spawned continuously from a vertical spawn line on one side of the screen.

Spawn system features:

  • Random enemy selection
  • Adjustable spawn probability
  • Random spawn position along Y-axis
  • Spawn controlled by coroutine timer

💥 Combat System

  • Player bullets damage enemies.
  • When enemies are defeated:
    • They explode
    • The explosion area can deal damage
    • The player gains score points
  • Enemies are returned to the object pool instead of being destroyed.

⚙️ Technical Features

🔁 Object Pooling System

Each enemy type uses its own ObjectPool.

Features:

  • Pre-instantiated objects
  • Auto expansion up to max size
  • No runtime Destroy calls
  • Enemies return to pool when defeated

This prevents performance spikes caused by frequent Instantiate/Destroy operations.


🎯 Spawn System

  • Single Spawn Controller
  • Spawn occurs along a vertical line
  • Spawn height is configurable
  • Enemy type selected using probability percentage

🧠 Explosion Damage Logic

  • Enemies trigger explosion effect when defeated
  • Explosion has an area of effect
  • Damage can affect nearby entities
  • Encourages positional gameplay

📈 Performance-Oriented Design

  • Coroutine-based timed spawning
  • No unnecessary object destruction
  • Reusable bullet & enemy objects
  • Designed with mobile/hyper-casual optimization mindset

🚀 Future Improvements

  • Wave-based spawning system
  • Dynamic difficulty scaling
  • UI improvements
  • Sound effects and polish
  • Mobile build optimization
  • Boss enemy implementation

🛠 Built With

  • Unity (2D)
  • C#
  • Coroutine-based systems
  • Custom Object Pool implementation

🧑‍💻 Learning Goals

Through this project, I practiced:

  • Clean spawn architecture
  • Performance optimization with pooling
  • Area damage logic
  • Probability-based enemy spawning
  • Inspector-driven system configuration

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors