wip-fix-ai-players #25
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -205,11 +205,14 @@ public class GameBoard extends JPanel {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Aktualisiert Zustand(kontextText) je nach Zug
|
* Aktualisiert Zustand(kontextText) je nach Zug
|
||||||
* @author Luca Conte
|
* @author Luca Conte, Joshua Kuklok
|
||||||
*/
|
*/
|
||||||
public void refresh() {
|
public void refresh() {
|
||||||
if (this.p1.myTurn) {
|
if (this.p1.myTurn) {
|
||||||
|
if (!kontextText.getText().equals(kT5)) {
|
||||||
this.kontextText.setText(kT5);
|
this.kontextText.setText(kT5);
|
||||||
|
SoundHandler.playSound("yourturn");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.kontextText.setText(kT6);
|
this.kontextText.setText(kT6);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,9 @@ import java.net.InetSocketAddress;
|
||||||
*/
|
*/
|
||||||
public class JoinGame extends JPanel {
|
public class JoinGame extends JPanel {
|
||||||
|
|
||||||
|
// Funktionshilfen
|
||||||
|
String standardPort = "1234";
|
||||||
|
|
||||||
// Grafiken
|
// Grafiken
|
||||||
ImageIcon backButtonIcon = new ImageIcon("graphics/backButton.png");
|
ImageIcon backButtonIcon = new ImageIcon("graphics/backButton.png");
|
||||||
|
|
||||||
|
@ -71,6 +74,7 @@ public class JoinGame extends JPanel {
|
||||||
}
|
}
|
||||||
|
|
||||||
portTextField.setBounds(50, 225, 250, 50);
|
portTextField.setBounds(50, 225, 250, 50);
|
||||||
|
portTextField.setText(standardPort);
|
||||||
|
|
||||||
spielBeitretenLabel.setFont(robotoFont.deriveFont(50f));
|
spielBeitretenLabel.setFont(robotoFont.deriveFont(50f));
|
||||||
|
|
||||||
|
@ -100,6 +104,7 @@ public class JoinGame extends JPanel {
|
||||||
if (ipAddress.isEmpty()) {
|
if (ipAddress.isEmpty()) {
|
||||||
ipAddress = "0.0.0.0";
|
ipAddress = "0.0.0.0";
|
||||||
}
|
}
|
||||||
|
System.out.println(portTextField.getText());
|
||||||
String portText = portTextField.getText();
|
String portText = portTextField.getText();
|
||||||
|
|
||||||
int port = Integer.parseInt(portText);
|
int port = Integer.parseInt(portText);
|
||||||
|
|
|
@ -25,13 +25,16 @@ public class LoseScreen extends JPanel {
|
||||||
/**
|
/**
|
||||||
* Panel bauen/Objekte hinzufügen
|
* Panel bauen/Objekte hinzufügen
|
||||||
* @param frame Der Mainframe der Anwendung über den alle Panels angezeigt werden.
|
* @param frame Der Mainframe der Anwendung über den alle Panels angezeigt werden.
|
||||||
* @author Lucas Bronson
|
* @author Lucas Bronson, Joshua Kuklok
|
||||||
*/
|
*/
|
||||||
public void buildPanel(MainFrame frame) {
|
public void buildPanel(MainFrame frame) {
|
||||||
add(loseLabel);
|
add(loseLabel);
|
||||||
okButton.setBounds(650,525,200,50);
|
okButton.setBounds(625,525,200,50);
|
||||||
loseLabel.setBounds(550,450,500,50);
|
loseLabel.setBounds(550,450,500,50);
|
||||||
loseLabel.setFont(robotoFont);
|
loseLabel.setFont(robotoFont);
|
||||||
|
SoundHandler.playSound("loose");
|
||||||
|
|
||||||
|
// Zurückkehren zum Hauptmenü, wenn okButton gedrückt wird
|
||||||
okButton.addActionListener(new ActionListener() {
|
okButton.addActionListener(new ActionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
|
|
@ -25,7 +25,9 @@ public class SoundHandler {
|
||||||
"hit", "./Sound/hit.mp3",
|
"hit", "./Sound/hit.mp3",
|
||||||
"destroyed", "./Sound/hit.mp3",
|
"destroyed", "./Sound/hit.mp3",
|
||||||
"plop", "./Sound/plop.mp3",
|
"plop", "./Sound/plop.mp3",
|
||||||
"loose", "./Sound/loosescreenWAH.mp3"
|
"loose", "./Sound/loosescreenlaugh.mp3",
|
||||||
|
"win", "./Sound/win.mp3",
|
||||||
|
"yourturn", "./Sound/yourturn.mp3"
|
||||||
));
|
));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -26,7 +26,7 @@ public class WinScreen extends JPanel {
|
||||||
/**
|
/**
|
||||||
* Panel bauen/Objekte hinzufuegen
|
* Panel bauen/Objekte hinzufuegen
|
||||||
* @param frame Der Mainframe der Anwendung über den alle Panels angezeigt werden.
|
* @param frame Der Mainframe der Anwendung über den alle Panels angezeigt werden.
|
||||||
* @author Lucas Bronson
|
* @author Lucas Bronson, Joshua Kuklok
|
||||||
*/
|
*/
|
||||||
public void buildPanel(MainFrame frame) {
|
public void buildPanel(MainFrame frame) {
|
||||||
Timer timer = new Timer(5, new ActionListener() {
|
Timer timer = new Timer(5, new ActionListener() {
|
||||||
|
@ -50,6 +50,8 @@ public class WinScreen extends JPanel {
|
||||||
timer.start(); // Timer starten
|
timer.start(); // Timer starten
|
||||||
winLabel.setFont(robotoFont);
|
winLabel.setFont(robotoFont);
|
||||||
winLabel.setHorizontalAlignment(SwingConstants.CENTER);
|
winLabel.setHorizontalAlignment(SwingConstants.CENTER);
|
||||||
|
SoundHandler.playSound("win");
|
||||||
|
|
||||||
// Zurückkehren zum Hauptmenü, wenn okButton gedrückt wird
|
// Zurückkehren zum Hauptmenü, wenn okButton gedrückt wird
|
||||||
okButton.addActionListener(new ActionListener() {
|
okButton.addActionListener(new ActionListener() {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -83,7 +83,7 @@ public class startLocalGame extends JPanel {
|
||||||
rightPlayerIcon.setBounds(1225, 400, 200, 128);
|
rightPlayerIcon.setBounds(1225, 400, 200, 128);
|
||||||
add(rightPlayerIcon);
|
add(rightPlayerIcon);
|
||||||
|
|
||||||
semesterCounterLabel.setBounds(725, 475, 50, 50);
|
semesterCounterLabel.setBounds(705, 475, 50, 50);
|
||||||
semesterCounterLabel.setHorizontalAlignment(SwingConstants.CENTER);
|
semesterCounterLabel.setHorizontalAlignment(SwingConstants.CENTER);
|
||||||
add(semesterCounterLabel);
|
add(semesterCounterLabel);
|
||||||
|
|
||||||
|
@ -96,10 +96,10 @@ public class startLocalGame extends JPanel {
|
||||||
leftPlayerRightButton.setBounds(250, 450, 50, 50);
|
leftPlayerRightButton.setBounds(250, 450, 50, 50);
|
||||||
add(leftPlayerRightButton);
|
add(leftPlayerRightButton);
|
||||||
|
|
||||||
semesterUpButton.setBounds(725, 400, 50, 50);
|
semesterUpButton.setBounds(705, 400, 50, 50);
|
||||||
add(semesterUpButton);
|
add(semesterUpButton);
|
||||||
|
|
||||||
semesterDownButton.setBounds(725, 550, 50, 50);
|
semesterDownButton.setBounds(705, 550, 50, 50);
|
||||||
add(semesterDownButton);
|
add(semesterDownButton);
|
||||||
|
|
||||||
rightPlayerLeftButton.setBounds(1200, 450, 50, 50);
|
rightPlayerLeftButton.setBounds(1200, 450, 50, 50);
|
||||||
|
|
|
@ -68,7 +68,7 @@ public class startMultiplayerGame extends JPanel {
|
||||||
PlayerIcon.setBounds(75, 400, 200, 128);
|
PlayerIcon.setBounds(75, 400, 200, 128);
|
||||||
add(PlayerIcon);
|
add(PlayerIcon);
|
||||||
|
|
||||||
semesterCounterLabel.setBounds(725, 475, 50, 50); // zwischen den Up/Down-Buttons
|
semesterCounterLabel.setBounds(705, 475, 50, 50); // zwischen den Up/Down-Buttons
|
||||||
semesterCounterLabel.setHorizontalAlignment(SwingConstants.CENTER);
|
semesterCounterLabel.setHorizontalAlignment(SwingConstants.CENTER);
|
||||||
add(semesterCounterLabel);
|
add(semesterCounterLabel);
|
||||||
|
|
||||||
|
@ -81,10 +81,10 @@ public class startMultiplayerGame extends JPanel {
|
||||||
PlayerRightButton.setBounds(250, 450, 50, 50);
|
PlayerRightButton.setBounds(250, 450, 50, 50);
|
||||||
add(PlayerRightButton);
|
add(PlayerRightButton);
|
||||||
|
|
||||||
semesterUpButton.setBounds(725, 400, 50, 50);
|
semesterUpButton.setBounds(705, 400, 50, 50);
|
||||||
add(semesterUpButton);
|
add(semesterUpButton);
|
||||||
|
|
||||||
semesterDownButton.setBounds(725, 550, 50, 50);
|
semesterDownButton.setBounds(705, 550, 50, 50);
|
||||||
add(semesterDownButton);
|
add(semesterDownButton);
|
||||||
|
|
||||||
joinGameButton.setBounds(1100, 350, 200, 50);
|
joinGameButton.setBounds(1100, 350, 200, 50);
|
||||||
|
|
Loading…
Reference in New Issue