added ending cutscene & fixed some stuff

This commit is contained in:
musilto9 2020-06-02 01:38:20 +02:00
parent 63f4c07685
commit c134d5e1d9
29 changed files with 282 additions and 88 deletions

View File

@ -11,6 +11,7 @@ import ruscz.game.gameOfProd.Windows.WindowOfFreeMove;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.awt.event.WindowEvent;
import java.io.File; import java.io.File;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.util.Objects; import java.util.Objects;
@ -25,6 +26,7 @@ public class InteractionCell extends Cell {
private WindowOfFreeMove window; private WindowOfFreeMove window;
protected boolean paint; protected boolean paint;
private Timer timer; private Timer timer;
private Timer textTimer;
public InteractionCell(int x, int y, String message, Dialog dialog, Map map, WindowOfFreeMove window, boolean paint) { public InteractionCell(int x, int y, String message, Dialog dialog, Map map, WindowOfFreeMove window, boolean paint) {
super(x, y, WindowOfFreeMove.CELL_SIZE, Color.ORANGE); super(x, y, WindowOfFreeMove.CELL_SIZE, Color.ORANGE);
@ -231,20 +233,69 @@ public class InteractionCell extends Cell {
if (data[0].contains("<" + i + ">")) { if (data[0].contains("<" + i + ">")) {
if (data[1].contains("<text>")) { if (data[1].contains("<text>")) {
if (data[2].equals("null")) dialog.hideText(); 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("<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("<br/>")) {
texts[j[0]] = "<html>" + texts[j[0]] + "</html>";
}
dialog.setText(texts[j[0]]);
dialog.showFastText();
j[0]++;
}
});
textTimer.start();
}
else { else {
dialog.setText(data[2].replaceAll("-", " ")); String text = data[2].replaceAll("-", " ");
if (text.contains("<br/>")) {
text = "<html>" + text + "</html>";
}
dialog.setText(text);
dialog.showText(); dialog.showText();
} }
} }
else if (data[1].contains("<foreground>")) { else if (data[1].contains("<foreground>")) {
if (data[2].equals("null")) window.getForegroundPanel().setVisible(false); 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 { else {
window.getForegroundPanel().setImageForeground(data[2]); window.getForegroundPanel().setImageForeground(data[2]);
window.getForegroundPanel().setVisible(true); window.getForegroundPanel().setVisible(true);
} }
} }
else if (data[1].contains("<personmove")) { else if (data[1].contains("<personmove>")) {
WindowOfFreeMove.setCanPersonMove(Boolean.parseBoolean(data[2])); WindowOfFreeMove.setCanPersonMove(Boolean.parseBoolean(data[2]));
if (Boolean.parseBoolean(data[2])) endEvent();
} }
else if (data[1].contains("<moveto>")) { else if (data[1].contains("<moveto>")) {
Map map = Map.findMapByName(data[2], window); Map map = Map.findMapByName(data[2], window);
@ -254,10 +305,20 @@ public class InteractionCell extends Cell {
map.setIdExit(0); map.setIdExit(0);
} }
else if (data[1].equals("<music>")) { else if (data[1].equals("<music>")) {
window.getMusicManager().playMusic(); if (data[2].equals("start")) {
window.getMusicManager().fadeIn(10); window.getMusicManager().playMusic();
window.getMusicManager().fadeIn(10);
}
else {
window.getMusicManager().fadeOut(10);
}
} }
else if (data[1].equals("<removenpcs>")) window.getMapManager().getActualMap().getNpcs().clear();
else if (data[1].equals("<loadnextchapter>")) window.loadNextChapter(); else if (data[1].equals("<loadnextchapter>")) window.loadNextChapter();
else if (data[1].equals("<closegame>")) {
// window.getMapManager().getLoadManager().clearSave();
window.getGame().dispatchEvent(new WindowEvent(window.getGame(), WindowEvent.WINDOW_CLOSING));
}
else if (data[1].equals("<end>")) { else if (data[1].equals("<end>")) {
timer.stop(); timer.stop();
} }
@ -268,6 +329,10 @@ public class InteractionCell extends Cell {
} }
} }
private void stopTextTimer() {
textTimer.stop();
}
public void useItem(Item item) { public void useItem(Item item) {
InventoryManager.removeItem(item, 1); InventoryManager.removeItem(item, 1);
} }

View File

@ -6,8 +6,6 @@ import ruscz.game.gameOfProd.Windows.WindowOfFreeMove;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class Dialog { public class Dialog {
private String text; private String text;
@ -21,21 +19,6 @@ public class Dialog {
private String voice; private String voice;
private boolean voiceover; 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) { public Dialog(DialogBar dialogBar) {
this.dialogBar = dialogBar; this.dialogBar = dialogBar;
charNumber = 0; charNumber = 0;
@ -87,19 +70,29 @@ public class Dialog {
if (text.contains("<html>")) if (text.contains("<html>"))
charNumber = 6; charNumber = 6;
dialogBar.setVisible(true); dialogBar.setVisible(true);
timer = new Timer(30, new ActionListener() { timer = new Timer(30, e -> {
@Override if (voiceover)
public void actionPerformed(ActionEvent e) { soundManager.playSound(voice + ".wav", -20.0f);
if (voiceover) showByChar();
soundManager.playSound(voice + ".wav", -20.0f); timerIsRunning = timer.isRunning();
showByChar();
dialogBar.repaint();
timerIsRunning = timer.isRunning();
}
}); });
timer.start(); timer.start();
} }
public void showFastText() {
charNumber = 0;
if (text.contains("<html>"))
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() { public void skipShowText() {
timer.stop(); timer.stop();
timerIsRunning = false; timerIsRunning = false;
@ -138,9 +131,5 @@ public class Dialog {
public SoundManager getSoundManager() { return soundManager; } public SoundManager getSoundManager() { return soundManager; }
public void setVoiceover(boolean voiceover) { this.voiceover = voiceover; } public void setVoiceover(boolean voiceover) { this.voiceover = voiceover; }
public boolean isTimerIsRunning() {
return timerIsRunning;
}
} }

View File

@ -40,10 +40,10 @@ public class Game extends JFrame {
battle = new WindowOfBattle(this); battle = new WindowOfBattle(this);
//tohle spustí na začátku menu //tohle spustí na začátku menu
// add(menu); add(menu);
//tohle spustí na začátku hru //tohle spustí na začátku hru
add(freeMove); // add(freeMove);
// freeMove.start(true); // freeMove.start(true);
//tohle spustí na začátku bitvu //tohle spustí na začátku bitvu
@ -55,7 +55,6 @@ public class Game extends JFrame {
setDefaultCloseOperation(EXIT_ON_CLOSE); setDefaultCloseOperation(EXIT_ON_CLOSE);
setUndecorated(true); setUndecorated(true);
setBounds(0, 0, CELL_SIZE * WINDOW_WIDTH, CELL_SIZE * WINDOW_HEIGHT);
setLocationRelativeTo(null); setLocationRelativeTo(null);
setResizable(false); setResizable(false);
setVisible(true); setVisible(true);

View File

@ -37,7 +37,7 @@ public class ImageCell {
String data = scanner.nextLine(); String data = scanner.nextLine();
if (data.contains("<tileset>")) { if (data.contains("<tileset>")) {
String[] mapInfo = data.split(" "); String[] mapInfo = data.split(" ");
imageTileset(mapInfo[1]); imageTileset(mapInfo);
} }
else if (data.contains("<items>")) { else if (data.contains("<items>")) {
String[] mapInfo = data.split(" "); String[] mapInfo = data.split(" ");
@ -62,16 +62,18 @@ public class ImageCell {
} }
} }
public void imageTileset(String tilesetInfo) { public void imageTileset(String[] tilesetInfo) {
try { 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) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
int width = image.getWidth(); int width = image.getWidth();
int height = image.getHeight(); 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 Xtiles = width / tileSize;
int Ytiles = height / tileSize; int Ytiles = height / tileSize;

View File

@ -26,6 +26,13 @@ public class LoadManager {
this.window = mapManager.getWindow(); 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() { public void loadNewGame() {
loadMaps(); loadMaps();
loadNpcs(); loadNpcs();

View File

@ -65,7 +65,6 @@ public class MusicManager {
else { else {
stopMusic(); stopMusic();
} }
System.out.println(volume);
}); });
timerIn.stop(); timerIn.stop();
timerOut.start(); timerOut.start();

View File

@ -104,6 +104,10 @@ public class WindowOfFreeMove extends JLayeredPane {
public MusicManager getMusicManager() { return musicManager; } public MusicManager getMusicManager() { return musicManager; }
public JFrame getGame() {
return game;
}
public WindowOfFreeMove(JFrame game) { public WindowOfFreeMove(JFrame game) {
this.game = game; this.game = game;
isReadyToPaint = false; isReadyToPaint = false;
@ -180,17 +184,18 @@ public class WindowOfFreeMove extends JLayeredPane {
mapManager.getLoadManager().loadNewGame(); mapManager.getLoadManager().loadNewGame();
Map firstMap = Map.findMapByName(Map.getMapWithSpawn(), this); Map firstMap = Map.findMapByName(Map.getMapWithSpawn(), this);
setMapManager(firstMap); setMapManager(firstMap);
musicManager = new MusicManager("Town3.wav", -25.0f);
} }
else { else {
mapManager.getLoadManager().loadSavedGame(); mapManager.getLoadManager().loadSavedGame();
musicManager = new MusicManager("Town3.wav", -25.0f);
musicManager.playMusic();
musicManager.fadeIn(10);
} }
mapManager.createMap(); mapManager.createMap();
isReadyToPaint = true; isReadyToPaint = true;
musicManager = new MusicManager("Town3.wav", -25.0f);
// musicManager.playMusic();
Timer timer = new Timer(10, actionEvent -> { Timer timer = new Timer(10, actionEvent -> {
mapManager.getActualMap().getPerson().move(); mapManager.getActualMap().getPerson().move();
camera.moveCamera(); camera.moveCamera();
@ -248,7 +253,7 @@ public class WindowOfFreeMove extends JLayeredPane {
for (Person person : mapManager.getActualMap().getNpcs()) { for (Person person : mapManager.getActualMap().getNpcs()) {
if (person.getY() == i) person.paint(g2D); 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); mapManager.getActualMap().getImageCell().paintForeground(g2D, j, i);
} }
for (ChestCell cell : mapManager.getActualMap().getChestCells()) { for (ChestCell cell : mapManager.getActualMap().getChestCells()) {
@ -260,20 +265,57 @@ public class WindowOfFreeMove extends JLayeredPane {
} }
public class Foreground extends JPanel { public class Foreground extends JPanel {
Image imageForeground; private Image imageForeground;
private int r, g, b, a;
private Timer fadeTimer;
public void setImageForeground(String name) { public void setImageForeground(String name) {
try { if (name == null) imageForeground = null;
imageForeground = ImageIO.read(new File("src/main/resources/" + name + ".png")); else {
} catch (IOException e) { try {
e.printStackTrace(); 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 @Override
public void paint(Graphics g) { public void paint(Graphics gr) {
g.drawImage(imageForeground, 0, 0, WindowOfFreeMove.CELL_SIZE * WindowOfFreeMove.WINDOW_WIDTH, if (imageForeground != null)
WindowOfFreeMove.CELL_SIZE * WindowOfFreeMove.WINDOW_HEIGHT, this); 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);
}
} }
} }

View File

@ -1,13 +1,15 @@
package ruscz.game.gameOfProd.Windows; package ruscz.game.gameOfProd.Windows;
import ruscz.game.gameOfProd.Game; import ruscz.game.gameOfProd.Game;
import ruscz.game.gameOfProd.LevelEditor.LevelEditor;
import ruscz.game.gameOfProd.Save.LoadManager;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.awt.event.*; import java.awt.event.*;
import java.awt.image.BufferedImage; 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_WIDTH = 13;
public static final int WINDOW_HEIGHT = 13; public static final int WINDOW_HEIGHT = 13;
public static final int CELL_SIZE = 50; public static final int CELL_SIZE = 50;
@ -16,15 +18,17 @@ public class WindowOfMenu extends JLayeredPane {
private WindowOfFreeMove freeMove; private WindowOfFreeMove freeMove;
private JButton startNewGame; private JButton startNewGame;
private JButton loadSavedGame; private JButton loadSavedGame;
private JButton startLevelEditor;
private JButton exitGame; private JButton exitGame;
private Dimension screenSize;
public WindowOfMenu(Game game) { public WindowOfMenu(Game game) {
this.game = game; this.game = game;
this.freeMove = game.getFreeMove(); this.freeMove = game.getFreeMove();
screenSize = Toolkit.getDefaultToolkit().getScreenSize();
startNewGame = new JButton("START NEW GAME"); startNewGame = new JButton("START NEW GAME");
//startNewGame.setFocusable(false); startNewGame.setBounds((screenSize.width - 200) / 2,(screenSize.height - 30) / 2 -150,200,30);
startNewGame.setBounds((WINDOW_WIDTH*CELL_SIZE - 200) / 2,(WINDOW_HEIGHT*CELL_SIZE - 30) / 2 -70,200,30);
startNewGame.addActionListener(actionEvent -> { startNewGame.addActionListener(actionEvent -> {
cleanUp(); cleanUp();
game.add(freeMove); game.add(freeMove);
@ -33,8 +37,8 @@ public class WindowOfMenu extends JLayeredPane {
}); });
loadSavedGame = new JButton("LOAD SAVED GAME"); loadSavedGame = new JButton("LOAD SAVED GAME");
//loadSavedGame.setFocusable(false); loadSavedGame.setBounds((screenSize.width - 200) / 2,(screenSize.height - 30) / 2 - 70,200,30);
loadSavedGame.setBounds((WINDOW_WIDTH*CELL_SIZE - 200) / 2,(WINDOW_HEIGHT*CELL_SIZE - 30) / 2,200,30); if (LoadManager.isSaveEmpty()) loadSavedGame.setEnabled(false);
loadSavedGame.addActionListener(actionEvent -> { loadSavedGame.addActionListener(actionEvent -> {
cleanUp(); cleanUp();
game.add(freeMove); game.add(freeMove);
@ -42,13 +46,23 @@ public class WindowOfMenu extends JLayeredPane {
freeMove.start(false); 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 = 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))); exitGame.addActionListener(actionEvent -> game.dispatchEvent(new WindowEvent(game, WindowEvent.WINDOW_CLOSING)));
add(startNewGame); add(startNewGame);
add(loadSavedGame); add(loadSavedGame);
add(startLevelEditor);
add(exitGame); add(exitGame);
setLayout(null);
setBackground(Color.BLACK);
} }
private void cleanUp() { private void cleanUp() {

View File

@ -0,0 +1 @@
cup-o'-coffee 295 heal

View File

@ -0,0 +1,23 @@
<1> <personmove> false
<1> <foreground> color 0 0 0 0
<1> <foreground> fade 0 255 1
<1> <music> end
<3> <text> Later-that-evening...
<5> <text> null
<5> <removenpcs>
<5> <foreground> color 0 0 0 100
<8> <foreground> end1
<9> <text> image main-face.png
<9> <text> Well...-so-much-for-a-working-map...
<12> <text> null
<12> <foreground> end2
<13> <text> What-is-that?
<15> <text> null
<15> <foreground> end3
<16> <text> Are-those-eyes?
<18> <text> null
<18> <foreground> end4
<18> <text> image null
<18> <text> voice voice6
<18> <text> fast 01110000-01110101-01100010-01101100-01101001<br/>01100011-00100000-01100011-01101100-01100001<br/>01110011-01110011-00100000-01001101-01100101<br/>01110011-01110011-01100001-01100111-01100101<split>00100000-01111011-00001010-00001010-00100000<br/>00100000-00100000-00100000-01110000-01110101<br/>01100010-01101100-01101001-01100011-00100000<br/>01110011-01110100-01100001-01110100-01101001<split>01100011-00100000-01110110-01101111-01101001<br/>01100100-00100000-01101101-01100001-01101001<br/>01101110-00101000-01010011-01110100-01110010<br/>01101001-01101110-01100111-01011011-01011101<split>00100000-01100001-01110010-01100111-01110011<br/>00101001-00100000-01111011-00001010-00100000<br/>00100000-00100000-00100000-00100000-00100000<br/>00100000-00100000-01010011-01111001-01110011<split>01110100-01100101-01101101-00101110-01101111<br/>01110101-01110100-00101110-01110000-01110010<br/>01101001-01101110-01110100-01101100-01101110<br/>00101000-00100010-01001001-00100010-00101001<split>00111011-00001010-00100000-00100000-00100000<br/>00100000-00100000-00100000-00100000-00100000<br/>01010011-01111001-01110011-01110100-01100101<br/>01101101-00101110-01101111-01110101-01110100<split>00101110-01110000-01110010-01101001-01101110<br/>01110100-01101100-01101110-00101000-00100010<br/>01000011-00100010-00101001-00111011-00001010<br/>00100000-00100000-00100000-00100000-00100000<split>00100000-00100000-00100000-01010011-01111001<br/>01110011-01110100-01100101-01101101-00101110<br/>01101111-01110101-01110100-00101110-01110000<br/>01110010-01101001-01101110-01110100-01101100<split>01101110-00101000-00100010-01010101-00100010<br/>00101001-00111011-00001010-00100000-00100000<br/>00100000-00100000-01111101-00001010-01111101
<25> <closegame>

View File

@ -7,5 +7,5 @@
<6> <text> I-have-to-take-a-break.-It's-lunch-time-anyway. <6> <text> I-have-to-take-a-break.-It's-lunch-time-anyway.
<10> <text> null <10> <text> null
<10> <personmove> true <10> <personmove> true
<11> <music> <11> <music> start
<11> <end> <11> <end>

View File

@ -1,4 +0,0 @@
<1> <text> test
<3> <text> null
<3> <loadnextchapter>
<3> <end>

View File

@ -1 +1 @@
<end> <wait>

View File

@ -1,4 +1,4 @@
<cameraFree> 100 0 35 <cameraFree> 140 0 35
<wait> <wait>
<image> boss-face.png <image> boss-face.png
<voice> voice4 <voice> voice4

BIN
src/main/resources/end1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 KiB

BIN
src/main/resources/end2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 KiB

BIN
src/main/resources/end3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 KiB

BIN
src/main/resources/end4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 KiB

View File

@ -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 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 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 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

View File

@ -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,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 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 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 EMPTY EMPTY
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 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 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,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 BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK EMPTY moveto,2,2,openspace EMPTY EMPTY EMPTY EMPTY BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK

View File

@ -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 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 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 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 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 423 721 753 439 0 8

View File

@ -7,6 +7,7 @@
<cellmap> MOVETO 1 <cellmap> MOVETO 1
<cellmap> EVENT 0 <cellmap> EVENT 0
<cellmap> TRIGGER 4 <cellmap> TRIGGER 4
<cellmap> CHEST 254
<cellmap> DOOR dark-door.png,32 <cellmap> DOOR dark-door.png,32
<soundmap> DOOR qubodup-DoorOpen01-changed.wav qubodup-DoorClose02-changed.wav doorLocked.wav <soundmap> 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 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

View File

@ -1,7 +1,7 @@
20 27 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 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 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 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 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 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 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 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,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 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 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 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 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 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 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 BLOCK BLOCK block block block BLOCK block block block BLOCK BLOCK block block block BLOCK block block block BLOCK BLOCK

View File

@ -1,4 +1,4 @@
<tileset> CertificateOfShame.png <tileset> CertificateOfShame.png 50
<cellmap> BLOCK 0 <cellmap> BLOCK 0
<cellmap> MOVETO 0 <cellmap> MOVETO 0
<cellmap> EVENT 0 <cellmap> EVENT 0

View File

@ -1,15 +1,70 @@
<map> <map>
<mapName>m1</mapName> <mapName>tutorial</mapName>
<events>
</events>
</map>
<map>
<mapName>m6</mapName>
<events> <events>
<trigger> <trigger>
<x>11</x> <x>11</x>
<y>11</y> <y>6</y>
<active>false</active> <active>false</active>
</trigger> </trigger>
</events> </events>
</map> </map>
<map>
<mapName>openspace</mapName>
<events>
<trigger>
<x>6</x>
<y>4</y>
<active>false</active>
</trigger>
<trigger>
<x>14</x>
<y>16</y>
<active>true</active>
</trigger>
<chest>
<x>1</x>
<y>2</y>
<active>true</active>
</chest>
<chest>
<x>15</x>
<y>7</y>
<active>true</active>
</chest>
</events>
</map>
<map>
<mapName>office</mapName>
<events>
<trigger>
<x>4</x>
<y>2</y>
<active>false</active>
</trigger>
<chest>
<x>1</x>
<y>9</y>
<active>true</active>
</chest>
</events>
</map>
<map>
<mapName>boss</mapName>
<events>
<trigger>
<x>4</x>
<y>18</y>
<active>false</active>
</trigger>
</events>
</map>
<map>
<mapName>treasure</mapName>
<events>
<trigger>
<x>6</x>
<y>1</y>
<active>true</active>
</trigger>
</events>
</map>

View File

@ -1,6 +1,6 @@
<location> <location>
<map>m1</map> <map>openspace</map>
<x>3</x> <x>8</x>
<y>7</y> <y>15</y>
<direction>2</direction> <direction>3</direction>
</location> </location>

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

View File

@ -48,7 +48,7 @@ public class LevelEditorTest {
imageCell = new ImageCell(); imageCell = new ImageCell();
for (String tileset : tilesets) { for (String tileset : tilesets) {
activeTilesets.add(tileset); activeTilesets.add(tileset);
imageCell.imageTileset(tileset); imageCell.imageTileset(new String[]{tileset});
} }
tilesetOverview.setActiveTilesets(activeTilesets); tilesetOverview.setActiveTilesets(activeTilesets);
tilesetOverview.generateOverview(); tilesetOverview.generateOverview();