Added and integrated new sounds.
Added standardPort to be default value of port field.
This commit is contained in:
parent
4dd1c9b39b
commit
cb9b110621
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
|
||||
* @author Luca Conte
|
||||
* @author Luca Conte, Joshua Kuklok
|
||||
*/
|
||||
public void refresh() {
|
||||
if (this.p1.myTurn) {
|
||||
if (!kontextText.getText().equals(kT5)) {
|
||||
this.kontextText.setText(kT5);
|
||||
SoundHandler.playSound("yourturn");
|
||||
}
|
||||
} else {
|
||||
this.kontextText.setText(kT6);
|
||||
}
|
||||
|
|
|
@ -12,6 +12,9 @@ import java.net.InetSocketAddress;
|
|||
*/
|
||||
public class JoinGame extends JPanel {
|
||||
|
||||
// Funktionshilfen
|
||||
String standardPort = "1234";
|
||||
|
||||
// Grafiken
|
||||
ImageIcon backButtonIcon = new ImageIcon("graphics/backButton.png");
|
||||
|
||||
|
@ -71,6 +74,7 @@ public class JoinGame extends JPanel {
|
|||
}
|
||||
|
||||
portTextField.setBounds(50, 225, 250, 50);
|
||||
portTextField.setText(standardPort);
|
||||
|
||||
spielBeitretenLabel.setFont(robotoFont.deriveFont(50f));
|
||||
|
||||
|
@ -100,6 +104,7 @@ public class JoinGame extends JPanel {
|
|||
if (ipAddress.isEmpty()) {
|
||||
ipAddress = "0.0.0.0";
|
||||
}
|
||||
System.out.println(portTextField.getText());
|
||||
String portText = portTextField.getText();
|
||||
|
||||
int port = Integer.parseInt(portText);
|
||||
|
|
|
@ -25,13 +25,16 @@ public class LoseScreen extends JPanel {
|
|||
/**
|
||||
* Panel bauen/Objekte hinzufügen
|
||||
* @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) {
|
||||
add(loseLabel);
|
||||
okButton.setBounds(650,525,200,50);
|
||||
okButton.setBounds(625,525,200,50);
|
||||
loseLabel.setBounds(550,450,500,50);
|
||||
loseLabel.setFont(robotoFont);
|
||||
SoundHandler.playSound("loose");
|
||||
|
||||
// Zurückkehren zum Hauptmenü, wenn okButton gedrückt wird
|
||||
okButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
|
|
@ -25,7 +25,9 @@ public class SoundHandler {
|
|||
"hit", "./Sound/hit.mp3",
|
||||
"destroyed", "./Sound/hit.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
|
||||
* @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) {
|
||||
Timer timer = new Timer(5, new ActionListener() {
|
||||
|
@ -50,6 +50,8 @@ public class WinScreen extends JPanel {
|
|||
timer.start(); // Timer starten
|
||||
winLabel.setFont(robotoFont);
|
||||
winLabel.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
SoundHandler.playSound("win");
|
||||
|
||||
// Zurückkehren zum Hauptmenü, wenn okButton gedrückt wird
|
||||
okButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
|
|
|
@ -83,7 +83,7 @@ public class startLocalGame extends JPanel {
|
|||
rightPlayerIcon.setBounds(1225, 400, 200, 128);
|
||||
add(rightPlayerIcon);
|
||||
|
||||
semesterCounterLabel.setBounds(725, 475, 50, 50);
|
||||
semesterCounterLabel.setBounds(705, 475, 50, 50);
|
||||
semesterCounterLabel.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
add(semesterCounterLabel);
|
||||
|
||||
|
@ -96,10 +96,10 @@ public class startLocalGame extends JPanel {
|
|||
leftPlayerRightButton.setBounds(250, 450, 50, 50);
|
||||
add(leftPlayerRightButton);
|
||||
|
||||
semesterUpButton.setBounds(725, 400, 50, 50);
|
||||
semesterUpButton.setBounds(705, 400, 50, 50);
|
||||
add(semesterUpButton);
|
||||
|
||||
semesterDownButton.setBounds(725, 550, 50, 50);
|
||||
semesterDownButton.setBounds(705, 550, 50, 50);
|
||||
add(semesterDownButton);
|
||||
|
||||
rightPlayerLeftButton.setBounds(1200, 450, 50, 50);
|
||||
|
|
|
@ -68,7 +68,7 @@ public class startMultiplayerGame extends JPanel {
|
|||
PlayerIcon.setBounds(75, 400, 200, 128);
|
||||
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);
|
||||
add(semesterCounterLabel);
|
||||
|
||||
|
@ -81,10 +81,10 @@ public class startMultiplayerGame extends JPanel {
|
|||
PlayerRightButton.setBounds(250, 450, 50, 50);
|
||||
add(PlayerRightButton);
|
||||
|
||||
semesterUpButton.setBounds(725, 400, 50, 50);
|
||||
semesterUpButton.setBounds(705, 400, 50, 50);
|
||||
add(semesterUpButton);
|
||||
|
||||
semesterDownButton.setBounds(725, 550, 50, 50);
|
||||
semesterDownButton.setBounds(705, 550, 50, 50);
|
||||
add(semesterDownButton);
|
||||
|
||||
joinGameButton.setBounds(1100, 350, 200, 50);
|
||||
|
|
Loading…
Reference in New Issue