diff --git a/src/main/java/Game.java b/src/main/java/Game.java
index aea8036..e73eea6 100644
--- a/src/main/java/Game.java
+++ b/src/main/java/Game.java
@@ -2,10 +2,12 @@ import ruscz.game.gameOfProd.Windows.WindowOfFreeMove;
import ruscz.game.gameOfProd.Windows.WindowOfMenu;
import javax.swing.*;
+import java.awt.*;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.event.WindowEvent;
+import java.awt.image.BufferedImage;
public class Game extends JFrame {
private static final int WINDOW_WIDTH = 13;
@@ -23,10 +25,10 @@ public class Game extends JFrame {
freeMove = new WindowOfFreeMove(this);
menu = new WindowOfMenu(this, freeMove);
- //tohle spustí na začátku menu, ale nejsem schopen přinutit to menu, aby se vzdalo Listeneru a mohl ho využít Game
+ //tohle spustí na začátku menu
add(menu);
- //tohle spustí na začátku hru, vše funguje tak, jak má
+ //tohle spustí na začátku hru
// add(freeMove);
// freeMove.start(true);
@@ -36,9 +38,19 @@ public class Game extends JFrame {
setLocationRelativeTo(null);
setResizable(false);
setVisible(true);
-
+ setLayout(new BorderLayout());
+ getContentPane().setBackground(Color.BLACK);
+ setExtendedState(game().MAXIMIZED_BOTH);
+ centerContent();
}
+
+
public Game game() {return this;}
+
+ public void centerContent() {
+ getContentPane().getComponent(0).setLocation((Toolkit.getDefaultToolkit().getScreenSize().width - (WINDOW_WIDTH * CELL_SIZE)) / 2, (Toolkit.getDefaultToolkit().getScreenSize().height - (WINDOW_HEIGHT * CELL_SIZE)) / 2);
+ getContentPane().getComponent(0).setSize(WINDOW_WIDTH * CELL_SIZE, WINDOW_HEIGHT * CELL_SIZE);
+ }
}
diff --git a/src/main/java/ruscz/game/gameOfProd/Map/MapManager.java b/src/main/java/ruscz/game/gameOfProd/Map/MapManager.java
index 8967fb3..a35b89f 100644
--- a/src/main/java/ruscz/game/gameOfProd/Map/MapManager.java
+++ b/src/main/java/ruscz/game/gameOfProd/Map/MapManager.java
@@ -117,6 +117,6 @@ public class MapManager {
canvas.setPreferredSize(new Dimension(
CELL_SIZE * size[0],
CELL_SIZE * size[1]));
- canvas.setBounds(0, 0, CELL_SIZE * size[0], CELL_SIZE * size[1]);
+ canvas.setSize(CELL_SIZE * size[0], CELL_SIZE * size[1]);
}
}
diff --git a/src/main/java/ruscz/game/gameOfProd/Windows/WindowOfFreeMove.java b/src/main/java/ruscz/game/gameOfProd/Windows/WindowOfFreeMove.java
index 1a59b91..9a81a1b 100644
--- a/src/main/java/ruscz/game/gameOfProd/Windows/WindowOfFreeMove.java
+++ b/src/main/java/ruscz/game/gameOfProd/Windows/WindowOfFreeMove.java
@@ -33,7 +33,6 @@ public class WindowOfFreeMove extends JLayeredPane {
public static final int KEY_DOWN = 40;
public static final int KEY_EVENT = 69;
- private static final int KEY_FULLSCREEN = 115;
private static final int KEY_ESCAPE = 27;
private JFrame game;
@@ -46,6 +45,8 @@ public class WindowOfFreeMove extends JLayeredPane {
private LinkedList
diff --git a/src/main/resources/save/savedGame/inventory-DESKTOP-TL25DTN-2.txt b/src/main/resources/save/savedGame/inventory-DESKTOP-TL25DTN-2.txt
new file mode 100644
index 0000000..7082420
--- /dev/null
+++ b/src/main/resources/save/savedGame/inventory-DESKTOP-TL25DTN-2.txt
@@ -0,0 +1 @@
+TODO: Inventory
\ No newline at end of file
diff --git a/src/main/resources/save/savedGame/inventory-DESKTOP-TL25DTN-3.txt b/src/main/resources/save/savedGame/inventory-DESKTOP-TL25DTN-3.txt
new file mode 100644
index 0000000..7082420
--- /dev/null
+++ b/src/main/resources/save/savedGame/inventory-DESKTOP-TL25DTN-3.txt
@@ -0,0 +1 @@
+TODO: Inventory
\ No newline at end of file
diff --git a/src/main/resources/save/savedGame/inventory-DESKTOP-TL25DTN.txt b/src/main/resources/save/savedGame/inventory-DESKTOP-TL25DTN.txt
new file mode 100644
index 0000000..7082420
--- /dev/null
+++ b/src/main/resources/save/savedGame/inventory-DESKTOP-TL25DTN.txt
@@ -0,0 +1 @@
+TODO: Inventory
\ No newline at end of file
diff --git a/src/main/resources/save/savedGame/person-DESKTOP-TL25DTN-2.txt b/src/main/resources/save/savedGame/person-DESKTOP-TL25DTN-2.txt
new file mode 100644
index 0000000..ee5b150
--- /dev/null
+++ b/src/main/resources/save/savedGame/person-DESKTOP-TL25DTN-2.txt
@@ -0,0 +1,5 @@
+
+ m1
+ 1
+ 7
+
\ No newline at end of file
diff --git a/src/main/resources/save/savedGame/person-DESKTOP-TL25DTN-3.txt b/src/main/resources/save/savedGame/person-DESKTOP-TL25DTN-3.txt
new file mode 100644
index 0000000..ee5b150
--- /dev/null
+++ b/src/main/resources/save/savedGame/person-DESKTOP-TL25DTN-3.txt
@@ -0,0 +1,5 @@
+
+ m1
+ 1
+ 7
+
\ No newline at end of file
diff --git a/src/main/resources/save/savedGame/person-DESKTOP-TL25DTN-4.txt b/src/main/resources/save/savedGame/person-DESKTOP-TL25DTN-4.txt
new file mode 100644
index 0000000..ee5b150
--- /dev/null
+++ b/src/main/resources/save/savedGame/person-DESKTOP-TL25DTN-4.txt
@@ -0,0 +1,5 @@
+
+ m1
+ 1
+ 7
+
\ No newline at end of file
diff --git a/src/main/resources/save/savedGame/person-DESKTOP-TL25DTN-5.txt b/src/main/resources/save/savedGame/person-DESKTOP-TL25DTN-5.txt
new file mode 100644
index 0000000..ee5b150
--- /dev/null
+++ b/src/main/resources/save/savedGame/person-DESKTOP-TL25DTN-5.txt
@@ -0,0 +1,5 @@
+
+ m1
+ 1
+ 7
+
\ No newline at end of file
diff --git a/src/main/resources/save/savedGame/person-DESKTOP-TL25DTN.txt b/src/main/resources/save/savedGame/person-DESKTOP-TL25DTN.txt
new file mode 100644
index 0000000..ee5b150
--- /dev/null
+++ b/src/main/resources/save/savedGame/person-DESKTOP-TL25DTN.txt
@@ -0,0 +1,5 @@
+
+ m1
+ 1
+ 7
+
\ No newline at end of file
diff --git a/src/main/resources/save/savedGame/person.txt b/src/main/resources/save/savedGame/person.txt
index e33ef6b..77eed58 100644
--- a/src/main/resources/save/savedGame/person.txt
+++ b/src/main/resources/save/savedGame/person.txt
@@ -1,5 +1,5 @@
- office
- 4
- 1
+ m1
+ 8
+ 4
\ No newline at end of file
diff --git a/src/main/resources/save/savedGame/village-DESKTOP-TL25DTN-2.txt b/src/main/resources/save/savedGame/village-DESKTOP-TL25DTN-2.txt
new file mode 100644
index 0000000..1b4bc7b
--- /dev/null
+++ b/src/main/resources/save/savedGame/village-DESKTOP-TL25DTN-2.txt
@@ -0,0 +1 @@
+TODO: Village
\ No newline at end of file
diff --git a/src/main/resources/save/savedGame/village-DESKTOP-TL25DTN-3.txt b/src/main/resources/save/savedGame/village-DESKTOP-TL25DTN-3.txt
new file mode 100644
index 0000000..1b4bc7b
--- /dev/null
+++ b/src/main/resources/save/savedGame/village-DESKTOP-TL25DTN-3.txt
@@ -0,0 +1 @@
+TODO: Village
\ No newline at end of file
diff --git a/src/main/resources/save/savedGame/village-DESKTOP-TL25DTN.txt b/src/main/resources/save/savedGame/village-DESKTOP-TL25DTN.txt
new file mode 100644
index 0000000..1b4bc7b
--- /dev/null
+++ b/src/main/resources/save/savedGame/village-DESKTOP-TL25DTN.txt
@@ -0,0 +1 @@
+TODO: Village
\ No newline at end of file