Battle fix
This commit is contained in:
parent
a4c49e1439
commit
414a6602ed
@ -147,16 +147,14 @@ public class WindowOfBattle extends JPanel {
|
|||||||
battle = new Battle(a, b, this);
|
battle = new Battle(a, b, this);
|
||||||
|
|
||||||
isReadyToPaint = true;
|
isReadyToPaint = true;
|
||||||
Thread repainting = new Thread(() -> {
|
|
||||||
Timer t = new Timer(10, actionEvent -> {
|
Timer t = new Timer(10, actionEvent -> {
|
||||||
|
repaint();
|
||||||
canvas.repaint();
|
canvas.repaint();
|
||||||
if (situationText.isVisible()) {
|
if (situationText.isVisible()) {
|
||||||
situationText.repaint();
|
situationText.repaint();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
t.start();
|
t.start();
|
||||||
});
|
|
||||||
repainting.start();
|
|
||||||
|
|
||||||
battle.startBattle();
|
battle.startBattle();
|
||||||
}
|
}
|
||||||
@ -168,13 +166,13 @@ public class WindowOfBattle extends JPanel {
|
|||||||
public void writeToOutput(String s) {
|
public void writeToOutput(String s) {
|
||||||
System.out.println(s);
|
System.out.println(s);
|
||||||
Font f = new Font(Font.SERIF, Font.BOLD, 20);
|
Font f = new Font(Font.SERIF, Font.BOLD, 20);
|
||||||
if (situationText.getComponents().length != 0)
|
if (situationText.getComponents().length == 0) {
|
||||||
situationText.remove(0);
|
|
||||||
JLabel text = new JLabel();
|
JLabel text = new JLabel();
|
||||||
text.setText(s);
|
|
||||||
text.setFont(f);
|
|
||||||
situationText.add(text);
|
situationText.add(text);
|
||||||
situationText.getComponents()[0].repaint();
|
}
|
||||||
|
JLabel jLabel = (JLabel) situationText.getComponents()[0];
|
||||||
|
jLabel.setText(s);
|
||||||
|
jLabel.setFont(f);
|
||||||
repaint();
|
repaint();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,65 @@
|
|||||||
|
<map>
|
||||||
|
<mapName>tutorial</mapName>
|
||||||
|
<events>
|
||||||
|
<trigger>
|
||||||
|
<x>11</x>
|
||||||
|
<y>6</y>
|
||||||
|
<active>false</active>
|
||||||
|
</trigger>
|
||||||
|
</events>
|
||||||
|
</map>
|
||||||
|
<map>
|
||||||
|
<mapName>openspace</mapName>
|
||||||
|
<events>
|
||||||
|
<trigger>
|
||||||
|
<x>6</x>
|
||||||
|
<y>4</y>
|
||||||
|
<active>true</active>
|
||||||
|
</trigger>
|
||||||
|
<trigger>
|
||||||
|
<x>14</x>
|
||||||
|
<y>16</y>
|
||||||
|
<active>false</active>
|
||||||
|
</trigger>
|
||||||
|
<chest>
|
||||||
|
<x>15</x>
|
||||||
|
<y>7</y>
|
||||||
|
<active>false</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>false</active>
|
||||||
|
</chest>
|
||||||
|
</events>
|
||||||
|
</map>
|
||||||
|
<map>
|
||||||
|
<mapName>boss</mapName>
|
||||||
|
<events>
|
||||||
|
<trigger>
|
||||||
|
<x>4</x>
|
||||||
|
<y>18</y>
|
||||||
|
<active>true</active>
|
||||||
|
</trigger>
|
||||||
|
</events>
|
||||||
|
</map>
|
||||||
|
<map>
|
||||||
|
<mapName>treasure</mapName>
|
||||||
|
<events>
|
||||||
|
<trigger>
|
||||||
|
<x>6</x>
|
||||||
|
<y>1</y>
|
||||||
|
<active>true</active>
|
||||||
|
</trigger>
|
||||||
|
</events>
|
||||||
|
</map>
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
<item>
|
||||||
|
<name>white-key-card</name>
|
||||||
|
<multiplicity>1</multiplicity>
|
||||||
|
<image>19</image>
|
||||||
|
<action>key</action>
|
||||||
|
</item>
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
<location>
|
||||||
|
<map>office</map>
|
||||||
|
<x>8</x>
|
||||||
|
<y>6</y>
|
||||||
|
<direction>3</direction>
|
||||||
|
</location>
|
||||||
@ -0,0 +1 @@
|
|||||||
|
TODO: Village
|
||||||
Loading…
x
Reference in New Issue
Block a user