feat(core): centralized asset manager, improved settings system, and build workflow updates#27
feat(core): centralized asset manager, improved settings system, and build workflow updates#27
Conversation
- Deleted the 'ratchetFrom' line from the spotless configuration (to simplify the build.gradle file).
* feat: implement abstract class Ball * refactor: update Ball class package and documentation - Renamed package from `com.github.codestorm.ball` to `com.github.codestorm.bounceverse.ball` (to reflect project structure) - Enhanced class documentation to clarify the purpose and functionality of the Ball class --------- Co-authored-by: Mai Thành <62001770+thnhmai06@users.noreply.github.com>
* 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 * refactor(brick): rename packages and update formatting settings - Renamed package from `com.github.codestorm.brick` to `com.github.codestorm.bounceverse.brick` for consistency. - Updated Google Java Format settings to use AOSP style. --------- Co-authored-by: Mai Thành <62001770+thnhmai06@users.noreply.github.com>
* feat: add PowerUp class - Introduced PowerUp class to manage special effects and abilities for game objects (provides lazy-update functionality). - Updated build.gradle to include JavaFX plugin and specified version. - Modified project configuration files for compatibility with new features. * docs: update PowerUp class documentation - Corrected the description of PowerUps to use plural form for consistency. - Improved clarity in the apply and unapply method descriptions (automatically used when power up becomes active/ends).
- Added 'target/' to .gitignore to exclude build artifacts. - Updated .gitignore to simplify IntelliJ IDEA configuration exclusions. - Created git-commit-instructions.md for standardized commit message guidelines.
* feat: Brick * feat(brick): add PowerBrick and update Brick, ExoplodeBrick, Protecte… * docs(brick): add Javadoc for Brick, ExoplodeBrick, PowerBrick, Protec… * refactor(brick): remove NormalBrick and StrongBrick * feat(paddle): add ExpendPaddle, LaserPaddle, ShrinkPaddle and update … * feat(paddle): add ExpendPaddle, LaserPaddle, ShrinkPaddle and update … * feat(paddle): add ExpendPaddle, LaserPaddle, ShrinkPaddle and update … * refactor: remove brick and gameManager packages * refactor(paddle): enhance documentation for Paddle and its variants
* 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>
* 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>
Refactor the setup steps in build.yml, buildRelease.yml, and linting.yml to include a name for the setup action, improving readability and maintainability.
Cleared the `scriptParameters` option in `bytecode.run.xml` and `release.run.xml` to avoid unnecessary debug flags during execution.
) * refactor: reorganize component structure and improve entity tagging - Added new classes for Ball, BrickDrop, BrickExplode, and BrickHealth to enhance gameplay mechanics (introducing new behaviors and properties). - Updated .gitignore to include additional files and directories for better project management. - Adjusted BrickFactory to streamline brick creation process. * refactor: enhance BrickFactory to include entity type for bricks Added EntityType.BRICK to the newBrick method for better entity classification. Updated documentation for OptionalTag to correct a typo.
Eliminated SLF4J and Logback dependencies as they are no longer required for the project.
Changed the output directory from `release` to `out` in build.gradle and updated the artifact upload path in buildRelease.yml to reflect this change.
* feat: add configuration loading and game settings management Implement configuration loading from properties files to manage game settings dynamically. This includes setting the game title, version, and application mode based on the loaded configurations. Additionally, update the .gitignore to include new configuration files. * feat: implement game configuration loading and management Add structured loading of game configurations with separate classes for default options and system settings. This enhances the game's configurability and prepares for future expansion of settings management. * feat: add collision handling and launch options management Implement collision handling system and launch options for game configuration. This includes a new Collision class for managing collision logic and a LaunchOption class for parsing launch arguments (e.g., debug mode). * feat: enhance configuration loading with error handling Improve the loadConfigs method to throw an IOException when properties files cannot be opened (replaces assertion with exception handling). This ensures better error management during configuration loading. * feat: implement scene management and enhance collision handling - Added SceneFactory for managing game scenes (facilitates scene transitions). - Renamed Collision to CollisionSystem for clarity and improved structure. - Integrated credits loading into game settings (enhances user experience).
Modified the ProjectRootManager component in misc.xml to set the language level to JDK_24_PREVIEW for better compatibility with preview features.
* 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 * feat(paddle): add PaddleComponent and variants (Expand, Shrink, Laser, Bullet) with factory integration * feat(brick): implement explosion logic and health management refactor * feat(components): add new paddle behaviors and properties (Bullet, Width); refactor brick to components structure * refactor: migrate paddle and bullet systems to new structure * refactor(paddle): adjust PaddleFactory, Shoot and Width property for move and scaling * feat(wall): add WallFactory and Wall components with Move property for paddle collision * feat(physics): handle paddle-wall collision in CollisionSystem * feat(data): add WALL entity type for collision system * feat(behavior): update BrickExplode logic for new collision handling * feat(paddle-wall): add Move component update and WallFactory with correct sides and spawn registration * (skip ci) refactor: rename components and update imports for consistency Refactored various components by renaming `BehaviorComponent` to `Behavior`, `OptionalTag` to `Optional`, and `PropertyComponent` to `Property`. Updated imports accordingly to maintain consistency across the codebase. * [skip ci] Add and refactor Systems, Core (#15) * [skip ci] feat(core): implement game systems and refactor initialization - Introduced GameSystem, InputSystem, PhysicSystem, and UISystem for better organization and modularity (applies game logic, input handling, physics, and UI settings). - Refactored Bounceverse to utilize new systems for initialization and configuration management. - Updated credits and settings files for improved user experience. * [skip ci] ci: update CI configuration for Spotless checks and builds - Rename linting.yml to spotlessCheck.yml for clarity - Add concurrency settings to optimize CI runs - Modify job conditions to skip CI based on commit messages - Implement automatic code formatting application on failure * [skip ci] feat(core): initialize Video instance in UserSetting Add a new Video instance to the UserSetting class to ensure proper initialization and avoid null references. This change enhances the reliability of video settings management. * [skip ci] refactor: rename spotlessCheck.yml to spotless.yml for consistency * [skip ci] chore: Remove log files * Replace `For*` interface tag by annotation (#16) * [skip ci] refactor: replace `For*` interface with `Suitable*` annotation (remove `Tag` system) * [skip ci] chore: reformat code and optimize import * [skip ci] chore: update JAVA_LANGUAGE to 24_PREVIEW * [skip ci] refactor: Assign new `For*` annotation for components * [skip ci] fix: fix null ref on `Utils.Time.Cooldown#current` * feat: add Attack and Attributes components for entity interactions Introduce Attack and Attributes classes to manage damage and defense mechanics for entities. The Attack class allows entities to inflict damage based on their attributes, while the Attributes class holds general property values like defense. This enhances gameplay dynamics by enabling combat interactions. * fix(paddle): fix freeze paddle * ci: update CI conditions to use startsWith for skip ci Modified CI configuration to use startsWith instead of contains for detecting '[skip ci]' in commit messages, improving clarity and functionality. * chore: correct spelling and rename classes for consistency Renamed `HeathDeath` to `HealthDeath` and fixed spelling in `CanExecute` documentation. These changes improve code readability and maintainability. --------- Co-authored-by: Mai Thành <62001770+thnhmai06@users.noreply.github.com>
* feat: add game context and ball entity * feat: generate brick and ball, add simple collision * feat: apply FXGL physic * feat: spotlessApply * chore: delete empty file `CollisionSystem.java` * refactor: update branch with new project structures Introduce AnchorPoint enum for common anchor points on Rectangle2D. Refactor BallFactory to use default values for ball properties and improve entity spawning logic. Update collision handling in PhysicSystem for better interaction between entities. --------- Co-authored-by: Mai Thành <62001770+thnhmai06@users.noreply.github.com>
# Conflicts: # .github/workflows/build.yml # .github/workflows/buildRelease.yml # .github/workflows/spotless.yml # .gitignore # .idea/misc.xml # build.gradle # docs/dev/guide.md # settings.gradle # src/main/java/com/github/codestorm/bounceverse/Bounceverse.java # src/main/java/com/github/codestorm/bounceverse/components/behaviors/Attack.java # src/main/java/com/github/codestorm/bounceverse/components/behaviors/Behavior.java # src/main/java/com/github/codestorm/bounceverse/components/behaviors/CooldownBehavior.java # src/main/java/com/github/codestorm/bounceverse/components/behaviors/Explosion.java # src/main/java/com/github/codestorm/bounceverse/components/behaviors/HealthDeath.java # src/main/java/com/github/codestorm/bounceverse/components/behaviors/ScaleChange.java # src/main/java/com/github/codestorm/bounceverse/components/behaviors/UndoableBehavior.java # src/main/java/com/github/codestorm/bounceverse/components/behaviors/paddle/PaddleShooting.java # src/main/java/com/github/codestorm/bounceverse/components/properties/Attributes.java # src/main/java/com/github/codestorm/bounceverse/components/properties/Shield.java # src/main/java/com/github/codestorm/bounceverse/core/LaunchOptions.java # src/main/java/com/github/codestorm/bounceverse/core/SettingsManager.java # src/main/java/com/github/codestorm/bounceverse/core/systems/GameSystem.java # src/main/java/com/github/codestorm/bounceverse/core/systems/InputSystem.java # src/main/java/com/github/codestorm/bounceverse/core/systems/PhysicSystem.java # src/main/java/com/github/codestorm/bounceverse/factory/SceneFactory.java # src/main/java/com/github/codestorm/bounceverse/factory/entities/BallFactory.java # src/main/java/com/github/codestorm/bounceverse/factory/entities/BrickFactory.java # src/main/java/com/github/codestorm/bounceverse/factory/entities/BulletFactory.java # src/main/java/com/github/codestorm/bounceverse/factory/entities/PaddleFactory.java # src/main/java/com/github/codestorm/bounceverse/factory/entities/WallFactory.java # src/main/resources/settings.properties
…Special behavior)
- add Attachment behavior for ball–paddle link - improve PhysicSystem with shield-aware collision - limit paddle movement within walls - refine BallFactory spawn behavior - adjust WallFactory wall sides & collision box - update game initialization and system wiring
- move ExpandPaddlePowerUp, ShrinkPaddlePowerUp into new folders - add PowerUpManager and FallingComponent - update PhysicSystem and PaddleFactory integration - refactor Explosion, HealthDeath, Special behaviors
…stem, GameSystem, PhysicSystem) and update UserSettingsManager singleton
…ctories and enums
…d of paddle Updated MultipleBallPowerUp logic to correctly duplicate existing balls (x2 total) at their positions with slight velocity offset. Adjusted BallFactory to preserve SpawnData position and avoid fallback to paddle when spawning from PowerUps.
feat(powerup): add ExtraLifePowerUp and improve logic refactor: add PaddleTextureManager and CollisionGroup enum fix: clean up unused paddle textures
…th PaddlePowerComponent and PaddleViewManager
…ve ShieldSafetyNetComponent update(PaddlePowerComponent, PowerUpManager): refine paddle power handling and cooldown logic fix(UISystem, PhysicSystem, GameSystem): ensure proper initialization and shield visuals chore: minor improvements in Bounceverse.java and cooldown timing
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a centralized asset management system, improved settings infrastructure, and refactored UI components. The main changes include a new AssetsPath class for managing asset paths, new UI components for in-game elements, and workflow updates for consistent build processes.
Key changes:
- Added centralized asset path management via
AssetsPathclass - Introduced new UI framework with
ViewElementbase class andHeartscomponent - Renamed interface from
CanExecutetoExecutablefor better naming clarity - Updated build workflows to use
releasetask consistently
Reviewed Changes
Copilot reviewed 113 out of 243 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/resources/settings.properties | Contains unresolved merge conflict markers |
| src/main/resources/credits.txt | Deleted from old location |
| src/main/resources/assets/credits.txt | Added credits file to assets directory |
| src/main/java/.../ui/ingame/Hearts.java | New UI component for displaying player lives |
| src/main/java/.../ui/ViewElement.java | New abstract base class for UI elements |
| src/main/java/.../typing/records/LaunchOptions.java | New record for launch configuration |
| src/main/java/.../typing/interfaces/Executable.java | Renamed interface with updated references |
| Binary asset files (textures, sounds) | Added game assets (numbers, bricks, sounds, etc.) |
Files not reviewed (1)
- .idea/misc.xml: Language not supported
Comments suppressed due to low confidence (1)
src/main/java/com/github/codestorm/bounceverse/typing/interfaces/Executable.java:8
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <<<<<<< HEAD | ||
| # Logic | ||
| logic.width=1024 | ||
| logic.height=768 | ||
| ======= | ||
| # Video | ||
| video.width=1280 | ||
| video.height=720 | ||
| >>>>>>> origin/dev |
There was a problem hiding this comment.
Unresolved merge conflict detected in settings.properties. The file contains Git conflict markers (<<<<<<< HEAD, =======, >>>>>>> origin/dev) that must be resolved before merging. Decide whether to keep 'logic' properties, 'video' properties, or both, then remove the conflict markers.
| /** | ||
| * | ||
| * | ||
| * <h1>%{@link ViewElement}</h1> |
There was a problem hiding this comment.
| /** | ||
| * | ||
| * | ||
| * <h1>${@link LaunchOptions}</h1> |
There was a problem hiding this comment.
| public void reload() { | ||
| final var file = new File(FILENAME); | ||
| try { | ||
| final var ois = new ObjectInputStream(new FileInputStream(file)); |
There was a problem hiding this comment.
This FileInputStream is not always closed on method exit.
|
|
||
| try { | ||
| final var file = new File(FILENAME); | ||
| final var oos = new ObjectOutputStream(new FileOutputStream(file)); |
There was a problem hiding this comment.
This FileOutputStream is not always closed on method exit.
|
|
||
| // ? Display | ||
| settings.setWidth(Integer.parseInt(gameSettings.getProperty("logic.width"))); | ||
| settings.setHeight(Integer.parseInt(gameSettings.getProperty("logic.height"))); |
There was a problem hiding this comment.
Potential uncaught 'java.lang.NumberFormatException'.
| : ApplicationMode.RELEASE); | ||
|
|
||
| // ? Display | ||
| settings.setWidth(Integer.parseInt(gameSettings.getProperty("video.width"))); |
There was a problem hiding this comment.
Potential uncaught 'java.lang.NumberFormatException'.
|
|
||
| // ? Display | ||
| settings.setWidth(Integer.parseInt(gameSettings.getProperty("video.width"))); | ||
| settings.setHeight(Integer.parseInt(gameSettings.getProperty("video.height"))); |
There was a problem hiding this comment.
Potential uncaught 'java.lang.NumberFormatException'.
| * <h1>{@link Component}</h1> | ||
| * | ||
| * Một thành phần lưu trữ trên Entity trong game {@link Bounceverse}.<br> | ||
| * Giống như phiên bản class của {@link com.almasb.fxgl.entity.component.Component}. | ||
| * | ||
| * @see com.almasb.fxgl.entity.component.Component | ||
| */ | ||
| public abstract sealed class Component extends com.almasb.fxgl.entity.component.Component |
There was a problem hiding this comment.
Component has the same name as its supertype com.almasb.fxgl.entity.component.Component.
| * <h1>{@link Component}</h1> | |
| * | |
| * Một thành phần lưu trữ trên Entity trong game {@link Bounceverse}.<br> | |
| * Giống như phiên bản class của {@link com.almasb.fxgl.entity.component.Component}. | |
| * | |
| * @see com.almasb.fxgl.entity.component.Component | |
| */ | |
| public abstract sealed class Component extends com.almasb.fxgl.entity.component.Component | |
| * <h1>{@link GameComponent}</h1> | |
| * | |
| * Một thành phần lưu trữ trên Entity trong game {@link Bounceverse}.<br> | |
| * Giống như phiên bản class của {@link com.almasb.fxgl.entity.component.Component}. | |
| * | |
| * @see com.almasb.fxgl.entity.component.Component | |
| */ | |
| public abstract sealed class GameComponent extends com.almasb.fxgl.entity.component.Component |
| * | ||
| * @see com.almasb.fxgl.entity.EntityFactory | ||
| */ | ||
| abstract class EntityFactory implements com.almasb.fxgl.entity.EntityFactory { |
There was a problem hiding this comment.
EntityFactory has the same name as its supertype com.almasb.fxgl.entity.EntityFactory.
…, GameSystem, InputSystem)
Implemented various Power-Up classes (ExpandPaddle, ShrinkPaddle, ReversePaddle, etc.) to enhance gameplay. Updated PaddleViewManager to manage clones effectively and adjusted related components for better performance.
|
Big project |
This pull request introduces several improvements and refactoring changes to the project, focusing on better asset management, enhanced settings handling, and workflow updates. The most significant updates include the addition of a centralized asset path manager, improved game settings and initialization flow, and updates to build/release scripts for consistency. Below are the top changes grouped by theme:
Asset and Settings Management:
AssetsPathclass to centralize all asset paths (textures, sounds, video, etc.), improving maintainability and reducing hard-coded strings throughout the codebase. (src/main/java/com/github/codestorm/bounceverse/AssetsPath.java)settings.ADMIN.toml) with configurable video and audio parameters, supporting easier tuning and customization.Game Initialization and System Refactoring:
Bounceversemain class to use new manager classes for launch options, user settings, and game settings; improved the initialization sequence and separated responsibilities for input, UI, and system updates. (src/main/java/com/github/codestorm/bounceverse/Bounceverse.java) [1] [2]src/main/java/com/github/codestorm/bounceverse/Bounceverse.java)Build and IDE Workflow Updates:
releasetask instead ofbuildRelease, ensuring consistency between local and CI builds. (.github/workflows/buildRelease.yml,.run/release.run.xml) [1] [2].run/build.run.xml) and removed outdated configurations and IDE project files for cleanup. (.run/build.run.xml,.run/bytecode.run.xml,.idea/misc.xml) [1] [2] [3]Utility Improvements:
Utilitiesclass for improved clarity and code style, including renaming annotation imports and variable declarations. (src/main/java/com/github/codestorm/bounceverse/Utilities.java)