# Alien Rush

## Project Description

Alien Rush is a tower defense game built with Phaser 3, where players must defend against waves of alien enemies by strategically placing towers on a grid-based map. The core gameplay revolves around managing resources (gold), selecting appropriate tower types for different enemy threats, and upgrading defenses to survive increasingly difficult waves.

The game features multiple levels with varying layouts and difficulty progression, including:

- A main menu system
- Interactive gameplay where players place towers on a grid
- Enemy wave management with different enemy types and behaviors  
- Resource management (gold) for purchasing and upgrading towers
- Visual interface showing tower placement options, upgrade menus, and game stats
- Core defense mechanics that decrease when enemies reach the end of paths

![Alien Rush Screenshot](alien-rush.png)

## Technologies Used

This project uses:

- **JavaScript/ES6+** - Primary programming language for all game logic and functionality
- **Phaser 3** - Game framework providing rendering, physics, input handling, and scene management  
- **HTML5 Canvas** - For game rendering and display
- **JSON** - Level data storage with tile-based map configurations

The codebase follows modern JavaScript practices using ES6 modules for organization. The project structure leverages Phaser's scene system to separate concerns between menu, gameplay, and UI elements.

## File Structure

```
.
├── assets/                 # Game assets including maps and images
│   ├── level1.json         # First level map data
│   ├── level2.json         # Second level map data  
│   ├── level3.json         # Third level map data
│   └── level4.json         # Fourth level map data (incomplete)
├── index.html              # Main HTML entry point
├── src/                    # Source code directory
│   ├── main.js             # Game initialization and configuration
│   ├── scenes/             # Phaser scene classes  
│   │   ├── level.js        # Core gameplay scene with grid logic
│   │   ├── menu.js         # Menu system scene
│   │   └── uiScene.js      # User interface management
│   ├── support/            # Game logic helper classes
│   │   ├── enemies.js      # Enemy spawning and behavior management  
│   │   ├── interfaceManager.js  # UI interaction handling
│   │   ├── towerAnims.js   # Tower animation setup
│   │   ├── towerManager.js # Tower placement, upgrading, and attack logic
│   │   └── waveManager.js  # Wave scheduling and enemy spawn management
└── src/EasyStar.js         # Pathfinding library (external dependency)
```

The codebase is organized around Phaser's scene system where each major game component has its own dedicated file. The `main.js` initializes the game with configuration, while scenes handle different aspects of gameplay (menu, level, UI). Support files contain specialized logic for enemies, towers, and waves that are utilized by the main scenes.
