diff --git a/src/main/java/ruscz/game/gameOfProd/Cells/Npc.java b/src/main/java/ruscz/game/gameOfProd/Cells/Npc.java index 79e7229..63c6e3c 100644 --- a/src/main/java/ruscz/game/gameOfProd/Cells/Npc.java +++ b/src/main/java/ruscz/game/gameOfProd/Cells/Npc.java @@ -23,8 +23,8 @@ public class Npc extends Person { private int height; private int offsetX; private int offsetY; - private int widthCoef; - private int heightCoef; + private double widthCoef; + private double heightCoef; private String imageNpc; private String battle; private Timer timer; @@ -121,8 +121,8 @@ public class Npc extends Person { direction = Integer.parseInt(imageInfo[2]); offsetX = Integer.parseInt(imageInfo[3]); offsetY = Integer.parseInt(imageInfo[4]); - widthCoef = Integer.parseInt(imageInfo[5]); - heightCoef = Integer.parseInt(imageInfo[6]); + widthCoef = Double.parseDouble(imageInfo[5]); + heightCoef = Double.parseDouble(imageInfo[6]); imageNpc = scanner.nextLine(); if (scanner.hasNextLine()) battle = scanner.nextLine(); } @@ -134,7 +134,7 @@ public class Npc extends Person { try { image = ImageIO.read(new File("src/main/resources/characters/" + name + "/" + imageNpc)).getSubimage(width * direction, 0, width, height); g.drawImage(image, getX() * getSize() + (getSize() / 5) + offsetX, - getY() * getSize() - (getSize() * 3 / 5) + offsetY, getSize() * widthCoef / 5, getSize() * heightCoef / 2, null); + getY() * getSize() - (getSize() * 3 / 5) + offsetY, (int) (getSize() * widthCoef / 5), (int) (getSize() * heightCoef / 2), null); } catch (IOException e) { e.printStackTrace(); } diff --git a/src/main/java/ruscz/game/gameOfProd/Game.java b/src/main/java/ruscz/game/gameOfProd/Game.java index 4401279..ecfff70 100644 --- a/src/main/java/ruscz/game/gameOfProd/Game.java +++ b/src/main/java/ruscz/game/gameOfProd/Game.java @@ -5,8 +5,11 @@ import ruscz.game.gameOfProd.Windows.WindowOfBattle; import ruscz.game.gameOfProd.Windows.WindowOfFreeMove; import ruscz.game.gameOfProd.Windows.WindowOfMenu; +import javax.imageio.ImageIO; import javax.swing.*; import java.awt.*; +import java.io.File; +import java.io.IOException; public class Game extends JFrame { private static final int WINDOW_WIDTH = 13; @@ -61,6 +64,11 @@ public class Game extends JFrame { setVisible(true); getContentPane().setBackground(Color.BLACK); setExtendedState(MAXIMIZED_BOTH); + try { + setIconImage(ImageIO.read(new File("src/main/resources/images/icon.png")).getScaledInstance(64, 64, Image.SCALE_DEFAULT)); + } catch (IOException e) { + e.printStackTrace(); + } } public Game game() { diff --git a/src/main/java/ruscz/game/gameOfProd/LevelEditor/CellSetConfig.java b/src/main/java/ruscz/game/gameOfProd/LevelEditor/CellSetConfig.java index e977b9f..bba3d43 100644 --- a/src/main/java/ruscz/game/gameOfProd/LevelEditor/CellSetConfig.java +++ b/src/main/java/ruscz/game/gameOfProd/LevelEditor/CellSetConfig.java @@ -80,9 +80,10 @@ public class CellSetConfig { infoPanel.add(saveInfo); - scrollInfo.revalidate(); - scrollInfo.requestFocus(); +// scrollInfo.revalidate(); +// scrollInfo.requestFocus(); view.add(scrollInfo); + scrollInfo.repaint(); } private JLabel nameLabel(String name, int offset) { diff --git a/src/main/java/ruscz/game/gameOfProd/LevelEditor/EditorSaveManager.java b/src/main/java/ruscz/game/gameOfProd/LevelEditor/EditorSaveManager.java index 11aae4b..29bbac6 100644 --- a/src/main/java/ruscz/game/gameOfProd/LevelEditor/EditorSaveManager.java +++ b/src/main/java/ruscz/game/gameOfProd/LevelEditor/EditorSaveManager.java @@ -57,8 +57,8 @@ public class EditorSaveManager { for (int i = 0; i < editor.getMapHeight(); i++) { for (int j = 0; j < editor.getMapWidth(); j++) { if (j != 0) info += " "; - if (set[i][j].split(",")[0].contains("door")) info += "EMPTY"; - else info += set[i][j]; + if (set[j][i].split(",")[0].contains("door")) info += "EMPTY"; + else info += set[j][i]; if (j == editor.getMapWidth() - 1 && i != editor.getMapHeight() - 1) info += System.lineSeparator(); } } diff --git a/src/main/java/ruscz/game/gameOfProd/LevelEditor/InfoManager.java b/src/main/java/ruscz/game/gameOfProd/LevelEditor/InfoManager.java index d4fa7ca..38e3645 100644 --- a/src/main/java/ruscz/game/gameOfProd/LevelEditor/InfoManager.java +++ b/src/main/java/ruscz/game/gameOfProd/LevelEditor/InfoManager.java @@ -35,11 +35,6 @@ public class InfoManager { info.setBounds(20, 200, 260, 730); info.setLayout(null); - detailedCellInfo = new DetailedCellInfo(editor, x, y); - detailedCellInfo.setBounds(20, 270, 260, 520); - detailedCellInfo.setLayout(null); - detailedCellInfo.setVisible(false); - switch (layer) { case "object": displayObjectAndTileInfo(label, x, y, true); @@ -52,7 +47,6 @@ public class InfoManager { break; } - view.add(detailedCellInfo, JLayeredPane.POPUP_LAYER); view.add(info, JLayeredPane.MODAL_LAYER); view.revalidate(); } @@ -149,6 +143,7 @@ public class InfoManager { editor.getMapLayers().repaintTileset(); } info.removeAll(); + info.setVisible(false); view.remove(info); view.revalidate(); view.repaint(); @@ -166,6 +161,12 @@ public class InfoManager { private void displayCellInfo(JLabel label, int x, int y) { String[] array = {"EMPTY", "BLOCK", "INTER", "TRIGGER", "MOVETO", "DOOR", "DOORTO", "CHEST"}; + detailedCellInfo = new DetailedCellInfo(editor, x, y); + detailedCellInfo.setBounds(20, 270, 260, 520); + detailedCellInfo.setLayout(null); + detailedCellInfo.setVisible(false); + view.add(detailedCellInfo, JLayeredPane.POPUP_LAYER); + JLabel infoLabel = new JLabel(); infoLabel.setBounds(0, 0, 50, 50); infoLabel.setIcon(label.getIcon()); @@ -208,13 +209,12 @@ public class InfoManager { openCellMap.setBounds(30, 600, 200, 30); openCellMap.addActionListener(e -> { - info.removeAll(); - info.revalidate(); - detailedCellInfo.removeAll(); - detailedCellInfo.revalidate(); +// info.removeAll(); +// info.revalidate(); +// detailedCellInfo.removeAll(); +// detailedCellInfo.revalidate(); view.remove(info); view.remove(detailedCellInfo); - view.revalidate(); new CellSetConfig(editor, scrollInfo).displayCellSetConfig(); }); @@ -259,4 +259,8 @@ public class InfoManager { editor.getCellArray()[x][y+1] = value; } } + + public JPanel getInfo() { + return info; + } } diff --git a/src/main/java/ruscz/game/gameOfProd/LevelEditor/LevelEditor.java b/src/main/java/ruscz/game/gameOfProd/LevelEditor/LevelEditor.java index 4c6fc66..0af673d 100644 --- a/src/main/java/ruscz/game/gameOfProd/LevelEditor/LevelEditor.java +++ b/src/main/java/ruscz/game/gameOfProd/LevelEditor/LevelEditor.java @@ -4,6 +4,7 @@ import ruscz.game.gameOfProd.Cells.TypeOfCell; import ruscz.game.gameOfProd.Map.Map; import ruscz.game.gameOfProd.Windows.WindowOfFreeMove; +import javax.imageio.ImageIO; import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; @@ -11,6 +12,8 @@ import java.awt.event.ActionListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; import java.util.Arrays; import java.util.HashMap; import java.util.LinkedList; @@ -88,8 +91,7 @@ public class LevelEditor extends JFrame { view.revalidate(); view.repaint(); createNewMap(name, width, height); - } - catch (NumberFormatException ex) { + } catch (NumberFormatException ex) { error.setText("
One or more values (apart from Name) is not an Integer.
"); error.setVisible(true); } @@ -114,6 +116,11 @@ public class LevelEditor extends JFrame { setLayout(null); setVisible(true); setResizable(false); + try { + setIconImage(ImageIO.read(new File("src/main/resources/images/icon.png")).getScaledInstance(64, 64, Image.SCALE_DEFAULT)); + } catch (IOException e) { + e.printStackTrace(); + } } public void createNewMap(String name, int width, int height) { @@ -152,6 +159,7 @@ public class LevelEditor extends JFrame { importTilesets.addActionListener(e -> { imagesOfTiles = overview.getImagesOfTiles(); mapLayersManager.repaintSets(); + if (infoManager.getInfo() != null) infoManager.getInfo().repaint(); }); JButton openTilesets = new JButton("Open Tileset Overview"); @@ -184,11 +192,18 @@ public class LevelEditor extends JFrame { mapViewer.getVerticalScrollBar().setUnitIncrement(10); JLabel objectLabel = new JLabel("Object Layer"); - objectLabel.setBounds( 500, 30, 100, 20); + objectLabel.setBounds(500, 30, 100, 20); JCheckBox objectBox = new JCheckBox(); objectBox.setBounds(600, 30, 30, 20); objectBox.setSelected(true); objectBox.addActionListener(actionEvent -> { + if (infoManager.getInfo() != null) { + infoManager.getInfo().removeAll(); + infoManager.getInfo().setVisible(false); + view.remove(infoManager.getInfo()); + view.revalidate(); + view.repaint(); + } if (objectSet.isVisible()) objectSet.setVisible(false); else { objectSet.setVisible(true); @@ -196,21 +211,35 @@ public class LevelEditor extends JFrame { }); JLabel cellLabel = new JLabel("Physical (cell) Layer"); - cellLabel.setBounds( 700, 30, 150, 20); + cellLabel.setBounds(700, 30, 150, 20); JCheckBox cellBox = new JCheckBox(); cellBox.setBounds(850, 30, 30, 20); cellBox.setSelected(true); cellBox.addActionListener(actionEvent -> { + if (infoManager.getInfo() != null) { + infoManager.getInfo().removeAll(); + infoManager.getInfo().setVisible(false); + view.remove(infoManager.getInfo()); + view.revalidate(); + view.repaint(); + } if (cellSet.isVisible()) cellSet.setVisible(false); else cellSet.setVisible(true); }); JLabel tileLabel = new JLabel("Tile Layer"); - tileLabel.setBounds( 950, 30, 100, 20); + tileLabel.setBounds(950, 30, 100, 20); JCheckBox tileBox = new JCheckBox(); tileBox.setBounds(1030, 30, 30, 20); tileBox.setSelected(true); tileBox.addActionListener(actionEvent -> { + if (infoManager.getInfo() != null) { + infoManager.getInfo().removeAll(); + infoManager.getInfo().setVisible(false); + view.remove(infoManager.getInfo()); + view.revalidate(); + view.repaint(); + } if (tileSet.isVisible()) tileSet.setVisible(false); else tileSet.setVisible(true); }); @@ -228,8 +257,13 @@ public class LevelEditor extends JFrame { new EditorSaveManager(getEditor()).saveMap(); } - @Override public void mousePressed(MouseEvent e) {} - @Override public void mouseReleased(MouseEvent e) {} + @Override + public void mousePressed(MouseEvent e) { + } + + @Override + public void mouseReleased(MouseEvent e) { + } @Override public void mouseEntered(MouseEvent e) { @@ -280,7 +314,9 @@ public class LevelEditor extends JFrame { errorMessage.setVisible(true); } - protected void hideError() { errorMessage.setVisible(false); } + protected void hideError() { + errorMessage.setVisible(false); + } public JLayeredPane getView() { return view; @@ -318,19 +354,27 @@ public class LevelEditor extends JFrame { return mapLayersManager; } - public HashMap getCellMap() { return cellMap; } + public HashMap getCellMap() { + return cellMap; + } public void setCellMap(HashMap cellMap) { this.cellMap = cellMap; } - public String[][] getCellArray() { return cellArray; } + public String[][] getCellArray() { + return cellArray; + } - public void setCellArray(String[][] cellArray) { this.cellArray = cellArray; } + public void setCellArray(String[][] cellArray) { + this.cellArray = cellArray; + } public void setOverview(TilesetOverview overview) { this.overview = overview; } - public LevelEditor getEditor() { return this; } + public LevelEditor getEditor() { + return this; + } } diff --git a/src/main/java/ruscz/game/gameOfProd/LevelEditor/MapLayersManager.java b/src/main/java/ruscz/game/gameOfProd/LevelEditor/MapLayersManager.java index c7d51c9..df67c30 100644 --- a/src/main/java/ruscz/game/gameOfProd/LevelEditor/MapLayersManager.java +++ b/src/main/java/ruscz/game/gameOfProd/LevelEditor/MapLayersManager.java @@ -91,6 +91,7 @@ public class MapLayersManager { @Override public void mouseClicked(MouseEvent e) { editor.getInfoManager().displayInfo(object, "object", x, y); + System.out.println("object"); } }); objectSet.add(object); @@ -138,7 +139,7 @@ public class MapLayersManager { for (int j = 0; j < height; j++) { JLabel tile = new JLabel(); if (imagesOfTiles == null || imagesOfTiles.size() == 0) { - tile.setText("
" + String.valueOf(map.getImageCell().getMapBackground()[i][j]) + "
"); + tile.setText("
" + map.getImageCell().getMapBackground()[i][j] + "
"); tile.setHorizontalTextPosition(JLabel.CENTER); tileSet.setOpaque(true); tileSet.setBackground(Color.BLUE); @@ -158,6 +159,7 @@ public class MapLayersManager { @Override public void mouseClicked(MouseEvent e) { editor.getInfoManager().displayInfo(tile, "tile", x, y); + System.out.println("tile"); } }); tileSet.add(tile); diff --git a/src/main/java/ruscz/game/gameOfProd/LevelEditor/TilesetOverview.java b/src/main/java/ruscz/game/gameOfProd/LevelEditor/TilesetOverview.java index 1d6239c..0c4ef42 100644 --- a/src/main/java/ruscz/game/gameOfProd/LevelEditor/TilesetOverview.java +++ b/src/main/java/ruscz/game/gameOfProd/LevelEditor/TilesetOverview.java @@ -64,6 +64,11 @@ public class TilesetOverview extends JFrame { setLocationRelativeTo(null); setVisible(true); setResizable(false); + try { + setIconImage(ImageIO.read(new File("src/main/resources/images/icon.png")).getScaledInstance(64, 64, Image.SCALE_DEFAULT)); + } catch (IOException e) { + e.printStackTrace(); + } } private void loadTileset(String name) { diff --git a/src/main/java/ruscz/game/gameOfProd/Save/LoadManager.java b/src/main/java/ruscz/game/gameOfProd/Save/LoadManager.java index 4d3edd1..510a408 100644 --- a/src/main/java/ruscz/game/gameOfProd/Save/LoadManager.java +++ b/src/main/java/ruscz/game/gameOfProd/Save/LoadManager.java @@ -1,6 +1,7 @@ package ruscz.game.gameOfProd.Save; import ruscz.game.gameOfProd.Cells.ChestCell; +import ruscz.game.gameOfProd.Cells.DoorCell; import ruscz.game.gameOfProd.Cells.Npc; import ruscz.game.gameOfProd.Cells.TriggerCell; import ruscz.game.gameOfProd.Inventory.InventoryManager; @@ -154,6 +155,11 @@ public class LoadManager { ChestCell chestCell = map.findChestByXY(Integer.parseInt(getValue(scanner.nextLine())), Integer.parseInt(getValue(scanner.nextLine()))); chestCell.setActive(Boolean.parseBoolean(getValue(scanner.nextLine()))); } + else if (data.contains("")) { + DoorCell doorCell = map.findDoorByXY(Integer.parseInt(getValue(scanner.nextLine())), Integer.parseInt(getValue(scanner.nextLine()))); + doorCell.setLocked(Boolean.parseBoolean(getValue(scanner.nextLine()))); + doorCell.setOpen(Boolean.parseBoolean(getValue(scanner.nextLine()))); + } } scanner.close(); } catch (FileNotFoundException e) { diff --git a/src/main/java/ruscz/game/gameOfProd/Save/SaveManager.java b/src/main/java/ruscz/game/gameOfProd/Save/SaveManager.java index 98d012c..1199fbc 100644 --- a/src/main/java/ruscz/game/gameOfProd/Save/SaveManager.java +++ b/src/main/java/ruscz/game/gameOfProd/Save/SaveManager.java @@ -1,6 +1,7 @@ package ruscz.game.gameOfProd.Save; import ruscz.game.gameOfProd.Cells.ChestCell; +import ruscz.game.gameOfProd.Cells.DoorCell; import ruscz.game.gameOfProd.Cells.Person; import ruscz.game.gameOfProd.Cells.TriggerCell; import ruscz.game.gameOfProd.Inventory.InventoryManager; @@ -71,6 +72,16 @@ public class SaveManager { " " + System.lineSeparator(); mapInfo += event; } + for (DoorCell doorCell : map.getDoorCells()) { + String event = + " " + System.lineSeparator() + + " " + doorCell.getX() + "" + System.lineSeparator() + + " " + doorCell.getY() + "" + System.lineSeparator() + + " " + doorCell.isLocked() + "" + System.lineSeparator() + + " " + doorCell.isOpen() + "" + System.lineSeparator() + + " " + System.lineSeparator(); + mapInfo += event; + } mapInfo += " " + System.lineSeparator() + "" + System.lineSeparator(); diff --git a/src/main/java/ruscz/game/gameOfProd/Windows/WindowOfBattle.java b/src/main/java/ruscz/game/gameOfProd/Windows/WindowOfBattle.java index 45a27b7..dd38b26 100644 --- a/src/main/java/ruscz/game/gameOfProd/Windows/WindowOfBattle.java +++ b/src/main/java/ruscz/game/gameOfProd/Windows/WindowOfBattle.java @@ -248,7 +248,7 @@ public class WindowOfBattle extends JPanel { public void addImage(String name) { try { - images.add(ImageIO.read(new File("src/main/resources/foregrounds/" + name + ".png"))); + images.add(ImageIO.read(new File("src/main/resources/images/" + name + ".png"))); image = images.getLast(); } catch (IOException e) { e.printStackTrace(); @@ -257,7 +257,7 @@ public class WindowOfBattle extends JPanel { public void setImage(String name) { try { - image = ImageIO.read(new File("src/main/resources/foregrounds/" + name + ".png")); + image = ImageIO.read(new File("src/main/resources/images/" + name + ".png")); } catch (IOException e) { e.printStackTrace(); } diff --git a/src/main/java/ruscz/game/gameOfProd/Windows/WindowOfFreeMove.java b/src/main/java/ruscz/game/gameOfProd/Windows/WindowOfFreeMove.java index 04c41c0..404b6a2 100644 --- a/src/main/java/ruscz/game/gameOfProd/Windows/WindowOfFreeMove.java +++ b/src/main/java/ruscz/game/gameOfProd/Windows/WindowOfFreeMove.java @@ -282,7 +282,7 @@ public class WindowOfFreeMove extends JLayeredPane { if (name == null) imageForeground = null; else { try { - imageForeground = ImageIO.read(new File("src/main/resources/foregrounds/" + name + ".png")); + imageForeground = ImageIO.read(new File("src/main/resources/images/" + name + ".png")); } catch (IOException e) { e.printStackTrace(); } diff --git a/src/main/java/ruscz/game/gameOfProd/Windows/WindowOfMenu.java b/src/main/java/ruscz/game/gameOfProd/Windows/WindowOfMenu.java index 9640555..e81b060 100644 --- a/src/main/java/ruscz/game/gameOfProd/Windows/WindowOfMenu.java +++ b/src/main/java/ruscz/game/gameOfProd/Windows/WindowOfMenu.java @@ -198,9 +198,11 @@ public class WindowOfMenu extends JPanel { if (!getIgnoreRepaint()) { Image powered = null; Image menu = null; + Image logo = null; try { - powered = ImageIO.read(new File("src/main/resources/foregrounds/poweredByCellEngine.png")); - menu = ImageIO.read(new File("src/main/resources/foregrounds/menu.png")); + powered = ImageIO.read(new File("src/main/resources/images/poweredByCellEngine.png")); + menu = ImageIO.read(new File("src/main/resources/images/menu.png")); + logo = ImageIO.read(new File("src/main/resources/images/logo.png")); } catch (IOException e) { e.printStackTrace(); } @@ -209,7 +211,11 @@ public class WindowOfMenu extends JPanel { if (!showMenu) g.drawImage(powered, (screenSize.width - (powered.getWidth(null) / 2)) / 2, (screenSize.height - (powered.getHeight(null) / 2)) / 2, (powered.getWidth(null) / 2), (powered.getHeight(null) / 2), null); - else g.drawImage(menu, 0, 0, screenSize.width, screenSize.height, null); + else { + g.drawImage(menu, 0, 0, screenSize.width, screenSize.height, null); + g.drawImage(logo, (screenSize.width - (logo.getWidth(null) * 3)) / 2, 50, + logo.getWidth(null) * 3, logo.getHeight(null) * 3, null); + } } } diff --git a/src/main/resources/characters/monster/monster.txt b/src/main/resources/characters/monster/monster.txt index c87c8e7..e278602 100644 --- a/src/main/resources/characters/monster/monster.txt +++ b/src/main/resources/characters/monster/monster.txt @@ -1,4 +1,4 @@ -7 7 storageroom -30 79 1 0 20 2 2 +10 9 storageroom +30 79 1 0 20 2.5 2.5 monster.png storageroombattle \ No newline at end of file diff --git a/src/main/resources/foregrounds/battle1.png b/src/main/resources/images/battle1.png similarity index 100% rename from src/main/resources/foregrounds/battle1.png rename to src/main/resources/images/battle1.png diff --git a/src/main/resources/foregrounds/battle2.png b/src/main/resources/images/battle2.png similarity index 100% rename from src/main/resources/foregrounds/battle2.png rename to src/main/resources/images/battle2.png diff --git a/src/main/resources/foregrounds/end1.png b/src/main/resources/images/end1.png similarity index 100% rename from src/main/resources/foregrounds/end1.png rename to src/main/resources/images/end1.png diff --git a/src/main/resources/foregrounds/end2.png b/src/main/resources/images/end2.png similarity index 100% rename from src/main/resources/foregrounds/end2.png rename to src/main/resources/images/end2.png diff --git a/src/main/resources/foregrounds/end3.png b/src/main/resources/images/end3.png similarity index 100% rename from src/main/resources/foregrounds/end3.png rename to src/main/resources/images/end3.png diff --git a/src/main/resources/foregrounds/end4.png b/src/main/resources/images/end4.png similarity index 100% rename from src/main/resources/foregrounds/end4.png rename to src/main/resources/images/end4.png diff --git a/src/main/resources/foregrounds/error.png b/src/main/resources/images/error.png similarity index 100% rename from src/main/resources/foregrounds/error.png rename to src/main/resources/images/error.png diff --git a/src/main/resources/images/icon.png b/src/main/resources/images/icon.png new file mode 100644 index 0000000..7399387 Binary files /dev/null and b/src/main/resources/images/icon.png differ diff --git a/src/main/resources/images/logo.png b/src/main/resources/images/logo.png new file mode 100644 index 0000000..4573563 Binary files /dev/null and b/src/main/resources/images/logo.png differ diff --git a/src/main/resources/images/logo2.png b/src/main/resources/images/logo2.png new file mode 100644 index 0000000..00e4f63 Binary files /dev/null and b/src/main/resources/images/logo2.png differ diff --git a/src/main/resources/foregrounds/menu.png b/src/main/resources/images/menu.png similarity index 100% rename from src/main/resources/foregrounds/menu.png rename to src/main/resources/images/menu.png diff --git a/src/main/resources/foregrounds/poweredByCellEngine.png b/src/main/resources/images/poweredByCellEngine.png similarity index 100% rename from src/main/resources/foregrounds/poweredByCellEngine.png rename to src/main/resources/images/poweredByCellEngine.png diff --git a/src/main/resources/maps/0/storageroom-objectset.txt b/src/main/resources/maps/0/storageroom-objectset.txt index 17be624..e05dbad 100644 --- a/src/main/resources/maps/0/storageroom-objectset.txt +++ b/src/main/resources/maps/0/storageroom-objectset.txt @@ -1,13 +1,13 @@ 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 131 147 242 242 0 0 0 0 0 0 0 0 +0 132 148 243 243 0 0 0 0 0 0 419 0 +0 0 0 0 0 0 0 0 0 0 0 420 0 +0 390 0 0 0 0 0 0 0 0 0 435 0 +0 461 461 0 0 0 0 0 0 0 0 436 0 +0 462 462 0 0 0 0 0 0 395 395 395 0 +0 391 423 0 0 0 0 0 0 396 396 396 0 +0 423 0 0 0 0 0 515 531 0 0 0 0 +0 0 0 0 0 0 0 516 532 397 413 429 0 +0 821 0 0 0 0 0 0 0 398 414 430 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 0 0 0 \ No newline at end of file +0 0 0 7 7 7 0 7 7 7 0 0 0 \ No newline at end of file diff --git a/src/main/resources/maps/0/storageroom-tileset.txt b/src/main/resources/maps/0/storageroom-tileset.txt index e3d1d2a..18e0b6b 100644 --- a/src/main/resources/maps/0/storageroom-tileset.txt +++ b/src/main/resources/maps/0/storageroom-tileset.txt @@ -12,8 +12,8 @@ 0 0 0 0 0 0 0 0 0 0 0 0 0 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 -6 6 6 6 6 6 6 6 6 6 6 6 6 -6 6 6 6 6 6 6 6 6 6 6 6 6 +6 379 6 6 6 6 6 6 6 6 6 6 6 +6 6 378 6 6 6 6 379 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 diff --git a/src/main/resources/maps/0/storageroom.txt b/src/main/resources/maps/0/storageroom.txt index 9c04747..1c5d677 100644 --- a/src/main/resources/maps/0/storageroom.txt +++ b/src/main/resources/maps/0/storageroom.txt @@ -1,14 +1,14 @@ 13 13 BLOCK,d BLOCK,d BLOCK,d BLOCK,d BLOCK,d BLOCK,d EMPTY BLOCK,d BLOCK,d BLOCK,d BLOCK,d BLOCK,d BLOCK,d BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK DOORTO,true,4,3,office BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK -BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY TRIGGER,cutscene-fight EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK +BLOCK block block block block EMPTY TRIGGER,cutscene-fight EMPTY EMPTY EMPTY EMPTY block BLOCK +BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY block BLOCK +BLOCK block EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY block BLOCK +BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY block BLOCK +BLOCK block block EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK +BLOCK block block EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY block block block BLOCK +BLOCK block EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK +BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY block block EMPTY block EMPTY BLOCK +BLOCK block EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY block block block BLOCK BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK -BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK -BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK -BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK -BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK -BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK -BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK -BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK -BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK -BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK \ No newline at end of file +BLOCK BLOCK BLOCK block block block BLOCK block block block BLOCK BLOCK BLOCK \ No newline at end of file diff --git a/src/main/resources/save/savedGame/events.txt b/src/main/resources/save/savedGame/events.txt index 3c83611..1d47108 100644 --- a/src/main/resources/save/savedGame/events.txt +++ b/src/main/resources/save/savedGame/events.txt @@ -14,7 +14,7 @@ 6 4 - false + true 14 @@ -24,13 +24,43 @@ 1 2 - false + true 15 7 true + + 8 + 4 + false + false + + + 2 + 6 + true + false + + + 6 + 6 + false + false + + + 16 + 10 + false + false + + + 8 + 13 + false + true + @@ -44,8 +74,50 @@ 1 9 - true + false + + 12 + 1 + true + false + + + 17 + 1 + true + false + + + 7 + 12 + true + false + + + 12 + 12 + true + false + + + 4 + 1 + false + false + + + 2 + 12 + false + false + + + 17 + 12 + true + false + @@ -56,6 +128,12 @@ 18 true + + 4 + 19 + false + false + @@ -76,5 +154,11 @@ 2 true + + 6 + 1 + false + false + diff --git a/src/main/resources/save/savedGame/inventory.txt b/src/main/resources/save/savedGame/inventory.txt index 02de760..e69de29 100644 --- a/src/main/resources/save/savedGame/inventory.txt +++ b/src/main/resources/save/savedGame/inventory.txt @@ -1,6 +0,0 @@ - - cup-o'-coffee - 1 - 295 - heal - diff --git a/src/main/resources/save/savedGame/person.txt b/src/main/resources/save/savedGame/person.txt index ec0fcae..f083d14 100644 --- a/src/main/resources/save/savedGame/person.txt +++ b/src/main/resources/save/savedGame/person.txt @@ -1,6 +1,6 @@ - storageroom - 6 - 2 - 0 + openspace + 8 + 15 + 3 \ No newline at end of file diff --git a/src/main/resources/tilesets/A5_Tiles.png b/src/main/resources/tilesets/A5_Tiles.png index 116bb26..994357c 100644 Binary files a/src/main/resources/tilesets/A5_Tiles.png and b/src/main/resources/tilesets/A5_Tiles.png differ diff --git a/src/main/resources/tilesets/Openspace1.png b/src/main/resources/tilesets/Openspace1.png index a113a0c..8c79e80 100644 Binary files a/src/main/resources/tilesets/Openspace1.png and b/src/main/resources/tilesets/Openspace1.png differ diff --git a/src/main/resources/tilesets/Openspace2.png b/src/main/resources/tilesets/Openspace2.png index 0599a8e..2c65c5f 100644 Binary files a/src/main/resources/tilesets/Openspace2.png and b/src/main/resources/tilesets/Openspace2.png differ diff --git a/src/test/java/ruscz/game/gameOfProd/LevelEditor/LevelEditorTest.java b/src/test/java/ruscz/game/gameOfProd/LevelEditor/LevelEditorTest.java index a215daa..f63d99e 100644 --- a/src/test/java/ruscz/game/gameOfProd/LevelEditor/LevelEditorTest.java +++ b/src/test/java/ruscz/game/gameOfProd/LevelEditor/LevelEditorTest.java @@ -126,7 +126,10 @@ public class LevelEditorTest { scanner.nextLine(); int i = 0; while (scanner.hasNextLine()) { - cellArray[i] = scanner.nextLine().split(" "); + String[] data = scanner.nextLine().split(" "); + for (int j = 0; j < data.length; j++) { + cellArray[j][i] = data[j]; + } i++; } levelEditor.setCellArray(cellArray);