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

Comments

feat/GameApplication#8

Merged
thnhmai06 merged 14 commits intomainfrom
feature/game-manager
Oct 8, 2025
Merged

feat/GameApplication#8
thnhmai06 merged 14 commits intomainfrom
feature/game-manager

Conversation

@ManhTanTran
Copy link
Collaborator

🎮 Summary

Introduced the core game management system and the main FXGL application entry point.
This update lays the foundation for gameplay initialization, brick spawning, and runtime management.


✨ Changes

  • Added GameManager class to handle:
    • Brick spawning via BrickFactory
    • Score updates based on brick destruction
    • Power-up tracking and management
    • Level and lives handling logic
  • Added BounceVerseApp:
    • Configures FXGL game window, title, and resolution
    • Sets up scene background and initial game entities

Copilot AI review requested due to automatic review settings October 5, 2025 10:20
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 introduces the core game management system and main application entry point for BounceVerse, a breakout-style game built with FXGL. The update establishes the foundational architecture for brick-based gameplay with various brick types and power-up mechanics.

  • Added GameManager class for handling game logic including brick spawning, score management, and level progression
  • Implemented comprehensive brick system with multiple types (normal, strong, explode, protected) and factory pattern
  • Created paddle hierarchy with specialized variants (laser, shrink, expand) and main FXGL application setup

Reviewed Changes

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

Show a summary per file
File Description
BounceVerseApp.java Main FXGL application entry point with game window configuration and initialization
GameManager.java Core game logic manager handling brick spawning, scoring, and game state
BrickFactory.java Factory class for creating different brick entity types with visual components
BrickComponent.java Base brick component with HP system, visual updates, and destruction logic
ExplodeBrick.java Specialized brick that triggers explosion effects on nearby bricks when destroyed
ProtectedBrick.java Brick variant with directional shields that block hits from specific sides
PowerBrick.java Power-up brick component (placeholder implementation)
Paddle.java Base paddle class with movement and positioning capabilities
LaserPaddle.java Paddle variant capable of shooting bullets (placeholder bullet management)
ShrinkPaddle.java Narrower paddle variant using scale factor
ExpendPaddle.java Wider paddle variant using scale factor

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

