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