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;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Random;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
import de.heatup.cfg.Config;
|
||||
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@ public class Main extends JFrame implements Runnable {
|
||||
private static JPanel outerPanel;
|
||||
private static JPanel statusPanel;
|
||||
private static JPanel gamePanel;
|
||||
private static JPanel menuPanel;
|
||||
private static JPanel leftPanel;
|
||||
private static JPanel rightPanel;
|
||||
private static JPanel actionPanel;
|
||||
@@ -66,11 +67,11 @@ public class Main extends JFrame implements Runnable {
|
||||
|
||||
outerPanel = new JPanel();
|
||||
outerPanel.setLayout(new BorderLayout());
|
||||
outerPanel.setFocusable(false);
|
||||
outerPanel.setFocusable(true);
|
||||
|
||||
statusPanel = new JPanel();
|
||||
statusPanel.setPreferredSize(new Dimension(800,80));
|
||||
statusPanel.setFocusable(true);
|
||||
statusPanel.setFocusable(false);
|
||||
|
||||
gamePanel = new JPanel();
|
||||
gamePanel.setLayout(null);
|
||||
@@ -78,10 +79,17 @@ public class Main extends JFrame implements Runnable {
|
||||
gamePanel.setFocusable(false);
|
||||
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.setLayout(new GridLayout(1,1));
|
||||
actionPanel.setPreferredSize(new Dimension(800,80));
|
||||
actionPanel.setFocusable(true);
|
||||
actionPanel.setFocusable(false);
|
||||
|
||||
leftPanel = new JPanel();
|
||||
leftPanel.setLayout(null);
|
||||
@@ -252,7 +260,18 @@ public class Main extends JFrame implements Runnable {
|
||||
private void tick() {
|
||||
PanelBuilder.kb.checkKeyActivity();
|
||||
if (!pause) {
|
||||
if ( ! gamePanel.isVisible() ) {
|
||||
gamePanel.setVisible(true);
|
||||
actionPanel.setVisible(true);
|
||||
statusPanel.setVisible(true);
|
||||
|
||||
}
|
||||
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)
|
||||
|
||||
@@ -132,7 +132,7 @@ public class PanelBuilder {
|
||||
|
||||
|
||||
kb = new KeyBindings(player01);
|
||||
statusPanel.addKeyListener(kb);
|
||||
outerPanel.addKeyListener(kb);
|
||||
|
||||
MapEngine me;
|
||||
if (map > 0) {
|
||||
|
||||
Reference in New Issue
Block a user