Phantom is a 2D shoot 'em up game, inspired by the Touhou Project series, developed for the Object-Oriented Programming course (SCC0604) at ICMC-USP.
Navigate through 5 challenging stages, defeating waves of enemies and dodging intricate bullet patterns. The player controls a powerful hero with the ability to move freely, shoot projectiles, and unleash devastating bombs. Collect power-ups to enhance your abilities and score points to achieve a high score.
A detailed documentation of the project's architecture, packages, and classes can be found in the DOCUMENTACAO.md file.
Here are some examples of the game's assets:
- 5 Unique Stages: Progress through 5 different stages, each with its own script for enemy and scenery generation.
- Dynamic Player Character:
- Precise movement with a "focus" mode (holding Shift) for slower, more accurate dodging.
- A power-up system that increases shot power and adds homing missiles.
- A bomb system that clears bullets in a large radius and deals massive damage.
- Complex Enemies: A variety of enemies with different movement and attack patterns.
- Object Pooling: An efficient object pool system for projectiles to minimize garbage collection and improve performance.
- Data-Driven Design: Projectile properties (sprites, hitboxes, etc.) are loaded from an external JSON file, allowing for easy modification and expansion.
- Advanced Collision Detection: A Quadtree data structure is used to optimize collision detection, ensuring smooth gameplay even with many objects on screen.
- Save/Load System: Save your progress at any time and load it later to continue your run.
- Debug Mode: A built-in debug mode that displays an FPS counter, player stats, and allows for dynamic enemy spawning via drag-and-drop for testing purposes.
The project follows a Model-View-Controller (MVC) architecture to separate concerns:
- Model: Contains the game's data and core logic.
Personagem: Abstract base class for all game entities.Hero,Inimigo,Item,Projetil: Concrete implementations of game entities.FaseandScriptDeFase: A flexible system where eachFaseobject is controlled by aScriptDeFaseimplementation, allowing for unique level design and event scripting for each stage.
- View:
Cenario: AJPanelresponsible for rendering all game objects, backgrounds, and UI elements.
- Controller:
Engine: The core of the game, containing the main game loop, state machine (managing states likeJOGANDO,RESPAWNANDO,GAME_OVER), and coordinating all other components.ControladorDoHeroi: Translates keyboard input into actions for theHero.ControleDeJogo: Manages game rules, interactions, and collision detection logic.
- Open the project in Apache NetBeans.
- Press
F6to build and run the project.
-
Make sure you have Apache Ant installed.
-
Navigate to the project's root directory in your terminal.
-
Run the following command:
ant run
- Movement: W, A, S, D
- Shoot: K
- Bomb: L
- Focus Mode: Hold Shift
- Save Game: P
- Load Game: R
- Java
- Swing (for the GUI)
- Apache Ant (for building)
Para uma compreensão aprofundada da estrutura de cada pacote, os seguintes diagramas UML detalhados foram gerados e podem ser visualizados diretamente aqui:















