diff --git a/src/main/java/ruscz/game/gameOfProd/Cells/InteractionCell.java b/src/main/java/ruscz/game/gameOfProd/Cells/InteractionCell.java index 7da9815..d95c139 100644 --- a/src/main/java/ruscz/game/gameOfProd/Cells/InteractionCell.java +++ b/src/main/java/ruscz/game/gameOfProd/Cells/InteractionCell.java @@ -11,6 +11,7 @@ import ruscz.game.gameOfProd.Windows.WindowOfFreeMove; import javax.swing.*; import java.awt.*; +import java.awt.event.WindowEvent; import java.io.File; import java.io.FileNotFoundException; import java.util.Objects; @@ -25,6 +26,7 @@ public class InteractionCell extends Cell { private WindowOfFreeMove window; protected boolean paint; private Timer timer; + private Timer textTimer; public InteractionCell(int x, int y, String message, Dialog dialog, Map map, WindowOfFreeMove window, boolean paint) { super(x, y, WindowOfFreeMove.CELL_SIZE, Color.ORANGE); @@ -231,20 +233,69 @@ public class InteractionCell extends Cell { if (data[0].contains("<" + i + ">")) { if (data[1].contains("")) { if (data[2].equals("null")) dialog.hideText(); + else if (data[2].equals("image")) { + if (!data[3].equals("null")) { + dialog.setImageDialog(new ImageDialog(data[3])); + } + else { + dialog.unsetImageDialog(); + } + } + else if (data[2].equals("voice")) { + if (!data[3].equals("null")) { + dialog.setVoiceover(true); + dialog.setVoice(data[3]); + } + else { + dialog.setVoiceover(false); + } + } + else if (data[2].equals("fast")) { + String line = data[3].replaceAll("-", " "); + String[] texts = line.split(""); + final int[] j = {0}; + textTimer = new Timer(100, e -> { + if (j[0] == texts.length - 1) stopTextTimer(); + if (!dialog.getTimerIsRunning()) { + if (texts[j[0]].contains("
")) { + texts[j[0]] = "" + texts[j[0]] + ""; + } + dialog.setText(texts[j[0]]); + dialog.showFastText(); + j[0]++; + } + }); + textTimer.start(); + } else { - dialog.setText(data[2].replaceAll("-", " ")); + String text = data[2].replaceAll("-", " "); + if (text.contains("
")) { + text = "" + text + ""; + } + dialog.setText(text); dialog.showText(); } } else if (data[1].contains("")) { if (data[2].equals("null")) window.getForegroundPanel().setVisible(false); + else if (data[2].equals("color")) { + window.getForegroundPanel().setImageForeground(null); + window.getForegroundPanel().setColorForeground(Integer.parseInt(data[3]), Integer.parseInt(data[4]), + Integer.parseInt(data[5]), Integer.parseInt(data[6])); + window.getForegroundPanel().setVisible(true); + } + else if (data[2].equals("fade")) { + window.getForegroundPanel().setVisible(true); + window.getForegroundPanel().fade(Integer.parseInt(data[3]), Integer.parseInt(data[4]), Integer.parseInt(data[5])); + } else { window.getForegroundPanel().setImageForeground(data[2]); window.getForegroundPanel().setVisible(true); } } - else if (data[1].contains("")) { WindowOfFreeMove.setCanPersonMove(Boolean.parseBoolean(data[2])); + if (Boolean.parseBoolean(data[2])) endEvent(); } else if (data[1].contains("")) { Map map = Map.findMapByName(data[2], window); @@ -254,10 +305,20 @@ public class InteractionCell extends Cell { map.setIdExit(0); } else if (data[1].equals("")) { - window.getMusicManager().playMusic(); - window.getMusicManager().fadeIn(10); + if (data[2].equals("start")) { + window.getMusicManager().playMusic(); + window.getMusicManager().fadeIn(10); + } + else { + window.getMusicManager().fadeOut(10); + } } + else if (data[1].equals("")) window.getMapManager().getActualMap().getNpcs().clear(); else if (data[1].equals("")) window.loadNextChapter(); + else if (data[1].equals("")) { +// window.getMapManager().getLoadManager().clearSave(); + window.getGame().dispatchEvent(new WindowEvent(window.getGame(), WindowEvent.WINDOW_CLOSING)); + } else if (data[1].equals("")) { timer.stop(); } @@ -268,6 +329,10 @@ public class InteractionCell extends Cell { } } + private void stopTextTimer() { + textTimer.stop(); + } + public void useItem(Item item) { InventoryManager.removeItem(item, 1); } diff --git a/src/main/java/ruscz/game/gameOfProd/Dialog/Dialog.java b/src/main/java/ruscz/game/gameOfProd/Dialog/Dialog.java index 570ca94..eefdc03 100644 --- a/src/main/java/ruscz/game/gameOfProd/Dialog/Dialog.java +++ b/src/main/java/ruscz/game/gameOfProd/Dialog/Dialog.java @@ -6,8 +6,6 @@ import ruscz.game.gameOfProd.Windows.WindowOfFreeMove; import javax.swing.*; import java.awt.*; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; public class Dialog { private String text; @@ -21,21 +19,6 @@ public class Dialog { private String voice; private boolean voiceover; - Dialog(String text, DialogBar dialogBar) { - this.text = text; - textLength = text.length() + 1; - this.dialogBar = dialogBar; - charNumber = 0; - } - - Dialog(String text, DialogBar dialogBar, ImageDialog imageDialog) { - this.text = text; - this.imageDialog = imageDialog; - textLength = text.length() + 1; - this.dialogBar = dialogBar; - charNumber = 0; - } - public Dialog(DialogBar dialogBar) { this.dialogBar = dialogBar; charNumber = 0; @@ -87,19 +70,29 @@ public class Dialog { if (text.contains("")) charNumber = 6; dialogBar.setVisible(true); - timer = new Timer(30, new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - if (voiceover) - soundManager.playSound(voice + ".wav", -20.0f); - showByChar(); - dialogBar.repaint(); - timerIsRunning = timer.isRunning(); - } + timer = new Timer(30, e -> { + if (voiceover) + soundManager.playSound(voice + ".wav", -20.0f); + showByChar(); + timerIsRunning = timer.isRunning(); }); timer.start(); } + public void showFastText() { + charNumber = 0; + if (text.contains("")) + charNumber = 6; + dialogBar.setVisible(true); + while (charNumber <= text.length()) { + if (voiceover) + soundManager.playSound(voice + ".wav", -20.0f); + showByChar(); + timerIsRunning = true; + } + timerIsRunning = false; + } + public void skipShowText() { timer.stop(); timerIsRunning = false; @@ -138,9 +131,5 @@ public class Dialog { public SoundManager getSoundManager() { return soundManager; } public void setVoiceover(boolean voiceover) { this.voiceover = voiceover; } - - public boolean isTimerIsRunning() { - return timerIsRunning; - } } diff --git a/src/main/java/ruscz/game/gameOfProd/Game.java b/src/main/java/ruscz/game/gameOfProd/Game.java index 32a0347..82d8a34 100644 --- a/src/main/java/ruscz/game/gameOfProd/Game.java +++ b/src/main/java/ruscz/game/gameOfProd/Game.java @@ -40,10 +40,10 @@ public class Game extends JFrame { battle = new WindowOfBattle(this); //tohle spustí na začátku menu -// add(menu); + add(menu); //tohle spustí na začátku hru - add(freeMove); +// add(freeMove); // freeMove.start(true); //tohle spustí na začátku bitvu @@ -55,7 +55,6 @@ public class Game extends JFrame { setDefaultCloseOperation(EXIT_ON_CLOSE); setUndecorated(true); - setBounds(0, 0, CELL_SIZE * WINDOW_WIDTH, CELL_SIZE * WINDOW_HEIGHT); setLocationRelativeTo(null); setResizable(false); setVisible(true); diff --git a/src/main/java/ruscz/game/gameOfProd/Image/ImageCell.java b/src/main/java/ruscz/game/gameOfProd/Image/ImageCell.java index 8d039cd..77d3ba4 100644 --- a/src/main/java/ruscz/game/gameOfProd/Image/ImageCell.java +++ b/src/main/java/ruscz/game/gameOfProd/Image/ImageCell.java @@ -37,7 +37,7 @@ public class ImageCell { String data = scanner.nextLine(); if (data.contains("")) { String[] mapInfo = data.split(" "); - imageTileset(mapInfo[1]); + imageTileset(mapInfo); } else if (data.contains("")) { String[] mapInfo = data.split(" "); @@ -62,16 +62,18 @@ public class ImageCell { } } - public void imageTileset(String tilesetInfo) { + public void imageTileset(String[] tilesetInfo) { try { - image = ImageIO.read(new File("src/main/resources/tilesets/" + tilesetInfo)); + image = ImageIO.read(new File("src/main/resources/tilesets/" + tilesetInfo[1])); } catch (IOException e) { e.printStackTrace(); } int width = image.getWidth(); int height = image.getHeight(); - int tileSize = 32; + int tileSize; + if (tilesetInfo.length == 3) tileSize = Integer.parseInt(tilesetInfo[2]); + else tileSize = 32; int Xtiles = width / tileSize; int Ytiles = height / tileSize; diff --git a/src/main/java/ruscz/game/gameOfProd/Save/LoadManager.java b/src/main/java/ruscz/game/gameOfProd/Save/LoadManager.java index 5875da0..23b9547 100644 --- a/src/main/java/ruscz/game/gameOfProd/Save/LoadManager.java +++ b/src/main/java/ruscz/game/gameOfProd/Save/LoadManager.java @@ -26,6 +26,13 @@ public class LoadManager { this.window = mapManager.getWindow(); } + public static boolean isSaveEmpty() { + File personFile = new File("src/main/resources/save/savedGame/person.txt"); + File eventFile = new File("src/main/resources/save/savedGame/events.txt"); + File inventoryFile = new File("src/main/resources/save/savedGame/inventory.txt"); + return personFile.length() == 0 && eventFile.length() == 0 && inventoryFile.length() == 0; + } + public void loadNewGame() { loadMaps(); loadNpcs(); diff --git a/src/main/java/ruscz/game/gameOfProd/Sounds/MusicManager.java b/src/main/java/ruscz/game/gameOfProd/Sounds/MusicManager.java index 2e76746..0bf2841 100644 --- a/src/main/java/ruscz/game/gameOfProd/Sounds/MusicManager.java +++ b/src/main/java/ruscz/game/gameOfProd/Sounds/MusicManager.java @@ -65,7 +65,6 @@ public class MusicManager { else { stopMusic(); } - System.out.println(volume); }); timerIn.stop(); timerOut.start(); diff --git a/src/main/java/ruscz/game/gameOfProd/Windows/WindowOfFreeMove.java b/src/main/java/ruscz/game/gameOfProd/Windows/WindowOfFreeMove.java index b886640..7153f0d 100644 --- a/src/main/java/ruscz/game/gameOfProd/Windows/WindowOfFreeMove.java +++ b/src/main/java/ruscz/game/gameOfProd/Windows/WindowOfFreeMove.java @@ -104,6 +104,10 @@ public class WindowOfFreeMove extends JLayeredPane { public MusicManager getMusicManager() { return musicManager; } + public JFrame getGame() { + return game; + } + public WindowOfFreeMove(JFrame game) { this.game = game; isReadyToPaint = false; @@ -180,17 +184,18 @@ public class WindowOfFreeMove extends JLayeredPane { mapManager.getLoadManager().loadNewGame(); Map firstMap = Map.findMapByName(Map.getMapWithSpawn(), this); setMapManager(firstMap); + musicManager = new MusicManager("Town3.wav", -25.0f); } else { mapManager.getLoadManager().loadSavedGame(); + musicManager = new MusicManager("Town3.wav", -25.0f); + musicManager.playMusic(); + musicManager.fadeIn(10); } mapManager.createMap(); isReadyToPaint = true; - musicManager = new MusicManager("Town3.wav", -25.0f); -// musicManager.playMusic(); - Timer timer = new Timer(10, actionEvent -> { mapManager.getActualMap().getPerson().move(); camera.moveCamera(); @@ -248,7 +253,7 @@ public class WindowOfFreeMove extends JLayeredPane { for (Person person : mapManager.getActualMap().getNpcs()) { if (person.getY() == i) person.paint(g2D); } - for (int j = 0; j < mapManager.getActualMap().getCanvasSize()[1]; j++) { + for (int j = 0; j < mapManager.getActualMap().getCanvasSize()[0]; j++) { mapManager.getActualMap().getImageCell().paintForeground(g2D, j, i); } for (ChestCell cell : mapManager.getActualMap().getChestCells()) { @@ -260,20 +265,57 @@ public class WindowOfFreeMove extends JLayeredPane { } public class Foreground extends JPanel { - Image imageForeground; + private Image imageForeground; + private int r, g, b, a; + private Timer fadeTimer; public void setImageForeground(String name) { - try { - imageForeground = ImageIO.read(new File("src/main/resources/" + name + ".png")); - } catch (IOException e) { - e.printStackTrace(); + if (name == null) imageForeground = null; + else { + try { + imageForeground = ImageIO.read(new File("src/main/resources/" + name + ".png")); + } catch (IOException e) { + e.printStackTrace(); + } } } + public void setColorForeground(int r, int g, int b, int a) { + this.r = r; + this.g = g; + this.b = b; + this.a = a; + } + + public void fade(int startAlpha, int endAlpha, int delay) { + a = startAlpha; + fadeTimer = new Timer(delay, actionEvent -> { + if (a == endAlpha) stopTimer(); + else if (startAlpha < endAlpha) { + a += 5; + } + else { + a -= 5; + } + }); + fadeTimer.start(); + } + + private void stopTimer() { + fadeTimer.stop(); + } + + @Override - public void paint(Graphics g) { - g.drawImage(imageForeground, 0, 0, WindowOfFreeMove.CELL_SIZE * WindowOfFreeMove.WINDOW_WIDTH, - WindowOfFreeMove.CELL_SIZE * WindowOfFreeMove.WINDOW_HEIGHT, this); + public void paint(Graphics gr) { + if (imageForeground != null) + gr.drawImage(imageForeground, 0, 0, CELL_SIZE * WINDOW_WIDTH, + CELL_SIZE * WINDOW_HEIGHT, this); + else { + gr.setColor(new Color(r, g, b, a)); + gr.fillRect(0, 0, CELL_SIZE * WINDOW_WIDTH, + CELL_SIZE * WINDOW_HEIGHT); + } } } diff --git a/src/main/java/ruscz/game/gameOfProd/Windows/WindowOfMenu.java b/src/main/java/ruscz/game/gameOfProd/Windows/WindowOfMenu.java index 9040cdb..4cab1fe 100644 --- a/src/main/java/ruscz/game/gameOfProd/Windows/WindowOfMenu.java +++ b/src/main/java/ruscz/game/gameOfProd/Windows/WindowOfMenu.java @@ -1,13 +1,15 @@ package ruscz.game.gameOfProd.Windows; import ruscz.game.gameOfProd.Game; +import ruscz.game.gameOfProd.LevelEditor.LevelEditor; +import ruscz.game.gameOfProd.Save.LoadManager; import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.awt.image.BufferedImage; -public class WindowOfMenu extends JLayeredPane { +public class WindowOfMenu extends JPanel { public static final int WINDOW_WIDTH = 13; public static final int WINDOW_HEIGHT = 13; public static final int CELL_SIZE = 50; @@ -16,15 +18,17 @@ public class WindowOfMenu extends JLayeredPane { private WindowOfFreeMove freeMove; private JButton startNewGame; private JButton loadSavedGame; + private JButton startLevelEditor; private JButton exitGame; + private Dimension screenSize; public WindowOfMenu(Game game) { this.game = game; this.freeMove = game.getFreeMove(); + screenSize = Toolkit.getDefaultToolkit().getScreenSize(); startNewGame = new JButton("START NEW GAME"); - //startNewGame.setFocusable(false); - startNewGame.setBounds((WINDOW_WIDTH*CELL_SIZE - 200) / 2,(WINDOW_HEIGHT*CELL_SIZE - 30) / 2 -70,200,30); + startNewGame.setBounds((screenSize.width - 200) / 2,(screenSize.height - 30) / 2 -150,200,30); startNewGame.addActionListener(actionEvent -> { cleanUp(); game.add(freeMove); @@ -33,8 +37,8 @@ public class WindowOfMenu extends JLayeredPane { }); loadSavedGame = new JButton("LOAD SAVED GAME"); - //loadSavedGame.setFocusable(false); - loadSavedGame.setBounds((WINDOW_WIDTH*CELL_SIZE - 200) / 2,(WINDOW_HEIGHT*CELL_SIZE - 30) / 2,200,30); + loadSavedGame.setBounds((screenSize.width - 200) / 2,(screenSize.height - 30) / 2 - 70,200,30); + if (LoadManager.isSaveEmpty()) loadSavedGame.setEnabled(false); loadSavedGame.addActionListener(actionEvent -> { cleanUp(); game.add(freeMove); @@ -42,13 +46,23 @@ public class WindowOfMenu extends JLayeredPane { freeMove.start(false); }); + startLevelEditor = new JButton("START LEVEL EDITOR"); + startLevelEditor.setBounds((screenSize.width - 200) / 2,(screenSize.height - 30) / 2,200,30); + startLevelEditor.addActionListener(actionEvent -> { + new LevelEditor(); + }); + exitGame = new JButton("EXIT GAME"); - exitGame.setBounds((WINDOW_WIDTH*CELL_SIZE - 200) / 2,(WINDOW_HEIGHT*CELL_SIZE - 30) / 2 + 70,200,30); + exitGame.setBounds((screenSize.width - 200) / 2,(screenSize.height - 30) / 2 + 70,200,30); exitGame.addActionListener(actionEvent -> game.dispatchEvent(new WindowEvent(game, WindowEvent.WINDOW_CLOSING))); add(startNewGame); add(loadSavedGame); + add(startLevelEditor); add(exitGame); + + setLayout(null); + setBackground(Color.BLACK); } private void cleanUp() { diff --git a/src/main/resources/chests/kitchen.txt b/src/main/resources/chests/kitchen.txt new file mode 100644 index 0000000..3dc03e6 --- /dev/null +++ b/src/main/resources/chests/kitchen.txt @@ -0,0 +1 @@ +cup-o'-coffee 295 heal \ No newline at end of file diff --git a/src/main/resources/dialogs/cutscenes/cutscene-end.txt b/src/main/resources/dialogs/cutscenes/cutscene-end.txt new file mode 100644 index 0000000..1f21e08 --- /dev/null +++ b/src/main/resources/dialogs/cutscenes/cutscene-end.txt @@ -0,0 +1,23 @@ +<1> false +<1> color 0 0 0 0 +<1> fade 0 255 1 +<1> end +<3> Later-that-evening... +<5> null +<5> +<5> color 0 0 0 100 +<8> end1 +<9> image main-face.png +<9> Well...-so-much-for-a-working-map... +<12> null +<12> end2 +<13> What-is-that? +<15> null +<15> end3 +<16> Are-those-eyes? +<18> null +<18> end4 +<18> image null +<18> voice voice6 +<18> fast 01110000-01110101-01100010-01101100-01101001
01100011-00100000-01100011-01101100-01100001
01110011-01110011-00100000-01001101-01100101
01110011-01110011-01100001-01100111-0110010100100000-01111011-00001010-00001010-00100000
00100000-00100000-00100000-01110000-01110101
01100010-01101100-01101001-01100011-00100000
01110011-01110100-01100001-01110100-0110100101100011-00100000-01110110-01101111-01101001
01100100-00100000-01101101-01100001-01101001
01101110-00101000-01010011-01110100-01110010
01101001-01101110-01100111-01011011-0101110100100000-01100001-01110010-01100111-01110011
00101001-00100000-01111011-00001010-00100000
00100000-00100000-00100000-00100000-00100000
00100000-00100000-01010011-01111001-0111001101110100-01100101-01101101-00101110-01101111
01110101-01110100-00101110-01110000-01110010
01101001-01101110-01110100-01101100-01101110
00101000-00100010-01001001-00100010-0010100100111011-00001010-00100000-00100000-00100000
00100000-00100000-00100000-00100000-00100000
01010011-01111001-01110011-01110100-01100101
01101101-00101110-01101111-01110101-0111010000101110-01110000-01110010-01101001-01101110
01110100-01101100-01101110-00101000-00100010
01000011-00100010-00101001-00111011-00001010
00100000-00100000-00100000-00100000-0010000000100000-00100000-00100000-01010011-01111001
01110011-01110100-01100101-01101101-00101110
01101111-01110101-01110100-00101110-01110000
01110010-01101001-01101110-01110100-0110110001101110-00101000-00100010-01010101-00100010
00101001-00111011-00001010-00100000-00100000
00100000-00100000-01111101-00001010-01111101 +<25> \ No newline at end of file diff --git a/src/main/resources/dialogs/cutscenes/cutscene-error.txt b/src/main/resources/dialogs/cutscenes/cutscene-error.txt index 0e8a278..1b31ef7 100644 --- a/src/main/resources/dialogs/cutscenes/cutscene-error.txt +++ b/src/main/resources/dialogs/cutscenes/cutscene-error.txt @@ -7,5 +7,5 @@ <6> I-have-to-take-a-break.-It's-lunch-time-anyway. <10> null <10> true -<11> +<11> start <11> \ No newline at end of file diff --git a/src/main/resources/dialogs/cutscenes/cutscene-work.txt b/src/main/resources/dialogs/cutscenes/cutscene-work.txt deleted file mode 100644 index 620b8e3..0000000 --- a/src/main/resources/dialogs/cutscenes/cutscene-work.txt +++ /dev/null @@ -1,4 +0,0 @@ -<1> test -<3> null -<3> -<3> \ No newline at end of file diff --git a/src/main/resources/dialogs/empty.txt b/src/main/resources/dialogs/empty.txt index 8e6200f..7fed070 100644 --- a/src/main/resources/dialogs/empty.txt +++ b/src/main/resources/dialogs/empty.txt @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/main/resources/dialogs/ohhimark.txt b/src/main/resources/dialogs/ohhimark.txt index cddd546..d8c40be 100644 --- a/src/main/resources/dialogs/ohhimark.txt +++ b/src/main/resources/dialogs/ohhimark.txt @@ -1,4 +1,4 @@ - 100 0 35 + 140 0 35 boss-face.png voice4 diff --git a/src/main/resources/end1.png b/src/main/resources/end1.png new file mode 100644 index 0000000..e5f34f3 Binary files /dev/null and b/src/main/resources/end1.png differ diff --git a/src/main/resources/end2.png b/src/main/resources/end2.png new file mode 100644 index 0000000..02caa5a Binary files /dev/null and b/src/main/resources/end2.png differ diff --git a/src/main/resources/end3.png b/src/main/resources/end3.png new file mode 100644 index 0000000..24abf4c Binary files /dev/null and b/src/main/resources/end3.png differ diff --git a/src/main/resources/end4.png b/src/main/resources/end4.png new file mode 100644 index 0000000..f7a769f Binary files /dev/null and b/src/main/resources/end4.png differ diff --git a/src/main/resources/maps/0/office-objectset.txt b/src/main/resources/maps/0/office-objectset.txt index 038cb82..5ffc313 100644 --- a/src/main/resources/maps/0/office-objectset.txt +++ b/src/main/resources/maps/0/office-objectset.txt @@ -1,7 +1,8 @@ 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 8 -0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 373 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 diff --git a/src/main/resources/maps/0/office.txt b/src/main/resources/maps/0/office.txt index 9f525c2..6ca0377 100644 --- a/src/main/resources/maps/0/office.txt +++ b/src/main/resources/maps/0/office.txt @@ -2,8 +2,8 @@ BLOCK,d BLOCK,d BLOCK,d BLOCK,d EMPTY BLOCK,d BLOCK,d BLOCK,d BLOCK,d BLOCK,d BLOCK,d BLOCK,d BLOCK,d BLOCK,d BLOCK,d BLOCK,d BLOCK,d BLOCK,d BLOCK,d BLOCK,d BLOCK BLOCK BLOCK BLOCK DOORTO,true,0,3,boss BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK DOOR,true,locked BLOCK BLOCK BLOCK BLOCK DOOR,true,locked BLOCK BLOCK BLOCK EMPTY EMPTY EMPTY TRIGGER,nextstep,false EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK -BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY block -BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY block BLOCK +BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY +BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK EMPTY EMPTY EMPTY BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK EMPTY moveto,1,2,openspace EMPTY EMPTY EMPTY EMPTY BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK EMPTY moveto,2,2,openspace EMPTY EMPTY EMPTY EMPTY BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK diff --git a/src/main/resources/maps/0/openspace-objectset.txt b/src/main/resources/maps/0/openspace-objectset.txt index 1bc5753..6de620b 100644 --- a/src/main/resources/maps/0/openspace-objectset.txt +++ b/src/main/resources/maps/0/openspace-objectset.txt @@ -1,6 +1,6 @@ 0 0 198 214 0 0 0 0 0 0 0 0 0 0 0 410 426 0 0 0 0 753 199 215 0 0 0 244 0 0 0 0 0 0 0 411 427 0 0 0 -0 753 0 0 0 0 0 245 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 245 0 0 0 0 0 0 0 0 0 0 0 0 0 754 0 0 0 0 0 246 0 0 0 0 0 0 0 720 752 0 0 8 0 373 0 0 0 0 0 0 0 0 0 0 0 0 423 721 753 439 0 8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 423 721 753 439 0 8 diff --git a/src/main/resources/maps/0/openspace-tileset.txt b/src/main/resources/maps/0/openspace-tileset.txt index 8ebe1d8..7cde6fc 100644 --- a/src/main/resources/maps/0/openspace-tileset.txt +++ b/src/main/resources/maps/0/openspace-tileset.txt @@ -7,6 +7,7 @@ MOVETO 1 EVENT 0 TRIGGER 4 + CHEST 254 DOOR dark-door.png,32 DOOR qubodup-DoorOpen01-changed.wav qubodup-DoorClose02-changed.wav doorLocked.wav 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/openspace.txt b/src/main/resources/maps/0/openspace.txt index 6e34227..eca6bac 100644 --- a/src/main/resources/maps/0/openspace.txt +++ b/src/main/resources/maps/0/openspace.txt @@ -1,7 +1,7 @@ 20 27 BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK block block block EMPTY block block block BLOCK EMPTY EMPTY EMPTY BLOCK EMPTY EMPTY inter,laugh inter,laugh EMPTY EMPTY BLOCK -BLOCK block EMPTY EMPTY EMPTY EMPTY EMPTY block BLOCK EMPTY EMPTY EMPTY BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK +BLOCK CHEST,kitchen,true EMPTY EMPTY EMPTY EMPTY EMPTY block BLOCK EMPTY EMPTY EMPTY BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK BLOCK block EMPTY EMPTY EMPTY EMPTY EMPTY block BLOCK,u EMPTY EMPTY EMPTY BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY block BLOCK block EMPTY EMPTY EMPTY EMPTY TRIGGER,dialog EMPTY DOOR,false EMPTY EMPTY EMPTY BLOCK EMPTY block block block block EMPTY block BLOCK BLOCK,d EMPTY BLOCK,d BLOCK,d BLOCK,d EMPTY BLOCK,d BLOCK EMPTY EMPTY EMPTY BLOCK EMPTY block block block block EMPTY block @@ -15,14 +15,14 @@ BLOCK EMPTY block block inter,minecraft block block EMPTY BLOCK,u EMPTY EMPTY EM BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY DOOR,false EMPTY EMPTY EMPTY EMPTY EMPTY block block EMPTY block block block BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY block BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK EMPTY moveto,1,2,office EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK -BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK EMPTY moveto,2,2,office EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY TRIGGER,cutscene-work,false block EMPTY block EMPTY BLOCK +BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK EMPTY moveto,2,2,office EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY TRIGGER,cutscene-end,false block EMPTY block EMPTY BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY block block EMPTY block block block BLOCK block EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY block BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY block -BLOCK EMPTY block EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY block EMPTY EMPTY block EMPTY block EMPTY BLOCK +BLOCK EMPTY block EMPTY EMPTY block EMPTY EMPTY block EMPTY EMPTY EMPTY block EMPTY EMPTY block EMPTY block EMPTY BLOCK BLOCK block block EMPTY block block EMPTY block block EMPTY EMPTY block block EMPTY block block EMPTY block block BLOCK BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY block BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY block -BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY block EMPTY EMPTY EMPTY EMPTY block EMPTY block EMPTY EMPTY EMPTY block block +BLOCK EMPTY block EMPTY block EMPTY EMPTY block EMPTY EMPTY EMPTY EMPTY block EMPTY block EMPTY EMPTY EMPTY block block BLOCK block block EMPTY block block EMPTY block block EMPTY EMPTY block block EMPTY block block EMPTY block block BLOCK BLOCK BLOCK block block block BLOCK block 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/maps/0/treasure-tileset.txt b/src/main/resources/maps/0/treasure-tileset.txt index faaa2ad..dda91a7 100644 --- a/src/main/resources/maps/0/treasure-tileset.txt +++ b/src/main/resources/maps/0/treasure-tileset.txt @@ -1,4 +1,4 @@ - CertificateOfShame.png + CertificateOfShame.png 50 BLOCK 0 MOVETO 0 EVENT 0 diff --git a/src/main/resources/save/savedGame/events.txt b/src/main/resources/save/savedGame/events.txt index 86e28da..f537083 100644 --- a/src/main/resources/save/savedGame/events.txt +++ b/src/main/resources/save/savedGame/events.txt @@ -1,15 +1,70 @@ - m1 - - - - - m6 + tutorial 11 - 11 + 6 false + + openspace + + + 6 + 4 + false + + + 14 + 16 + true + + + 1 + 2 + true + + + 15 + 7 + true + + + + + office + + + 4 + 2 + false + + + 1 + 9 + true + + + + + boss + + + 4 + 18 + false + + + + + treasure + + + 6 + 1 + true + + + diff --git a/src/main/resources/save/savedGame/person.txt b/src/main/resources/save/savedGame/person.txt index 43cfc91..f083d14 100644 --- a/src/main/resources/save/savedGame/person.txt +++ b/src/main/resources/save/savedGame/person.txt @@ -1,6 +1,6 @@ - m1 - 3 - 7 - 2 + openspace + 8 + 15 + 3 \ No newline at end of file diff --git a/src/main/resources/sounds/voice6.wav b/src/main/resources/sounds/voice6.wav new file mode 100644 index 0000000..655c936 Binary files /dev/null and b/src/main/resources/sounds/voice6.wav differ diff --git a/src/main/resources/tilesets/Openspace1.png b/src/main/resources/tilesets/Openspace1.png index f8b17ce..a113a0c 100644 Binary files a/src/main/resources/tilesets/Openspace1.png and b/src/main/resources/tilesets/Openspace1.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 fa9aa1b..69f6aea 100644 --- a/src/test/java/ruscz/game/gameOfProd/LevelEditor/LevelEditorTest.java +++ b/src/test/java/ruscz/game/gameOfProd/LevelEditor/LevelEditorTest.java @@ -48,7 +48,7 @@ public class LevelEditorTest { imageCell = new ImageCell(); for (String tileset : tilesets) { activeTilesets.add(tileset); - imageCell.imageTileset(tileset); + imageCell.imageTileset(new String[]{tileset}); } tilesetOverview.setActiveTilesets(activeTilesets); tilesetOverview.generateOverview();