Skip to content
This repository was archived by the owner on Dec 24, 2025. It is now read-only.

Brick#7

Merged
thnhmai06 merged 13 commits into
mainfrom
brick
Oct 7, 2025
Merged

Brick#7
thnhmai06 merged 13 commits into
mainfrom
brick

Conversation

@ManhTanTran

Copy link
Copy Markdown
Collaborator

🧱 Summary

Refactored and improved the brick system to support multiple brick types, better visuals, and cleaner code structure.

✨ Changes

  • Added BrickFactory to centralize brick creation logic (Normal, Strong, Explode, Protected)
  • Implemented BrickComponent with HP-based color updates and dynamic visual feedback
  • Enhanced ProtectedBrick to display visible shields (top, bottom, left, right)
  • Improved ExplodeBrick with explosion damage handling
  • Cleaned up redundant base Brick class and replaced with component-based system

Copilot AI review requested due to automatic review settings October 5, 2025 10:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Brick class with BrickComponent using component-based architecture
  • Added BrickFactory for 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.

Comment on lines +43 to +44
List<Entity> entites = FXGL.getGameWorld().getEntities();
for (Entity e : entites) {

Copilot AI Oct 5, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable name 'entites' should be 'entities'.

Suggested change
List<Entity> entites = FXGL.getGameWorld().getEntities();
for (Entity e : entites) {
List<Entity> entities = FXGL.getGameWorld().getEntities();
for (Entity e : entities) {

Copilot uses AI. Check for mistakes.
Comment thread src/main/java/com/github/codestorm/bounceverse/brick/BrickComponent.java Outdated
@thnhmai06 thnhmai06 self-requested a review October 7, 2025 10:38
Comment thread src/main/java/com/github/codestorm/bounceverse/brick/BrickComponent.java Outdated
this.initialHp = hp;
this.baseColor = baseColor;
this.destroyed = false;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

destroyed already in health

- 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.
@thnhmai06 thnhmai06 requested review from Copilot and thnhmai06 October 7, 2025 19:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/main/java/com/github/codestorm/bounceverse/factory/BrickFactory.java Outdated
Comment thread src/main/java/com/github/codestorm/bounceverse/factory/BrickFactory.java Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings October 7, 2025 19:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).
Copilot AI review requested due to automatic review settings October 7, 2025 19:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot AI Oct 7, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected 'expended' to 'expanded' to match the intended functionality.

Suggested change
// Create a new expended paddle.
// Create a new expanded paddle.

Copilot uses AI. Check for mistakes.
Comment on lines +66 to +69
public void moveLeft() {}

// Move the paddle right.
public void moveRight() {}

Copilot AI Oct 7, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.

@thnhmai06 thnhmai06 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thnhmai06 thnhmai06 merged commit cec4335 into main Oct 7, 2025
6 checks passed
@thnhmai06 thnhmai06 deleted the brick branch October 7, 2025 19:43
thnhmai06 added a commit that referenced this pull request Oct 27, 2025
* 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>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants