-
Notifications
You must be signed in to change notification settings - Fork 0
@mhawryluk/rpg 82 points earned popup #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
kkafar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, good job 🍾 ! After the #6 is merged, we need to adapt these changes to use information provided by configuration files.
| Image someMap = new Image("file:assets/map.png"); | ||
| Image someMap10x10 = new Image("file:assets/map10x10.png"); | ||
| Image someDude1 = new Image("file:assets/someDude.png"); | ||
| Image someDude2 = new Image("file:assets/someDudeButGreen.png"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These paths should be loaded from configuration. I guess its fine for now and we can do this in separate PR after #6 is merged.
| public void onKeyTyped(KeyEvent event) { | ||
| // TODO: 01.04.2022 Implement key actions | ||
|
|
||
| System.out.println(event); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| new Thread(() -> { | ||
| try { | ||
| Thread.sleep(1000); | ||
| } catch (InterruptedException e) { | ||
| e.printStackTrace(); | ||
| } | ||
| Platform.runLater(() ->{ | ||
| displayLayer.showLocation() | ||
| .setBackgroundImage(someMap10x10) | ||
| .addMapObject(new GameObjectStandIn(new Pair<>(0,0), someDude1)) | ||
| .addMapObject(new GameObjectStandIn(new Pair<>(0,2), someDude1)) | ||
| .addMapObject(new GameObjectStandIn(new Pair<>(5,9), someDude2)); | ||
| }); | ||
| }).start(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can remove this
| locationController = LocationController.load(); | ||
| } | ||
|
|
||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| .clear(); | ||
| } | ||
|
|
||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| private PointsPopupController controller; | ||
| private final Scene popupScene; | ||
|
|
||
| public PointsEarnedPopup(){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| public PointsEarnedPopup(){ | |
| public PointsEarnedPopup() { |
| popupScene = new Scene(root, Color.TRANSPARENT); | ||
| } | ||
|
|
||
| public Stage getPopup(int pointsCount, Scene scene){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| public Stage getPopup(int pointsCount, Scene scene){ | |
| public Stage getPopup(int pointsCount, Scene scene) { |
| label.setText("Earned " + pointsCount + " points!"); | ||
| } | ||
|
|
||
| protected Pair<Double, Double> setBackgroundImage(String url){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| protected Pair<Double, Double> setBackgroundImage(String url){ | |
| protected Pair<Double, Double> setBackgroundImage(String url) { |
| background.setBackground(new Background(backgroundImg)); | ||
| return new Pair<>(background.getPrefWidth(), background.getPrefHeight()); | ||
| } | ||
| } No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| } | |
| } | |
| return position; | ||
| } | ||
|
|
||
| public Image getImage(){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| public Image getImage(){ | |
| public Image getImage() { |
…G-IO/rpg-io into @mhawryluk/RPG-82-points-earned-popup
* chore: Init gui * feat: now location is centered * feat: Add popup creation class for point earning * feat: Read popup layout from FXML and set pointCount via controller * refactor: Move popup classes into popups package * chore: Add background image and improve styling of points popup * fix: Add background image to assets * refactor: Add comments to popup class * refactor: Make showPopup method not static * refactor: Change position to be represented as a vector * add game class * moving player * measuring frame time duration * improved player control * modified player class * RPG-79 Model proposal & configuration loading (#6) * chore: Add dependency on Gson This library is required, as our configuration files will be based on json * chore: Add dependency on jetbrains.annotations * fix: Change package name in module-info.java * chore: Push out commit * feat: Extend class schema * refract: Rename DialogicGameObject -> DialogGameObject * feat: Add Position record * feat: Initial GameObject implementation * refract: Make GameWorld class final * feat: Add empty Location class * docs: Add docs dir & empty configuration description * chore: Add ConfigConstants class with static data members * refract: Resign from m prefix in private member var names * chore: Add dependency on log4j * fix: Fix module-info: export io.rpg * feat: Setup logging in application entry point * chore: Package structure * refract: Empty line at the end of build.gradle * feat: Initlial configuration structure * refract: Code cleanup * refract: Change ROOT file name to root.json * refract: Change String paths to java.nio classes * chore: Add logging to ConfigLoader * feat: Handle FNF config dir & root file * chore: Exclude bin directory from repo * feat: Update configuration structure * feat: LocationConfig * feat: GameWorldConfig * fix: Open io.rpg.model module to gson * TO REVERT: modify app entry class due to some issues with sdk * chore: Add mock top level class of application * feat: Initial ConfigLoader impl * feat: toString method for GameWorldConfig * feat: Log GameWorldConfig after deserialization * chore: Add mock game configuration for unit-testing * chore: Expose model classes to Gson * Fix: Adjustments to make Gson work * feat: ConfigLoader#loadLocation * test: Add initial tests for ConfigLoader * test: Add ConfigLoaderTest#LocationConfigIsLoadedProperly test * chore: Update MockTest * chore: Update configuration files * chore: Remove not-up-to-date test * chore: Improve ConfigLoader#load method * chore: Improve model classes * refract: Fix typos Co-authored-by: adam <adam.przywieczerski@gmail.com> * @co012/RPG-93 widac lokacje w okienku (#8) * chore: Init gui * feat: now location is centered * RPG-79 Model proposal & configuration loading (#6) * chore: Add dependency on Gson This library is required, as our configuration files will be based on json * chore: Add dependency on jetbrains.annotations * fix: Change package name in module-info.java * chore: Push out commit * feat: Extend class schema * refract: Rename DialogicGameObject -> DialogGameObject * feat: Add Position record * feat: Initial GameObject implementation * refract: Make GameWorld class final * feat: Add empty Location class * docs: Add docs dir & empty configuration description * chore: Add ConfigConstants class with static data members * refract: Resign from m prefix in private member var names * chore: Add dependency on log4j * fix: Fix module-info: export io.rpg * feat: Setup logging in application entry point * chore: Package structure * refract: Empty line at the end of build.gradle * feat: Initlial configuration structure * refract: Code cleanup * refract: Change ROOT file name to root.json * refract: Change String paths to java.nio classes * chore: Add logging to ConfigLoader * feat: Handle FNF config dir & root file * chore: Exclude bin directory from repo * feat: Update configuration structure * feat: LocationConfig * feat: GameWorldConfig * fix: Open io.rpg.model module to gson * TO REVERT: modify app entry class due to some issues with sdk * chore: Add mock top level class of application * feat: Initial ConfigLoader impl * feat: toString method for GameWorldConfig * feat: Log GameWorldConfig after deserialization * chore: Add mock game configuration for unit-testing * chore: Expose model classes to Gson * Fix: Adjustments to make Gson work * feat: ConfigLoader#loadLocation * test: Add initial tests for ConfigLoader * test: Add ConfigLoaderTest#LocationConfigIsLoadedProperly test * chore: Update MockTest * chore: Update configuration files * chore: Remove not-up-to-date test * chore: Improve ConfigLoader#load method * chore: Improve model classes * refract: Fix typos Co-authored-by: adam <adam.przywieczerski@gmail.com> Co-authored-by: Kacper Kafara <kacperkafara@gmail.com> Co-authored-by: adam <adam.przywieczerski@gmail.com> * @mhawryluk/rpg 82 points earned popup (#9) * chore: Init gui * feat: now location is centered * feat: Add popup creation class for point earning * feat: Read popup layout from FXML and set pointCount via controller * refactor: Move popup classes into popups package * chore: Add background image and improve styling of points popup * fix: Add background image to assets * refactor: Add comments to popup class * refactor: Make showPopup method not static * refactor: Turn showPopup into getPopup, make it return Stage * test: Add test for hiding a popup when no focus * fix: Quick fix * fix: Remove tests for now * fix: module-info Co-authored-by: co012 <co123@interia.eu> Co-authored-by: Kacper Kafara <kacperkafara@gmail.com> Co-authored-by: co012 <co123@interia.eu> Co-authored-by: mhawryluk <marcinhawrylukxx@gmail.com> Co-authored-by: Kacper Kafara <kacperkafara@gmail.com> Co-authored-by: adam <adam.przywieczerski@gmail.com> Co-authored-by: Marcin Hawryluk <70582973+mhawryluk@users.noreply.github.com>
Description
Create and show a popup when earning points.
Checklist