Compare commits
7 Commits
Author | SHA1 | Date |
---|---|---|
|
06cc025fda | |
|
6b0aa04b25 | |
|
c2700c1574 | |
|
8e6b6c147e | |
|
c88991e5a1 | |
|
2cb7ee7ee1 | |
|
1f4d7ef4b1 |
|
@ -4,6 +4,7 @@ import java.awt.event.ActionEvent;
|
|||
import java.awt.event.ActionListener;
|
||||
import java.io.IOException;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Das JoinGame Panel dient zum setzten des Ports/IP-Adresse.
|
||||
|
@ -16,7 +17,7 @@ public class JoinGame extends JPanel {
|
|||
String standardPort = "51525";
|
||||
|
||||
// Grafiken
|
||||
ImageIcon backButtonIcon = new ImageIcon("graphics/backButton.png");
|
||||
ImageIcon backButtonIcon = new ImageIcon(Objects.requireNonNull(getClass().getClassLoader().getResource("backButton.png")));
|
||||
|
||||
// Labels
|
||||
JLabel spielBeitretenLabel;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.util.Objects;
|
||||
import javax.swing.*;
|
||||
|
||||
/**
|
||||
|
@ -16,8 +17,8 @@ public class MainMenuView extends JPanel {
|
|||
private JButton soundButton;
|
||||
|
||||
Font robotoFont = new Font("Roboto", Font.BOLD, 45);
|
||||
private ImageIcon soundIcon = new ImageIcon("graphics/sound button.png");
|
||||
private ImageIcon muteIcon = new ImageIcon("graphics/sound button muted.png");
|
||||
private ImageIcon soundIcon = new ImageIcon(Objects.requireNonNull(getClass().getClassLoader().getResource("sound button.png")));
|
||||
private ImageIcon muteIcon = new ImageIcon(Objects.requireNonNull(getClass().getClassLoader().getResource("sound button muted.png")));
|
||||
|
||||
/**
|
||||
* Konstruktor der MainMenuView Klasse
|
||||
|
|
|
@ -4,10 +4,7 @@ import javazoom.jl.player.Player;
|
|||
import java.awt.List;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* Der SoundHandler dient zum Anlegen und Abspielen von Sounds
|
||||
|
@ -21,13 +18,13 @@ public class SoundHandler {
|
|||
|
||||
// Wenn fehler beim erstellen von .jar mit sound hier gucken
|
||||
private static HashMap<String, String> sounds = new HashMap<String, String>(Map.of(
|
||||
"miss", "./Sound/water-drip.mp3",
|
||||
"hit", "./Sound/hit.mp3",
|
||||
"destroyed", "./Sound/hit.mp3",
|
||||
"plop", "./Sound/plop.mp3",
|
||||
"loose", "./Sound/loosescreenlaugh.mp3",
|
||||
"win", "./Sound/win.mp3",
|
||||
"yourturn", "./Sound/yourturn.mp3"
|
||||
"miss", "water-drip.mp3",
|
||||
"hit", "hit.mp3",
|
||||
"destroyed", "hit.mp3",
|
||||
"plop", "plop.mp3",
|
||||
"loose", "loosescreenlaugh.mp3",
|
||||
"win", "win.mp3",
|
||||
"yourturn", "yourturn.mp3"
|
||||
));
|
||||
|
||||
/**
|
||||
|
@ -41,9 +38,9 @@ public class SoundHandler {
|
|||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
Player player = new Player(new FileInputStream(sounds.get(soundName)));
|
||||
Player player = new Player(Objects.requireNonNull(getClass().getClassLoader().getResourceAsStream(sounds.get(soundName))));
|
||||
player.play();
|
||||
} catch (JavaLayerException | FileNotFoundException e) {
|
||||
} catch (JavaLayerException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ import java.awt.*;
|
|||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.util.HashMap;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Das startLocalGame Panel dient dem Erstellen eines lokalen Spiels.
|
||||
|
@ -17,11 +18,11 @@ public class startLocalGame extends JPanel {
|
|||
String rightPlayerNickname = "Einfach";
|
||||
|
||||
// Grafiken
|
||||
ImageIcon backButtonIcon = new ImageIcon("graphics/backButton.png");
|
||||
ImageIcon humanPlayerIcon = new ImageIcon("graphics/humanPlayer.png");
|
||||
ImageIcon aiPlayerEasyIcon = new ImageIcon("graphics/botPlayerEasy.png");
|
||||
ImageIcon aiPlayerNormalIcon = new ImageIcon("graphics/botPlayerNormal.png");
|
||||
ImageIcon aiPlayerHardIcon = new ImageIcon("graphics/botPlayerHard.png");
|
||||
ImageIcon backButtonIcon = new ImageIcon(Objects.requireNonNull(getClass().getClassLoader().getResource("backButton.png")));
|
||||
ImageIcon humanPlayerIcon = new ImageIcon(Objects.requireNonNull(getClass().getClassLoader().getResource("humanplayer.png")));
|
||||
ImageIcon aiPlayerEasyIcon = new ImageIcon(Objects.requireNonNull(getClass().getClassLoader().getResource("botPlayerEasy.png")));
|
||||
ImageIcon aiPlayerNormalIcon = new ImageIcon(Objects.requireNonNull(getClass().getClassLoader().getResource("botPlayerNormal.png")));
|
||||
ImageIcon aiPlayerHardIcon = new ImageIcon(Objects.requireNonNull(getClass().getClassLoader().getResource("botPlayerHard.png")));
|
||||
|
||||
// Labels
|
||||
JLabel frameTitle = new JLabel("Lokales Spiel");
|
||||
|
|
|
@ -2,6 +2,7 @@ import javax.swing.*;
|
|||
import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Das startMultiplayerGame Panel dient dem Erstellen eines Online Spiels.
|
||||
|
@ -15,11 +16,11 @@ public class startMultiplayerGame extends JPanel {
|
|||
String PlayerNickname = "Spieler 1";
|
||||
|
||||
// Grafiken
|
||||
ImageIcon backButtonIcon = new ImageIcon("graphics/backButton.png");
|
||||
ImageIcon humanPlayerIcon = new ImageIcon("graphics/humanPlayer.png");
|
||||
ImageIcon aiPlayerEasyIcon = new ImageIcon("graphics/botPlayerEasy.png");
|
||||
ImageIcon aiPlayerNormalIcon = new ImageIcon("graphics/botPlayerNormal.png");
|
||||
ImageIcon aiPlayerHardIcon = new ImageIcon("graphics/botPlayerHard.png");
|
||||
ImageIcon backButtonIcon = new ImageIcon(Objects.requireNonNull(getClass().getClassLoader().getResource("backButton.png")));
|
||||
ImageIcon humanPlayerIcon = new ImageIcon(Objects.requireNonNull(getClass().getClassLoader().getResource("humanplayer.png")));
|
||||
ImageIcon aiPlayerEasyIcon = new ImageIcon(Objects.requireNonNull(getClass().getClassLoader().getResource("botPlayerEasy.png")));
|
||||
ImageIcon aiPlayerNormalIcon = new ImageIcon(Objects.requireNonNull(getClass().getClassLoader().getResource("botPlayerNormal.png")));
|
||||
ImageIcon aiPlayerHardIcon = new ImageIcon(Objects.requireNonNull(getClass().getClassLoader().getResource("botPlayerHard.png")));
|
||||
|
||||
// Labels
|
||||
JLabel frameTitle = new JLabel("Multiplayer Spiel");
|
||||
|
|
Loading…
Reference in New Issue