Conversation
…Protected, Explode)
There was a problem hiding this comment.
Pull Request Overview
Refactored the brick system to use a component-based architecture with centralized factory pattern, replacing inheritance-based brick classes with a more flexible component system that supports multiple brick types with enhanced visuals and cleaner code organization.
- Replaced base
Brickclass withBrickComponentusing component-based architecture - Added
BrickFactoryfor centralized creation of different brick types (Normal, Strong, Explode, Protected) - Enhanced brick visuals with HP-based color updates and shield rendering for protected bricks
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/java/com/github/codestorm/bounceverse/paddle/ShrinkPaddle.java | New paddle subclass that scales width by 0.7 factor |
| src/main/java/com/github/codestorm/bounceverse/paddle/Paddle.java | Base paddle class with position, movement, and reset functionality |
| src/main/java/com/github/codestorm/bounceverse/paddle/LaserPaddle.java | Paddle subclass with bullet shooting capabilities |
| src/main/java/com/github/codestorm/bounceverse/paddle/ExpendPaddle.java | Paddle subclass that scales width by 1.5 factor |
| src/main/java/com/github/codestorm/bounceverse/brick/ProtectedBrick.java | Updated to extend BrickComponent with shield-based damage protection |
| src/main/java/com/github/codestorm/bounceverse/brick/PowerBrick.java | Updated to extend BrickComponent for power-up functionality |
| src/main/java/com/github/codestorm/bounceverse/brick/ExplodeBrick.java | New explosive brick that damages surrounding bricks when destroyed |
| src/main/java/com/github/codestorm/bounceverse/brick/BrickFactory.java | Factory class for creating different brick entity types with visual configurations |
| src/main/java/com/github/codestorm/bounceverse/brick/BrickComponent.java | Core component class managing brick HP, visuals, and destruction behavior |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| List<Entity> entites = FXGL.getGameWorld().getEntities(); | ||
| for (Entity e : entites) { |
There was a problem hiding this comment.
Variable name 'entites' should be 'entities'.
| List<Entity> entites = FXGL.getGameWorld().getEntities(); | |
| for (Entity e : entites) { | |
| List<Entity> entities = FXGL.getGameWorld().getEntities(); | |
| for (Entity e : entities) { |
| this.initialHp = hp; | ||
| this.baseColor = baseColor; | ||
| this.destroyed = false; | ||
| } |
- Added Brick, BrickHealth, BrickDrop, BrickExplode, and BrickFactory classes to manage brick entities and their behaviors (enhances gameplay mechanics). - Refactored existing classes to align with new component structure.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 24 out of 25 changed files in this pull request and generated 5 comments.
Files not reviewed (1)
- .idea/misc.xml: Language not supported
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 24 out of 25 changed files in this pull request and generated 1 comment.
Files not reviewed (1)
- .idea/misc.xml: Language not supported
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Removed the @spawns annotation from the newBrick methods in BrickFactory to streamline the code and eliminate unnecessary complexity (no functional changes).
# Conflicts: # .idea/misc.xml
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 24 out of 25 changed files in this pull request and generated 2 comments.
Files not reviewed (1)
- .idea/misc.xml: Language not supported
Comments suppressed due to low confidence (1)
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| // The scale factor applied to the paddle's width. | ||
| private static final double SCALE = 1.5; | ||
|
|
||
| // Create a new expended paddle. |
There was a problem hiding this comment.
Corrected 'expended' to 'expanded' to match the intended functionality.
| // Create a new expended paddle. | |
| // Create a new expanded paddle. |
| public void moveLeft() {} | ||
|
|
||
| // Move the paddle right. | ||
| public void moveRight() {} |
There was a problem hiding this comment.
The moveLeft() and moveRight() methods are empty implementations. These should either contain actual movement logic or be marked as abstract if this is intended as a base class for extension.
* feat: Brick * feat(brick): add PowerBrick and update Brick, ExoplodeBrick, ProtectedBrick * docs(brick): add Javadoc for Brick, ExoplodeBrick, PowerBrick, ProtectedBrick * refactor(brick): remove NormalBrick and StrongBrick * feat(paddle): add ExpendPaddle, LaserPaddle, ShrinkPaddle and update Paddle * feat(paddle): add ExpendPaddle, LaserPaddle, ShrinkPaddle and update Paddle * refactor: remove brick and gameManager packages * feat(brick): refactor and document brick module (Factory, Component, Protected, Explode) * feat(brick): Introduce brick components and behaviors - Added Brick, BrickHealth, BrickDrop, BrickExplode, and BrickFactory classes to manage brick entities and their behaviors (enhances gameplay mechanics). - Refactored existing classes to align with new component structure. * docs(brick): Corrected spelling of 'nheritance' to 'inheritance' Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * refactor(brick): remove multiple Spawns annotation from newBrick methods Removed the @spawns annotation from the newBrick methods in BrickFactory to streamline the code and eliminate unnecessary complexity (no functional changes). --------- Co-authored-by: Mai Thành <62001770+thnhmai06@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
🧱 Summary
Refactored and improved the brick system to support multiple brick types, better visuals, and cleaner code structure.
✨ Changes
BrickFactoryto centralize brick creation logic (Normal, Strong, Explode, Protected)BrickComponentwith HP-based color updates and dynamic visual feedbackProtectedBrickto display visible shields (top, bottom, left, right)ExplodeBrickwith explosion damage handlingBrickclass and replaced with component-based system