Skip to content

Commit

Permalink
Cleaned assetNames
Browse files Browse the repository at this point in the history
  • Loading branch information
LBF38 committed Jan 3, 2023
1 parent fad7860 commit 23e72dd
Showing 1 changed file with 26 additions and 21 deletions.
47 changes: 26 additions & 21 deletions duelinvaders/src/main/java/org/enstabretagne/Utils/assetNames.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

/**
* Classe contenant les noms des assets du jeu
* Cela permet d'éviter les risques de fautes de frappe et centralise l'ensemble des noms d'assets du jeu
* Cela permet d'éviter les risques de fautes de frappe et centralise l'ensemble
* des noms d'assets du jeu
*
* @author LBF38, MathieuDFS, jufch
* @since 0.2.0
Expand All @@ -22,18 +23,20 @@ public static class textures {
public static final String BACKGROUND = "background.png";
public static final String EXPLOSION_PLAYER = "explosion_player.png";
public static final String EXPLOSION_FINAL = "explosion_final.png";
public static final ArrayList<String> EXPLOSIONS = new ArrayList<String>();
static {
for (int i = 1; i <= Constant.NUMBER_OF_EXPLOSIONS; i++) {
EXPLOSIONS.add("explosion" + i + ".png");
public static final ArrayList<String> EXPLOSIONS = new ArrayList<String>() {
{
for (int i = 1; i <= Constant.NUMBER_OF_EXPLOSIONS; i++) {
add("explosion" + i + ".png");
}
}
}
public static final ArrayList<String> LIFES = new ArrayList<String>();
static {
for (int i = 1; i <= 3; i++) {
LIFES.add("life" + i + ".png");
};
public static final ArrayList<String> LIFES = new ArrayList<String>() {
{
for (int i = 1; i <= 3; i++) {
add("life" + i + ".png");
}
}
}
};
public static final String FIRE = "fire.png";
public static final String SMOKE = "smoke.png";
}
Expand All @@ -54,18 +57,20 @@ public static class sounds {
public static final String START_CLAIRON = "autre/claironStart.wav";
public static final String DEFEAT_CLAIRON = "autre/claironDefeat.wav";
public static final String VICTORY_CLAIRON = "autre/claironVictory.wav";
public static final ArrayList<String> AMBIENT_SOUNDS = new ArrayList<String>();
static {
for (int i = 1; i < Constant.NUMBER_OF_AMBIENT_SOUND + 1; i++) {
AMBIENT_SOUNDS.add("ambiance/ambientSound" + i + ".wav");
public static final ArrayList<String> AMBIENT_SOUNDS = new ArrayList<String>() {
{
for (int i = 1; i < Constant.NUMBER_OF_AMBIENT_SOUND + 1; i++) {
add("ambiance/ambientSound" + i + ".wav");
}
}
}
};
public static final String CANNON_SHOT = "Tir/canon.wav";
public static final ArrayList<String> LASER_SOUNDS = new ArrayList<>();
static {
for (int i = 1; i <= Constant.NUMBER_OF_LASER_SOUNDS; i++) {
LASER_SOUNDS.add("Tir/laser" + i + ".wav");
public static final ArrayList<String> LASER_SOUNDS = new ArrayList<>() {
{
for (int i = 1; i <= Constant.NUMBER_OF_LASER_SOUNDS; i++) {
add("Tir/laser" + i + ".wav");
}
}
}
};
}
}

0 comments on commit 23e72dd

Please sign in to comment.