Nantes Université

Skip to content
Extraits de code Groupes Projets
Valider ae43b650 rédigé par siuboy's avatar siuboy
Parcourir les fichiers

CHanging logo , removing gif and adding royalty-free info

parent 448130cf
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -11,9 +11,8 @@
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
<option name="workspaceImportForciblyTurnedOn" value="true" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="21" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="21" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
\ No newline at end of file
......@@ -55,8 +55,8 @@ public class ViewManager
private String playerShip = "playerGreenShip.png";
private String playerName;
private final String mainFont = "file:src/main/resources/fonts/ThaleahFat.ttf";
private final int highScore = readingIntValuesFromFiles(highScoreFile);
private final Image icon = new Image("player.png");
private final Image loadingImage = new Image("load.gif");
private final Image redShipImg = new Image("playerRedShip.png");
private final Image blueShipImg = new Image("playerBlueShip.png");
private final Image greenShipImg = new Image("playerGreenShip.png");
......@@ -65,6 +65,7 @@ public class ViewManager
private final Image pauseImg = new Image("pause.png");
private final Image startImg = new Image("start.png");
private final Image shipText = new Image("shipText.png");
private final Image bullet = new Image("bulletRed.png");
private Rectangle selectedShip;
private boolean isRunning = true;
public static boolean isPaused = false;
......@@ -139,7 +140,7 @@ public class ViewManager
* @return The string value read from the file, or "NO HIGH SCORER" if the file is empty, or
* "ERROR READING VALUE FROM FILE" if an error occurs during reading.
*/
public String readingStringValuesFromFiles(String filePath) {
public String radingHighScoreOwnerFromFile(String filePath) {
try (BufferedReader bufferedReader = new BufferedReader(new FileReader(filePath))) {
String line = bufferedReader.readLine();
return (line != null) ? line : "NO HIGH SCORRER";
......@@ -535,7 +536,6 @@ public class ViewManager
*/
private void highScore()
{
int highScore = readingIntValuesFromFiles(highScoreFile);
if (Global.score > highScore)
{
......@@ -760,16 +760,16 @@ public class ViewManager
Text company = new Text();
setTextAttributs(company,"SKULULU GAMES",83,200,Color.WHITE,companyFont,35);
ImageView loadEffect = new ImageView();
setImageViewAttributs(loadEffect,loadingImage,220,500);
Text copyright = new Text();
setTextAttributs(copyright,"ALL IMAGES USED IN THIS PROJECT ARE ROYALTY-FREE",menuWidth/2 - 220,780,Color.WHITE,mainFont,20);
root.getChildren().addAll(company,copyright);
root.getChildren().addAll(company,loadEffect);
this.mainStage.setScene(loadingScene);
this.mainStage.setResizable(false);
this.mainStage.show();
}
/**
* Initializes and displays the start game scene, including loading visuals and user interaction elements.
*/
......@@ -781,7 +781,7 @@ public class ViewManager
// Load the image asynchronously
KeyFrame menuFrame = new KeyFrame(Duration.millis(10),actionEvent -> {
KeyFrame menuFrame = new KeyFrame(Duration.millis(1000),actionEvent -> {
try {
menuBackground = new ImageView(menuBack);
......@@ -791,21 +791,34 @@ public class ViewManager
Global.log.write("Error loading Menu Background's image: " + e.getMessage());
}
try {
Image gameLogo = new Image("logo.png");
ImageView logo = new ImageView(gameLogo);
logo.setX(260);
this.root.getChildren().add(logo);
} catch (Exception e) {
System.out.println("Error loading Menu Logo's image: " + e.getMessage());
Global.log.write("Error loading Menu Logo's image: " + e.getMessage());
}
// game logo
Text logoPart1 = new Text();
setTextAttributs(logoPart1,"GALACTIC",255,50,Color.WHITE,mainFont,75);
Text logoPart2 = new Text();
setTextAttributs(logoPart2,"SHOOTER",261,90,Color.WHITE,mainFont,75);
ImageView playerLogo = new ImageView();
setImageViewAttributs(playerLogo,icon,250,136);
playerLogo.setRotate(90);
ImageView bulletLogo = new ImageView();
setImageViewAttributs(bulletLogo,bullet,375,136,39,41);
bulletLogo.setRotate(90);
ImageView gunnerLogo = new ImageView();
setImageViewAttributs(gunnerLogo,gunnerImg,500,136,39,41);
gunnerLogo.setRotate(270);
this.root.getChildren().addAll(logoPart1,logoPart2,playerLogo,bulletLogo,gunnerLogo);
Global.money = readingIntValuesFromFiles(moneyFIle);
Text highScorrer = new Text();
setTextAttributs(highScorrer,"HIGH SCORE OWNER : "+readingStringValuesFromFiles(highScorePlayerFile),menuWidth/2 - 230,menuHeight/2 - 70,Color.WHITE,mainFont,26);
setTextAttributs(highScorrer,"HIGH SCORE OWNER ",menuWidth/2 - 190,menuHeight/2 - 140,Color.WHITE,mainFont,50);
Text highScorrerPlayerName = new Text();
setTextAttributs(highScorrerPlayerName, radingHighScoreOwnerFromFile(highScorePlayerFile)+" : "+readingIntValuesFromFiles(highScoreFile),menuWidth/2-230,highScorrer.getY()+40,Color.WHITE,mainFont,30);
Text namePlaceHolder = new Text();
setTextAttributs(namePlaceHolder,"ENTER YOUR NAME",menuWidth/2 - 143,menuWidth/2 - 20,Color.WHITE,mainFont,40);
......@@ -826,7 +839,7 @@ public class ViewManager
}
});
if (!isNameSaved.get()){playerName = "GUEST";}
root.getChildren().addAll(highScorrer,enterPlayerName,namePlaceHolder);
root.getChildren().addAll(highScorrer,enterPlayerName,namePlaceHolder,highScorrerPlayerName);
displayOwnedMoney();
mainMenu();
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter