From bc26267d55be0cca72ab307cb0556c3c779d18b6 Mon Sep 17 00:00:00 2001 From: AJ Walter Date: Sun, 2 Aug 2020 23:26:57 -0500 Subject: [PATCH] Add credits level and time to beat level --- hexlevels/0hexagon.xml | 1 + hexlevels/1hexagoner.xml | 1 + hexlevels/2hexagonest.xml | 1 + hexlevels/3octogon.xml | 1 + hexlevels/4hexagoner.xml | 1 + hexlevels/5hexagonest.xml | 1 + hexlevels/6void.xml | 1 + hexlevels/7credits.xml | 38 ++++++++++++++++++++++++++++++++++ hexlevels/patterns/o6_kill.xml | 34 ++++++++++++++++++++++++++++++ src/data/Level.java | 10 ++++++++- 10 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 hexlevels/7credits.xml create mode 100644 hexlevels/patterns/o6_kill.xml diff --git a/hexlevels/0hexagon.xml b/hexlevels/0hexagon.xml index 7d4a61d..f1ee7f9 100644 --- a/hexlevels/0hexagon.xml +++ b/hexlevels/0hexagon.xml @@ -10,6 +10,7 @@ 0.10471976 120 3 + 90.0 90 diff --git a/hexlevels/1hexagoner.xml b/hexlevels/1hexagoner.xml index ec28698..ef4e966 100644 --- a/hexlevels/1hexagoner.xml +++ b/hexlevels/1hexagoner.xml @@ -10,6 +10,7 @@ 0.11423973 120 4 + 90.0 0 diff --git a/hexlevels/2hexagonest.xml b/hexlevels/2hexagonest.xml index b08fcce..bd9fdc8 100644 --- a/hexlevels/2hexagonest.xml +++ b/hexlevels/2hexagonest.xml @@ -10,6 +10,7 @@ 0.120830484 60 5 + 90.0 49 diff --git a/hexlevels/3octogon.xml b/hexlevels/3octogon.xml index 6b1dc2d..06d529a 100644 --- a/hexlevels/3octogon.xml +++ b/hexlevels/3octogon.xml @@ -10,6 +10,7 @@ 0.12566371 80 5 + 90.0 3 diff --git a/hexlevels/4hexagoner.xml b/hexlevels/4hexagoner.xml index c873007..1e477fc 100644 --- a/hexlevels/4hexagoner.xml +++ b/hexlevels/4hexagoner.xml @@ -10,6 +10,7 @@ 0.15707964 90 5 + 90.0 102 diff --git a/hexlevels/5hexagonest.xml b/hexlevels/5hexagonest.xml index 9e312e2..948b519 100644 --- a/hexlevels/5hexagonest.xml +++ b/hexlevels/5hexagonest.xml @@ -10,6 +10,7 @@ 0.17951958 22 6 + 70.0 101 diff --git a/hexlevels/6void.xml b/hexlevels/6void.xml index db50f36..735beab 100644 --- a/hexlevels/6void.xml +++ b/hexlevels/6void.xml @@ -10,6 +10,7 @@ 0.17951958 120 -1 + 0.0 0 diff --git a/hexlevels/7credits.xml b/hexlevels/7credits.xml new file mode 100644 index 0000000..5deb7a2 --- /dev/null +++ b/hexlevels/7credits.xml @@ -0,0 +1,38 @@ + + + CREDITS + SPOILERS + (DUH) + REDHAT + NONE + 2.0 + 0.0 + 0.10471976 + 120 + -1 + 90.0 + + + 0 + 0 + 0 + + + + + 0 + 0 + 0 + + + + + 255 + 255 + 255 + + + + o6_kill.xml + + diff --git a/hexlevels/patterns/o6_kill.xml b/hexlevels/patterns/o6_kill.xml new file mode 100644 index 0000000..460948e --- /dev/null +++ b/hexlevels/patterns/o6_kill.xml @@ -0,0 +1,34 @@ + + + 6 + + 0 + 300 + 0 + + + 0 + 300 + 1 + + + 0 + 300 + 2 + + + 0 + 300 + 3 + + + 0 + 300 + 4 + + + 0 + 300 + 5 + + diff --git a/src/data/Level.java b/src/data/Level.java index 898e51a..2b9d6f8 100644 --- a/src/data/Level.java +++ b/src/data/Level.java @@ -33,7 +33,7 @@ public class Level { //Files public static final String XML_HEADER = "Level"; - public static final String BIN_HEADER = "LEV2.2"; + public static final String BIN_HEADER = "LEV3.0"; public static final String BIN_FOOTER = "ENDLEV"; //Finals @@ -70,6 +70,7 @@ public Level(Project project, File levelFile) { public static final String XML_CREATOR = "Creator"; public static final String XML_MUSIC = "Music"; public static final String XML_NEXT_INDEX = "Next"; + public static final String XML_NEXT_TIME = "NextTime"; public static final String XML_BG1 = "BackgroundColorOne"; public static final String XML_BG2 = "BackgroundColorTwo"; public static final String XML_FG = "ForegroundColor"; @@ -89,6 +90,7 @@ public Level(Project project, File levelFile) { private float speedCursor; private int speedPulse; private int nextIndex; + private float nextTime; private List bg1; private List bg2; private List fg; @@ -101,6 +103,7 @@ private void setDefaults() { this.creator = "ANONYMOUS"; this.music = "NONE"; this.nextIndex = -1; + this.nextTime = 90.0f; this.speedWall = 2.0f; this.speedRotation = (float)(Math.PI * 2.0) / 120.0f; this.speedCursor = (float)(Math.PI * 2.0) / 60.0f; @@ -125,6 +128,7 @@ public void readXML(Element e) throws Exception { this.speedCursor = UtilXML.getFloat(e, XML_SPEED_CURSOR); this.speedPulse = UtilXML.getInt(e, XML_SPEED_PULSE); this.nextIndex = UtilXML.getInt(e, XML_NEXT_INDEX); + this.nextTime = UtilXML.getFloat(e, XML_NEXT_TIME); this.bg1 = UtilXML.getColors(e, XML_BG1); this.bg2 = UtilXML.getColors(e, XML_BG2); this.fg = UtilXML.getColors(e, XML_FG); @@ -142,6 +146,7 @@ public void writeXML(Element e) { UtilXML.putFloat(e, XML_SPEED_CURSOR, speedCursor); UtilXML.putInt(e, XML_SPEED_PULSE, speedPulse); UtilXML.putInt(e, XML_NEXT_INDEX, nextIndex); + UtilXML.putFloat(e, XML_NEXT_TIME, nextTime); UtilXML.putColors(e, XML_BG1, bg1); UtilXML.putColors(e, XML_BG2, bg2); UtilXML.putColors(e, XML_FG, fg); @@ -165,6 +170,7 @@ public void writeBIN(Dynamic d) throws IOException { d.putFloat(speedCursor); d.putInt(speedPulse); d.putInt(nextIndex); + d.putFloat(nextTime); d.putInt(patterns.size()); for(Pattern p : patterns) d.putString(p.toString()); d.putRawString(BIN_FOOTER); @@ -197,6 +203,7 @@ public void windowClosing(WindowEvent e) { JTextField jCURS = Util.addTitledFieldToPanel(textConfiguration, null, "[TAU/float] Human Step", speedCursor + ""); JTextField jPLUS = Util.addTitledFieldToPanel(textConfiguration, null, "[int] Pulse Speed", speedPulse + ""); JTextField jNEXT = Util.addTitledFieldToPanel(textConfiguration, null, "[int] Next Level Index", nextIndex + ""); + JTextField jNTIM = Util.addTitledFieldToPanel(textConfiguration, null, "[float] Next Level Time", nextTime + ""); JButton jSAVE = Util.addButtonToPanel(textConfiguration, null, "Save Configuration"); frame.add(textConfiguration); @@ -239,6 +246,7 @@ public void actionPerformed(ActionEvent e) { speedCursor = Float.parseFloat(jCURS.getText()); speedPulse = Integer.parseInt(jPLUS.getText()); nextIndex = Integer.parseInt(jNEXT.getText()); + nextTime = Float.parseFloat(jNTIM.getText()); if(Util.askSave(frame) != JOptionPane.YES_OPTION) return; Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument(); Element el = doc.createElement(XML_HEADER);