mirror of
https://github.com/jokerx3/HeatUp
synced 2026-07-27 09:59:45 +02:00
Keybindings angepasst.
This commit is contained in:
@@ -1,12 +1,9 @@
|
|||||||
package de.heatup.objects;
|
package de.heatup.objects;
|
||||||
|
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import javax.imageio.ImageIO;
|
import javax.imageio.ImageIO;
|
||||||
|
|
||||||
import de.heatup.cfg.Config;
|
import de.heatup.cfg.Config;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ public class Main extends JFrame implements Runnable {
|
|||||||
private static JPanel outerPanel;
|
private static JPanel outerPanel;
|
||||||
private static JPanel statusPanel;
|
private static JPanel statusPanel;
|
||||||
private static JPanel gamePanel;
|
private static JPanel gamePanel;
|
||||||
|
private static JPanel menuPanel;
|
||||||
private static JPanel leftPanel;
|
private static JPanel leftPanel;
|
||||||
private static JPanel rightPanel;
|
private static JPanel rightPanel;
|
||||||
private static JPanel actionPanel;
|
private static JPanel actionPanel;
|
||||||
@@ -66,22 +67,29 @@ public class Main extends JFrame implements Runnable {
|
|||||||
|
|
||||||
outerPanel = new JPanel();
|
outerPanel = new JPanel();
|
||||||
outerPanel.setLayout(new BorderLayout());
|
outerPanel.setLayout(new BorderLayout());
|
||||||
outerPanel.setFocusable(false);
|
outerPanel.setFocusable(true);
|
||||||
|
|
||||||
statusPanel = new JPanel();
|
statusPanel = new JPanel();
|
||||||
statusPanel.setPreferredSize(new Dimension(800,80));
|
statusPanel.setPreferredSize(new Dimension(800,80));
|
||||||
statusPanel.setFocusable(true);
|
statusPanel.setFocusable(false);
|
||||||
|
|
||||||
gamePanel = new JPanel();
|
gamePanel = new JPanel();
|
||||||
gamePanel.setLayout(null);
|
gamePanel.setLayout(null);
|
||||||
gamePanel.setPreferredSize(new Dimension(800,600));
|
gamePanel.setPreferredSize(new Dimension(800,600));
|
||||||
gamePanel.setFocusable(false);
|
gamePanel.setFocusable(false);
|
||||||
gamePanel.setBackground(Color.black);
|
gamePanel.setBackground(Color.black);
|
||||||
|
|
||||||
|
menuPanel = new JPanel();
|
||||||
|
menuPanel.setLayout(null);
|
||||||
|
menuPanel.setPreferredSize(new Dimension(800,600));
|
||||||
|
menuPanel.setFocusable(false);
|
||||||
|
menuPanel.setBackground(Color.black);
|
||||||
|
|
||||||
|
|
||||||
actionPanel = new JPanel();
|
actionPanel = new JPanel();
|
||||||
actionPanel.setLayout(new GridLayout(1,1));
|
actionPanel.setLayout(new GridLayout(1,1));
|
||||||
actionPanel.setPreferredSize(new Dimension(800,80));
|
actionPanel.setPreferredSize(new Dimension(800,80));
|
||||||
actionPanel.setFocusable(true);
|
actionPanel.setFocusable(false);
|
||||||
|
|
||||||
leftPanel = new JPanel();
|
leftPanel = new JPanel();
|
||||||
leftPanel.setLayout(null);
|
leftPanel.setLayout(null);
|
||||||
@@ -252,7 +260,18 @@ public class Main extends JFrame implements Runnable {
|
|||||||
private void tick() {
|
private void tick() {
|
||||||
PanelBuilder.kb.checkKeyActivity();
|
PanelBuilder.kb.checkKeyActivity();
|
||||||
if (!pause) {
|
if (!pause) {
|
||||||
|
if ( ! gamePanel.isVisible() ) {
|
||||||
|
gamePanel.setVisible(true);
|
||||||
|
actionPanel.setVisible(true);
|
||||||
|
statusPanel.setVisible(true);
|
||||||
|
|
||||||
|
}
|
||||||
PanelBuilder.tick();
|
PanelBuilder.tick();
|
||||||
|
} else if ( pause ) {
|
||||||
|
// Hier einfügen was passiert wenn ESC gedrückt wird
|
||||||
|
gamePanel.setVisible(false);
|
||||||
|
actionPanel.setVisible(false);
|
||||||
|
statusPanel.setVisible(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// alles was animiert wird hier rein (paints)
|
// alles was animiert wird hier rein (paints)
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ public class PanelBuilder {
|
|||||||
|
|
||||||
|
|
||||||
kb = new KeyBindings(player01);
|
kb = new KeyBindings(player01);
|
||||||
statusPanel.addKeyListener(kb);
|
outerPanel.addKeyListener(kb);
|
||||||
|
|
||||||
MapEngine me;
|
MapEngine me;
|
||||||
if (map > 0) {
|
if (map > 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user