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

Comments

PowerUp Base#22

Merged
thnhmai06 merged 2 commits intodevfrom
powerup
Oct 29, 2025
Merged

PowerUp Base#22
thnhmai06 merged 2 commits intodevfrom
powerup

Conversation

@thnhmai06
Copy link
Member

No description provided.

Added PowerUpContainer to store components within an entity without activating their logic. Implemented PowerUpFactory to create power-up entities in the game. This enhances the game's functionality by allowing dynamic power-up management.
@thnhmai06 thnhmai06 requested a review from Copilot October 29, 2025 11:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors entity compatibility checking, adds new power-up infrastructure, and improves code organization. Key changes include simplifying the compatibility logic, making undoable behaviors more flexible, and restructuring game system initialization.

  • Simplified the throwIfNotCompatible method logic by inverting condition checks for better readability
  • Added PowerUpFactory and PowerUpContainer classes to support power-up entities in the game
  • Enhanced UndoableBehavior with configurable removal behavior and proper cleanup hooks

Reviewed Changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
ForEntity.java Updated documentation with clarified examples for entity compatibility annotations
PowerUpFactory.java New factory class for creating power-up entities with physics components
PaddleFactory.java Removed ScaleChange component and updated TODO comment
BrickFactory.java Removed unused PaddleShooting component from brick creation
InputSystem.java Made class final to prevent inheritance
GameSystem.java Refactored apply() method by extracting spawn logic into separate methods and removed unused variable
PowerUpContainer.java New component for storing and applying components from power-up entities
UndoableBehavior.java Added configurable removal behavior, cleanup hook, and constructors
ScaleChange.java Added constructor to support new UndoableBehavior requirements
Utilities.java Simplified compatibility checking logic by inverting conditional flow
build.gradle Removed unused auto-service dependencies and fixed duplicate guava declaration
Comments suppressed due to low confidence (1)

src/main/java/com/github/codestorm/bounceverse/core/systems/GameSystem.java:48

  • Variable 'GameWorld gameWorld' is never read.
        final var gameWorld = FXGL.getGameWorld();

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


@Override
public void apply() {
final var gameWorld = FXGL.getGameWorld();
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

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

The variable gameWorld is declared but never used. It should be removed or utilized if it was intended for the addFactory method.

Suggested change
final var gameWorld = FXGL.getGameWorld();

Copilot uses AI. Check for mistakes.
Comment on lines +98 to +105
public UndoableBehavior(Duration duration) {
this.duration = duration;
}

public UndoableBehavior(Duration duration, boolean removeWhenUndo) {
this(duration);
this.removeWhenUndo = removeWhenUndo;
}
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

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

Adding required constructors to the abstract class UndoableBehavior is a breaking change that requires all subclasses to define explicit constructors. Consider providing a default no-arg constructor or documenting this breaking change.

Copilot uses AI. Check for mistakes.
… constructor

Removed unused import in GameSystem and added a default constructor to UndoableBehavior for better flexibility.
@thnhmai06 thnhmai06 merged commit bf4be0a into dev Oct 29, 2025
4 checks passed
@thnhmai06 thnhmai06 deleted the powerup branch October 29, 2025 11:31
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.

1 participant