From 165e24969480b7ea823345640d8433f267d69c3d Mon Sep 17 00:00:00 2001 From: Patrick Surry Date: Wed, 10 Dec 2014 14:04:34 -0500 Subject: [PATCH 01/11] Added MainClass to manifest, simple build/run instructions --- README.md | 7 +++++++ pom.xml | 17 +++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/README.md b/README.md index 1208436..71927b5 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,13 @@ DroidQuest A Java recreation of the classic game Robot Odyssey I +Build with: + + mvn install + +Run with: + + java -jar target/dq-1.1-SNAPSHOT.jar Copyright (c) 2000 Thomas Foote diff --git a/pom.xml b/pom.xml index d379f88..87cbd5d 100644 --- a/pom.xml +++ b/pom.xml @@ -16,6 +16,23 @@ src + + + + org.apache.maven.plugins + maven-jar-plugin + 2.4 + + + + true + lib/ + com.droidquest.DQ + + + + + From cb15a6dc17e909581470345a2b6a2c40472e7993 Mon Sep 17 00:00:00 2001 From: Patrick Surry Date: Wed, 10 Dec 2014 20:21:30 -0500 Subject: [PATCH 02/11] use shortcut modifier for command-arrow vs control-arrow on OS X; added a quick key reference to help --- README.md | 27 ++++++++++++++++++++++++++ src/com/droidquest/avatars/Player.java | 18 ++++++++--------- 2 files changed, 36 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 71927b5..27f02d4 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,33 @@ Run with: java -jar target/dq-1.1-SNAPSHOT.jar +Controls: + + / - help + arrows - normal movement + control + arrows - fine-grained movement [OS X: command + arrows] + space - pickup/drop + C - game cursor + H - hot cursor + S - solder pen + R - toggle radio + P - paintbrush + T - toolbox + [, ] - rotate + F - flip + L - load small chip + E - enter room + X - exit room + + Cheat/debug: + + shift + arrows - move rooms + M - dump memory usage + +Note: On OS X, control + arrow-keys are bound to Apple's "Mission Control". I switched to the 'shortcut' modifier which is control on windows and command on OS X. Alternatively, you can disable +built in OS X shortcuts via System Preferences -> Keyboard -> Shorcuts. + + Copyright (c) 2000 Thomas Foote Permission is hereby granted, free of charge, to any person obtaining diff --git a/src/com/droidquest/avatars/Player.java b/src/com/droidquest/avatars/Player.java index a145678..fc1788a 100644 --- a/src/com/droidquest/avatars/Player.java +++ b/src/com/droidquest/avatars/Player.java @@ -15,7 +15,7 @@ import java.awt.event.KeyEvent; public class Player extends Item implements Avatar { private int keyRepeatRate = 5; - + private int shortcut_modifier = Toolkit.getDefaultToolkit ().getMenuShortcutKeyMask(); protected boolean handleSaveSmallChip() { return false; @@ -362,16 +362,16 @@ public class Player extends Item implements Avatar { else if (e.getKeyCode() == KeyEvent.VK_SLASH && handleHelp()) { return false; } - else if (e.getKeyCode() == KeyEvent.VK_RIGHT && handleMoveRight(e.isShiftDown(), e.isControlDown())) { + else if (e.getKeyCode() == KeyEvent.VK_RIGHT && handleMoveRight(e.isShiftDown(), (e.getModifiers() & shortcut_modifier) > 0)) { return true; } - else if (e.getKeyCode() == KeyEvent.VK_LEFT && handleMoveLeft(e.isShiftDown(), e.isControlDown())) { + else if (e.getKeyCode() == KeyEvent.VK_LEFT && handleMoveLeft(e.isShiftDown(), (e.getModifiers() & shortcut_modifier) > 0)) { return true; } - else if (e.getKeyCode() == KeyEvent.VK_UP && handleMoveUp(e.isShiftDown(), e.isControlDown())) { + else if (e.getKeyCode() == KeyEvent.VK_UP && handleMoveUp(e.isShiftDown(), (e.getModifiers() & shortcut_modifier) > 0)) { return true; } - else if (e.getKeyCode() == KeyEvent.VK_DOWN && handleMoveDown(e.isShiftDown(), e.isControlDown())) { + else if (e.getKeyCode() == KeyEvent.VK_DOWN && handleMoveDown(e.isShiftDown(), (e.getModifiers() & shortcut_modifier) > 0)) { return true; } else if (e.getKeyCode() == KeyEvent.VK_SPACE && handlePickupDrop()) { @@ -455,22 +455,22 @@ public class Player extends Item implements Avatar { public boolean KeyDown(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_RIGHT) { - if (handleRepeatRight(e.isControlDown())) { + if (handleRepeatRight((e.getModifiers() & shortcut_modifier) > 0)) { return true; } } else if (e.getKeyCode() == KeyEvent.VK_LEFT) { - if (handleRepeatLeft(e.isControlDown())) { + if (handleRepeatLeft((e.getModifiers() & shortcut_modifier) > 0)) { return true; } } else if (e.getKeyCode() == KeyEvent.VK_UP) { - if (handleRepeatUp(e.isControlDown())) { + if (handleRepeatUp((e.getModifiers() & shortcut_modifier) > 0)) { return true; } } else if (e.getKeyCode() == KeyEvent.VK_DOWN) { - if (handleRepeatDown(e.isControlDown())) { + if (handleRepeatDown((e.getModifiers() & shortcut_modifier) > 0)) { return true; } } From 2e9e024295e1b583e37a1abc44b720c61a35d354 Mon Sep 17 00:00:00 2001 From: Patrick Surry Date: Wed, 10 Dec 2014 21:06:02 -0500 Subject: [PATCH 03/11] more portable shortcut modifier --- README.md | 8 ++++---- src/com/droidquest/avatars/Remote.java | 18 ++++++++++-------- src/com/droidquest/avatars/SolderingPen.java | 17 +++++++++-------- 3 files changed, 23 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 27f02d4..ffb37a3 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Run with: Controls: - / - help + / - contextual help arrows - normal movement control + arrows - fine-grained movement [OS X: command + arrows] space - pickup/drop @@ -23,11 +23,11 @@ Controls: R - toggle radio P - paintbrush T - toolbox - [, ] - rotate + [, ] - rotate device F - flip L - load small chip - E - enter room - X - exit room + E - enter robot + X - exit robot Cheat/debug: diff --git a/src/com/droidquest/avatars/Remote.java b/src/com/droidquest/avatars/Remote.java index 564b18b..e9aa1e7 100644 --- a/src/com/droidquest/avatars/Remote.java +++ b/src/com/droidquest/avatars/Remote.java @@ -8,6 +8,8 @@ import java.awt.event.KeyEvent; import java.awt.image.BufferedImage; public class Remote extends Item implements Avatar { + private int shortcut_modifier = Toolkit.getDefaultToolkit ().getMenuShortcutKeyMask(); + public Remote() { width = 4; height = 20; @@ -98,28 +100,28 @@ public class Remote extends Item implements Avatar { } else if (e.getKeyCode() == KeyEvent.VK_RIGHT) { if (carriedBy == null) { - moveRight(e.isControlDown()); + moveRight((e.getModifiers() & shortcut_modifier) > 0); } repeating = 0; return true; } else if (e.getKeyCode() == KeyEvent.VK_LEFT) { if (carriedBy == null) { - moveLeft(e.isControlDown()); + moveLeft((e.getModifiers() & shortcut_modifier) > 0); } repeating = 0; return true; } else if (e.getKeyCode() == KeyEvent.VK_UP) { if (carriedBy == null) { - moveUp(e.isControlDown()); + moveUp((e.getModifiers() & shortcut_modifier) > 0); } repeating = 0; return true; } else if (e.getKeyCode() == KeyEvent.VK_DOWN) { if (carriedBy == null) { - moveDown(e.isControlDown()); + moveDown((e.getModifiers() & shortcut_modifier) > 0); } repeating = 0; return true; @@ -134,7 +136,7 @@ public class Remote extends Item implements Avatar { if (e.getKeyCode() == KeyEvent.VK_RIGHT) { repeating++; if (repeating > 10) { - moveRight(e.isControlDown()); + moveRight((e.getModifiers() & shortcut_modifier) > 0); return true; } return false; @@ -142,7 +144,7 @@ public class Remote extends Item implements Avatar { else if (e.getKeyCode() == KeyEvent.VK_LEFT) { repeating++; if (repeating > 10) { - moveLeft(e.isControlDown()); + moveLeft((e.getModifiers() & shortcut_modifier) > 0); return true; } return false; @@ -150,7 +152,7 @@ public class Remote extends Item implements Avatar { else if (e.getKeyCode() == KeyEvent.VK_UP) { repeating++; if (repeating > 10) { - moveUp(e.isControlDown()); + moveUp((e.getModifiers() & shortcut_modifier) > 0); return true; } return false; @@ -158,7 +160,7 @@ public class Remote extends Item implements Avatar { else if (e.getKeyCode() == KeyEvent.VK_DOWN) { repeating++; if (repeating > 10) { - moveDown(e.isControlDown()); + moveDown((e.getModifiers() & shortcut_modifier) > 0); return true; } return false; diff --git a/src/com/droidquest/avatars/SolderingPen.java b/src/com/droidquest/avatars/SolderingPen.java index 6d9b286..5148f69 100644 --- a/src/com/droidquest/avatars/SolderingPen.java +++ b/src/com/droidquest/avatars/SolderingPen.java @@ -18,6 +18,7 @@ import java.util.ArrayList; public class SolderingPen extends Device implements Avatar { private boolean hot; private Port currentPort = null; // Port that Soldering pen is currently over + private int shortcut_modifier = Toolkit.getDefaultToolkit ().getMenuShortcutKeyMask(); public SolderingPen() { width = 22; @@ -313,28 +314,28 @@ public class SolderingPen extends Device implements Avatar { } else if (e.getKeyCode() == KeyEvent.VK_RIGHT) { if (carriedBy == null) { - moveRight(e.isControlDown()); + moveRight((e.getModifiers() & shortcut_modifier) > 0); } repeating = 0; return true; } else if (e.getKeyCode() == KeyEvent.VK_LEFT) { if (carriedBy == null) { - moveLeft(e.isControlDown()); + moveLeft((e.getModifiers() & shortcut_modifier) > 0); } repeating = 0; return true; } else if (e.getKeyCode() == KeyEvent.VK_UP) { if (carriedBy == null) { - moveUp(e.isControlDown()); + moveUp((e.getModifiers() & shortcut_modifier) > 0); } repeating = 0; return true; } else if (e.getKeyCode() == KeyEvent.VK_DOWN) { if (carriedBy == null) { - moveDown(e.isControlDown()); + moveDown((e.getModifiers() & shortcut_modifier) > 0); } repeating = 0; return true; @@ -358,7 +359,7 @@ public class SolderingPen extends Device implements Avatar { if (e.getKeyCode() == KeyEvent.VK_RIGHT) { repeating++; if (repeating > 10) { - moveRight(e.isControlDown()); + moveRight((e.getModifiers() & shortcut_modifier) > 0); return true; } return false; @@ -366,7 +367,7 @@ public class SolderingPen extends Device implements Avatar { else if (e.getKeyCode() == KeyEvent.VK_LEFT) { repeating++; if (repeating > 10) { - moveLeft(e.isControlDown()); + moveLeft((e.getModifiers() & shortcut_modifier) > 0); return true; } return false; @@ -374,7 +375,7 @@ public class SolderingPen extends Device implements Avatar { else if (e.getKeyCode() == KeyEvent.VK_UP) { repeating++; if (repeating > 10) { - moveUp(e.isControlDown()); + moveUp((e.getModifiers() & shortcut_modifier) > 0); return true; } return false; @@ -382,7 +383,7 @@ public class SolderingPen extends Device implements Avatar { else if (e.getKeyCode() == KeyEvent.VK_DOWN) { repeating++; if (repeating > 10) { - moveDown(e.isControlDown()); + moveDown((e.getModifiers() & shortcut_modifier) > 0); return true; } return false; From be0b0a28e91460353637d86798b543473ed62995 Mon Sep 17 00:00:00 2001 From: EpicOrange Date: Wed, 24 Dec 2014 01:27:55 -0800 Subject: [PATCH 04/11] Made the AutoWire button functional --- src/com/droidquest/items/AutoWire.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/com/droidquest/items/AutoWire.java b/src/com/droidquest/items/AutoWire.java index e4eac3a..a28da45 100644 --- a/src/com/droidquest/items/AutoWire.java +++ b/src/com/droidquest/items/AutoWire.java @@ -1,6 +1,7 @@ package com.droidquest.items; import com.droidquest.Room; +import com.droidquest.Wire; import com.droidquest.chipstuff.Port; import com.droidquest.devices.Device; import com.droidquest.devices.PortDevice; @@ -112,8 +113,7 @@ public class AutoWire extends Item { if (animation == 1) { if (portdevices[0].ports[0].myWire == null) { // Wiring - portdevices[0].ports[0].type = Port.TYPE_UNDEFINED; - portdevices[0].ports[0].value = false; + portdevices[0].ports[0].myWire = new Wire(chip.ports[0], portdevices[0].ports[0]); } else { // Unwiring portdevices[0].ports[0].myWire.Remove(); @@ -128,8 +128,7 @@ public class AutoWire extends Item { if (animation >= 2 && animation <= 8) { if (portdevices[0].ports[0].myWire != null) { // Wiring if (portdevices[animation - 1].ports[0].myWire == null) { - portdevices[animation - 1].ports[0].type = Port.TYPE_UNDEFINED; - portdevices[animation - 1].ports[0].value = false; + portdevices[animation - 1].ports[0].myWire = new Wire(chip.ports[animation - 1], portdevices[animation - 1].ports[0]); } } else { // Unwiring From 081e30ff84f310550da289dd5a2b45abbc3517b6 Mon Sep 17 00:00:00 2001 From: EpicOrange Date: Wed, 24 Dec 2014 01:32:31 -0800 Subject: [PATCH 05/11] Changed tabs to spaces (forgot to configure eclipse) --- src/com/droidquest/items/AutoWire.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/droidquest/items/AutoWire.java b/src/com/droidquest/items/AutoWire.java index a28da45..e375616 100644 --- a/src/com/droidquest/items/AutoWire.java +++ b/src/com/droidquest/items/AutoWire.java @@ -113,7 +113,7 @@ public class AutoWire extends Item { if (animation == 1) { if (portdevices[0].ports[0].myWire == null) { // Wiring - portdevices[0].ports[0].myWire = new Wire(chip.ports[0], portdevices[0].ports[0]); + portdevices[0].ports[0].myWire = new Wire(chip.ports[0], portdevices[0].ports[0]); } else { // Unwiring portdevices[0].ports[0].myWire.Remove(); @@ -128,7 +128,7 @@ public class AutoWire extends Item { if (animation >= 2 && animation <= 8) { if (portdevices[0].ports[0].myWire != null) { // Wiring if (portdevices[animation - 1].ports[0].myWire == null) { - portdevices[animation - 1].ports[0].myWire = new Wire(chip.ports[animation - 1], portdevices[animation - 1].ports[0]); + portdevices[animation - 1].ports[0].myWire = new Wire(chip.ports[animation - 1], portdevices[animation - 1].ports[0]); } } else { // Unwiring From 3cb5774fb042f8eb4b27a88549e632077fff2ea9 Mon Sep 17 00:00:00 2001 From: EriCSN Date: Sat, 28 Nov 2015 12:15:20 +0800 Subject: [PATCH 06/11] Update pom.xml, tested under Ubuntu14.04 --- pom.xml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pom.xml b/pom.xml index d379f88..e7452ac 100644 --- a/pom.xml +++ b/pom.xml @@ -16,6 +16,17 @@ src + + + org.apache.maven.plugins + maven-compiler-plugin + 3.3 + + 5 + 5 + + + From 00eb3cb38fb075ec2f41fcb6d47f0cd62d464c38 Mon Sep 17 00:00:00 2001 From: EriCSN Date: Sat, 28 Nov 2015 12:18:42 +0800 Subject: [PATCH 07/11] Added some build tips --- README.md | 5 +++++ start_game.sh | 1 + 2 files changed, 6 insertions(+) create mode 100755 start_game.sh diff --git a/README.md b/README.md index 1208436..c7864c1 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,11 @@ DroidQuest A Java recreation of the classic game Robot Odyssey I +Compile command: + mvn compile + +Run the game: + ./start_game.sh Copyright (c) 2000 Thomas Foote diff --git a/start_game.sh b/start_game.sh new file mode 100755 index 0000000..7aff439 --- /dev/null +++ b/start_game.sh @@ -0,0 +1 @@ +mvn exec:java -Dexec.mainClass=com.droidquest.DQ From 516ed24d54eaf52fec566c0f4722b4a1db410b81 Mon Sep 17 00:00:00 2001 From: EriCSN Date: Sat, 28 Nov 2015 12:19:38 +0800 Subject: [PATCH 08/11] Fixed README --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index c7864c1..fdb36a6 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,11 @@ DroidQuest A Java recreation of the classic game Robot Odyssey I Compile command: + mvn compile Run the game: + ./start_game.sh Copyright (c) 2000 Thomas Foote From 6e0b9db3d5d54b056ccfaea5fe1c4c15942d52fa Mon Sep 17 00:00:00 2001 From: cognitivegears Date: Fri, 28 Oct 2016 20:27:36 -0500 Subject: [PATCH 09/11] #12 - Fixed crash when starting a wire after changing modes --- src/com/droidquest/avatars/SolderingPen.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/com/droidquest/avatars/SolderingPen.java b/src/com/droidquest/avatars/SolderingPen.java index 5148f69..e7b80e7 100644 --- a/src/com/droidquest/avatars/SolderingPen.java +++ b/src/com/droidquest/avatars/SolderingPen.java @@ -429,6 +429,8 @@ public class SolderingPen extends Device implements Avatar { } } + CheckPort(); + level.roomdisplay.dq.selectCursor(); return true; } @@ -506,6 +508,8 @@ public class SolderingPen extends Device implements Avatar { handleRemote(); + CheckPort(); + return true; } From c3418252392d82509a4a56cde2ec1f5fb633d13e Mon Sep 17 00:00:00 2001 From: cognitivegears Date: Fri, 28 Oct 2016 21:14:34 -0500 Subject: [PATCH 10/11] Fixed missing sounds --- src/com/droidquest/levels/Level.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/com/droidquest/levels/Level.java b/src/com/droidquest/levels/Level.java index e955535..c571f80 100644 --- a/src/com/droidquest/levels/Level.java +++ b/src/com/droidquest/levels/Level.java @@ -51,10 +51,10 @@ public class Level implements ImageObserver, Serializable { public transient Random random = new Random(); public transient static String ATTACHSOUND = "attach.WAV"; public transient static String DETATCHSOUND = "detatch.WAV"; - public transient static String PICKUPSOUND = "pickup2.WAV"; - public transient static String DROPSOUND = "drop2.WAV"; - public transient static String BEEPSOUND = "beep2.WAV"; - public transient static String BUMPSOUND = "bump2.WAV"; + public transient static String PICKUPSOUND = "pickup.WAV"; + public transient static String DROPSOUND = "drop.WAV"; + public transient static String BEEPSOUND = "beep.WAV"; + public transient static String BUMPSOUND = "bump.WAV"; public transient static String CHARGESOUND = "charge.WAV"; public transient static String DISCHARGESOUND = "discharge.WAV"; public transient static String BURNSOUND = "burn.WAV"; From e90aa494442224aa0c1d935f84fb007cd1f7ed2e Mon Sep 17 00:00:00 2001 From: cognitivegears Date: Sun, 30 Oct 2016 22:09:45 -0500 Subject: [PATCH 11/11] General clean-up. Fixed GateKeeper, updated startup scripts, fixed warnings. --- .gitignore | 2 + README.md | 3 +- pom.xml | 6 +-- src/com/droidquest/items/GateKeeper.java | 2 +- src/com/droidquest/items/Sentry.java | 8 ++-- src/com/droidquest/materials/BatteryIn.java | 2 +- start.bat | 1 + start.sh | 45 +++++++++++++++++++++ start_game.sh | 1 - 9 files changed, 60 insertions(+), 10 deletions(-) create mode 100755 start.bat create mode 100755 start.sh delete mode 100755 start_game.sh diff --git a/.gitignore b/.gitignore index 4cb7b24..58add36 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ *.lvl *.class target/ +.idea/ +*.iml diff --git a/README.md b/README.md index 48b5c28..74083e9 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,8 @@ Build with: Run the game: - ./start_game.sh + MacOSX / Linux: ./start.sh + Windows: start.bat (IN PROGRESS) OR java -jar target/dq-1.1-SNAPSHOT.jar diff --git a/pom.xml b/pom.xml index 13b9136..b49096a 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.droidquest dq - 1.1-SNAPSHOT + 1.2 jar DroidQuest @@ -22,8 +22,8 @@ maven-compiler-plugin 3.3 - 5 - 5 + 1.6 + 1.6 diff --git a/src/com/droidquest/items/GateKeeper.java b/src/com/droidquest/items/GateKeeper.java index 7ef1b6e..91b5cce 100644 --- a/src/com/droidquest/items/GateKeeper.java +++ b/src/com/droidquest/items/GateKeeper.java @@ -64,7 +64,7 @@ public class GateKeeper extends Item { public void Animate() { if (behavior == 1) { - if (x != goToX && y != goToY) { + if (x != goToX || y != goToY) { if (x != goToX) { int diff = Math.abs(goToX - x); int dir = diff / (goToX - x); diff --git a/src/com/droidquest/items/Sentry.java b/src/com/droidquest/items/Sentry.java index 5e08dc3..a0e7356 100644 --- a/src/com/droidquest/items/Sentry.java +++ b/src/com/droidquest/items/Sentry.java @@ -240,9 +240,11 @@ public class Sentry extends Item { if (behavior == -1) { if (carrying == null) { - x = robot.x + robot.width / 2 - width / 2; - y = robot.y + robot.height / 2 - height / 2; - PicksUp(robot); + if(robot != null) { + x = robot.x + robot.width / 2 - width / 2; + y = robot.y + robot.height / 2 - height / 2; + PicksUp(robot); + } } } diff --git a/src/com/droidquest/materials/BatteryIn.java b/src/com/droidquest/materials/BatteryIn.java index d7fb360..184660d 100644 --- a/src/com/droidquest/materials/BatteryIn.java +++ b/src/com/droidquest/materials/BatteryIn.java @@ -13,7 +13,7 @@ import com.droidquest.levels.Level; public class BatteryIn extends Material { // Charges the Battery when an Energy Crystal is passed over it. - public void BatteryIn() { + public BatteryIn() { passable = true; GenerateIcons(); } diff --git a/start.bat b/start.bat new file mode 100755 index 0000000..34ec06b --- /dev/null +++ b/start.bat @@ -0,0 +1 @@ +java -jar "target\dq-1.2.jar" diff --git a/start.sh b/start.sh new file mode 100755 index 0000000..cad1915 --- /dev/null +++ b/start.sh @@ -0,0 +1,45 @@ +#/bin/sh + +RUNPRG="java" +if ! type -p "${RUNPRG}" > /dev/null; +then + if [ -n "${JAVA_HOME}" ]; + then + RUNPRG="${JAVA_HOME}/bin/java" + if [ ! -x "${RUNPRG}" ]; + then + echo "JAVA_HOME set, but unable to find java. Please check your java installation." + exit 1 + fi + else + echo "Java 1.6 or newer needed for DQ. Must be in PATH or JAVA_HOME set." + exit 1 + fi +fi + + +if [ -f "target/dq-1.2.jar" ]; +then + echo "Starting DQ." + ${RUNPRG} -jar "target/dq-1.2.jar" +else + echo "No jar found, building DQ before running." + MVNPRG="mvn" + if ! type -p "${MVNPRG}" > /dev/null; + then + if [ -n "${MAVEN_HOME}" ]; + then + MVNPRG="${MAVEN_HOME}/bin/mvn" + if [ ! -x "${MVNPRG}" ]; + then + echo "MAVEN_HOME set, but unable to find mvn executable. Please check your maven installation." + exit 1 + fi + else + echo "Maven required to build DQ. See maven.apache.org to download." + exit 1 + fi + fi + ${MVNPRG} package + ${MVNPRG} exec:java -Dexec.mainClass=com.droidquest.DQ +fi diff --git a/start_game.sh b/start_game.sh deleted file mode 100755 index 7aff439..0000000 --- a/start_game.sh +++ /dev/null @@ -1 +0,0 @@ -mvn exec:java -Dexec.mainClass=com.droidquest.DQ