Browse Source

General clean-up. Fixed GateKeeper, updated startup scripts, fixed warnings.

master^2
cognitivegears 5 years ago
parent
commit
e90aa49444
  1. 2
      .gitignore
  2. 3
      README.md
  3. 6
      pom.xml
  4. 2
      src/com/droidquest/items/GateKeeper.java
  5. 8
      src/com/droidquest/items/Sentry.java
  6. 2
      src/com/droidquest/materials/BatteryIn.java
  7. 1
      start.bat
  8. 45
      start.sh
  9. 1
      start_game.sh

2
.gitignore

@ -1,3 +1,5 @@
*.lvl
*.class
target/
.idea/
*.iml

3
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

6
pom.xml

@ -4,7 +4,7 @@
<groupId>com.droidquest</groupId>
<artifactId>dq</artifactId>
<version>1.1-SNAPSHOT</version>
<version>1.2</version>
<packaging>jar</packaging>
<name>DroidQuest</name>
@ -22,8 +22,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>5</source>
<target>5</target>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>

2
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);

8
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);
}
}
}

2
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();
}

1
start.bat

@ -0,0 +1 @@
java -jar "target\dq-1.2.jar"

45
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

1
start_game.sh

@ -1 +0,0 @@
mvn exec:java -Dexec.mainClass=com.droidquest.DQ
Loading…
Cancel
Save