Refactor Game UI - #29
Closed
tasneem-hakeem wants to merge 5 commits into
Closed
Conversation
tasneem-hakeem
requested review from
Hazem-0,
MahmoudRafaat,
SherifAshraf2020 and
ZeiadT
January 13, 2026 17:57
There was a problem hiding this comment.
Pull request overview
This PR refactors the game UI by removing difficulty-related UI elements, updating player labels to use actual player names, and adding video playback for win/loss scenarios. The changes simplify the UI by removing the "Change Difficulty" button and associated labels while enhancing the game-over modal experience with animated videos.
Changes:
- Removed difficulty display and change difficulty button from the UI
- Updated game-over modal to display player names instead of generic labels
- Added video playback functionality for victory and defeat scenarios
- Made trophy container background transparent to better display videos
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/main/resources/fxml/game_screen.fxml | Removed difficulty label/icon and change difficulty button; updated trophy container to display videos |
| src/main/resources/css/features/game_screen.css | Changed trophy container styling to transparent background |
| src/main/resources/assets/videos/loser.mp4 | Added new defeat animation video (binary file) |
| src/main/java/com/boredxgames/tictactoeclient/presentation/GameController.java | Removed difficulty button references; updated labels to use player names; implemented video playback with looping |
Comments suppressed due to low confidence (2)
src/main/java/com/boredxgames/tictactoeclient/presentation/GameController.java:412
- The video player is not properly stopped or cleaned up when resetGame is called. This creates a resource leak where the video continues playing indefinitely even after the modal is closed and a new game starts. You should stop the media player in the resetGame method.
private void playVictoryVideo(String videoName) {
try {
String videoPath = Objects.requireNonNull(
getClass().getResource("/assets/videos/" + videoName + ".mp4")
).toExternalForm();
Media media = new Media(videoPath);
MediaPlayer player = new MediaPlayer(media);
victoryVideo.setMediaPlayer(player);
player.setCycleCount(MediaPlayer.INDEFINITE); // loop forever
player.play();
player.setAutoPlay(true);
victoryVideo.setPreserveRatio(true);
victoryVideo.setVisible(true);
/*victoryVideo.setVisible(true);
player.setAutoPlay(true);
player.setOnEndOfMedia(() -> {
victoryVideo.setVisible(false);
});*/
} catch (Exception e) {
System.out.println("Error getting the video: " + e);
}
}
src/main/java/com/boredxgames/tictactoeclient/presentation/GameController.java:411
- The error message is not helpful for debugging. Instead of printing a generic message to stdout, consider using a proper logging framework and include more specific information about what went wrong (e.g., which video file was not found, the full exception message).
} catch (Exception e) {
System.out.println("Error getting the video: " + e);
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ZeiadT
approved these changes
Jan 13, 2026
ZeiadT
approved these changes
Jan 14, 2026
Hazem-0
approved these changes
Jan 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.