This commit is contained in:
Romain MURPHY 2025-05-08 14:06:24 +02:00
parent ab467ea11e
commit 66d32fe2eb
13 changed files with 9 additions and 42 deletions

View File

@ -1,9 +0,0 @@
BR, , ,BK, ,BR, ,
BP,WP,BP, , ,BP,BP,BP
, , , ,WP, , ,
, , , , , , ,
, , , , , , ,
, , , , , , ,
WP,WP,WP, , ,WP,WP,WP
WR,WN,WB,WQ,WK,WB,WN,WR
3W

View File

@ -1,9 +0,0 @@
BR,BN,BB,BQ,BK,BB,BN,BR
,BP,BP,BP,BP,BP,BP,BP
, , , , , , ,
BP, , ,WP, , , ,
, , , , , , ,
, , , , , , ,
WP,WP,WP, ,WP,WP,WP,WP
WR,WN,WB,WQ,WK,WB,WN,WR
4B

View File

@ -1,9 +0,0 @@
, ,BB,BQ,BK, , ,BR
BP,WP,BP,BP, ,BP,BP,BP
, ,BN,BB, ,BP, ,
, , , , , , ,
, , , , , , ,
, , , , , , ,
, , , , , , ,
, , ,WK, , , ,
3W

Binary file not shown.

Binary file not shown.

View File

@ -1,9 +0,0 @@
BR,BN,BB,BQ,BK,BB,BN,BR
BP,BP,BP,BP,BP,BP,BP,BP
, , , , , , ,
, , , , , , ,
, , , , , , ,
, , , , , , ,
WP,WP,WP,WP,WP,WP,WP,WP
WR,WN,WB,WQ,WK,WB,WN,WR
0W

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 954 B

View File

@ -16,6 +16,7 @@ public class Main {
// launches graphical interface :
MyInterface mjf = new MyInterface();
mjf.introduction();
mjf.setVisible(true);
}

View File

@ -11,7 +11,7 @@ public class Game extends Thread {
private int LINE_NUM = 8;
private int loopDelay = 250;
boolean[] activationAIFlags;
SoundEffect soundEffect = new SoundEffect();
public Game(MyInterface mjfParam) {
mjf = mjfParam;
board = new Board(COL_NUM, LINE_NUM);
@ -120,6 +120,9 @@ public class Game extends Thread {
public void toggleAI(boolean isWhite) {
// System.out.println(isWhite);
this.activationAIFlags[isWhite?1:0] = !this.activationAIFlags[isWhite?1:0];
if (this.activationAIFlags[isWhite?1:0]) {
soundEffect.aiSound();
}
}
public void setTurnNumber(int turnNumber) {

View File

@ -7,7 +7,7 @@ public class SoundEffect {
public void captureSound() {
try {
File file = new File("capture.wav");
File file = new File("sounds/capture.wav");
AudioInputStream audioStream = AudioSystem.getAudioInputStream(file);
Clip clip = AudioSystem.getClip();
clip.open(audioStream);
@ -19,7 +19,7 @@ public class SoundEffect {
public void movingSound() {
try {
File file = new File("move-self.wav");
File file = new File("sounds/move-self.wav");
AudioInputStream audioStream = AudioSystem.getAudioInputStream(file);
Clip clip = AudioSystem.getClip();
clip.open(audioStream);
@ -31,7 +31,7 @@ public class SoundEffect {
public void aiSound() {
try {
File file = new File("Voicy_R2-D2-7.wav");
File file = new File("sounds/Voicy_R2-D2-7.wav");
AudioInputStream audioStream = AudioSystem.getAudioInputStream(file);
Clip clip = AudioSystem.getClip();
clip.open(audioStream);

View File

@ -174,7 +174,6 @@ public class MyInterface extends JFrame {
public void clicButtonStart() {
this.instantiateSimu();
int introduction = introduction();
int depth = askDifficulty();
int time = askTime();
game.setAutoPlayerDepth(depth);
@ -345,7 +344,7 @@ public class MyInterface extends JFrame {
default: return 600; // 10 min
}
}
private int introduction() {
public int introduction() {
int boardWidth = 600;
int boardHeight = 600;