*/
public class LaserPaddle extends Paddle {
/** List of bullets currently fired by the paddle. */
private List<LaserPaddle> bullets;
Copy link

Copilot AI Oct 5, 2025

Choose a reason for hiding this comment

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

The bullets list should contain bullet entities, not LaserPaddle instances. This should be List<Entity> or a dedicated bullet class type.

Copilot uses AI. Check for mistakes.
/** Updates all bullets when them get off-screen or hit the brick. */
public void updateBullets() {}

public List<LaserPaddle> getBullets() {
Copy link

Copilot AI Oct 5, 2025

Choose a reason for hiding this comment

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

The return type should match the bullets field type. If bullets should be Entity objects, this should return List<Entity>.

Copilot uses AI. Check for mistakes.
// The scale factor applied to the paddle's width.
private static final double SCALE = 1.5;

// Create a new expended paddle.
Copy link

Copilot AI Oct 5, 2025

Choose a reason for hiding this comment

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

Comment should say 'expanded paddle' instead of 'expended paddle' to match the intended functionality.

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

Copilot uses AI. Check for mistakes.

/** Create a rectangular visual for brick. */
public void onAdded() {
// Lấy view của Entity
Copy link

Copilot AI Oct 5, 2025

Choose a reason for hiding this comment

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

Comment is in Vietnamese. Should be in English: '// Get the Entity's view'

Suggested change
// Lấy view của Entity
// Get the Entity's view

Copilot uses AI. Check for mistakes.
Comment on lines 43 to 44
List<Entity> entites = FXGL.getGameWorld().getEntities();
for (Entity e : entites) {
Copy link

Copilot AI Oct 5, 2025

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' (missing 'i').

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.
# Conflicts:
#	src/main/java/com/github/codestorm/bounceverse/brick/PowerBrick.java
#	src/main/java/com/github/codestorm/bounceverse/brick/ProtectedBrick.java
- Renamed `BounceVerseApp` to `Bounceverse` for consistency.
- Set the game title to the new class name.
- Integrated `BrickFactory` for spawning bricks in the game.
- Updated `build.gradle` for application configuration and added release tasks.
@thnhmai06 thnhmai06 changed the title Feature/game manager feat/GameApplication Oct 8, 2025
- Added permissions to `buildRelease.yml`, `build.yml`, and `setup.yml` (to manage content access).
- Created new log files for debugging (to assist in troubleshooting).
- Updated `Readme.txt` to clarify the purpose of the directory.
Copilot AI review requested due to automatic review settings October 8, 2025 04:08
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

Copilot reviewed 14 out of 16 changed files in this pull request and generated 4 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.

FXGL.getGameWorld().addEntityFactory(new BrickFactory());

var brick1 = FXGL.spawn("normalBrick", 100, 100);
var brick2 = FXGL.spawn("normalBrick", 100, 100);
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

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

Both bricks are spawned at the exact same position (100, 100), causing them to overlap. The second brick should be positioned differently.

Suggested change
var brick2 = FXGL.spawn("normalBrick", 100, 100);
var brick2 = FXGL.spawn("normalBrick", 150, 100);

Copilot uses AI. Check for mistakes.
runs-on: ubuntu-latest

steps:
- uses: .github/workflows/setup.yml
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

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

Cannot use a workflow file as a step. Use 'uses: ./.github/workflows/setup.yml' for a reusable workflow or convert setup.yml to an action.

Suggested change
- uses: .github/workflows/setup.yml
- uses: ./.github/workflows/setup.yml
with: {}
secrets: {}

Copilot uses AI. Check for mistakes.
runs-on: ubuntu-latest

steps:
- uses: .github/workflows/setup.yml
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

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

Cannot use a workflow file as a step. Use 'uses: ./.github/workflows/setup.yml' for a reusable workflow or convert setup.yml to an action.

Suggested change
- uses: .github/workflows/setup.yml
- uses: ./.github/workflows/setup.yml

Copilot uses AI. Check for mistakes.
runs-on: ubuntu-latest

steps:
- uses: .github/workflows/setup.yml
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

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

Cannot use a workflow file as a step. Use 'uses: ./.github/workflows/setup.yml' for a reusable workflow or convert setup.yml to an action.

Suggested change
- uses: .github/workflows/setup.yml
- uses: ./.github/workflows/setup.yml@main

Copilot uses AI. Check for mistakes.
Expanded the guidelines for writing commit messages, detailing structure, types, and examples to ensure clarity and consistency in commit history.
@thnhmai06 thnhmai06 self-requested a review October 8, 2025 04:12
Copy link
Member

@thnhmai06 thnhmai06 left a comment

Choose a reason for hiding this comment

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

lgtm nhưng @ManhTanTran cần bám sát sườn vào các đối tượng trong engine nhé

@thnhmai06 thnhmai06 merged commit f9ae3d2 into main Oct 8, 2025
4 checks passed
@thnhmai06 thnhmai06 deleted the feature/game-manager branch October 8, 2025 04:13
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(game): add GameManager and BounceVerseApp for game initialization

* refactor: Refactor GameManager, build/run scripts and update ci/cd

- Renamed `BounceVerseApp` to `Bounceverse` for consistency.
- Set the game title to the new class name.
- Integrated `BrickFactory` for spawning bricks in the game.
- Updated `build.gradle` for application configuration and added release tasks.

* ci: add specific workflow permission

- Added permissions to `buildRelease.yml`, `build.yml`, and `setup.yml` (to manage content access).
- Created new log files for debugging (to assist in troubleshooting).
- Updated `Readme.txt` to clarify the purpose of the directory.

* docs: update git commit instructions to align with Conventional Commits

Expanded the guidelines for writing commit messages, detailing structure, types, and examples to ensure clarity and consistency in commit history.

---------

Co-authored-by: Mai Thành <62001770+thnhmai06@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.

2 participants