Browse Source

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

tags/2.8^2
cognitivegears 3 years ago
parent
commit
e90aa49444

+ 2
- 0
.gitignore View File

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

+ 2
- 1
README.md View File

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


+ 3
- 3
pom.xml View File

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

+ 1
- 1
src/com/droidquest/items/GateKeeper.java View File

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

+ 5
- 3
src/com/droidquest/items/Sentry.java View File

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


+ 1
- 1
src/com/droidquest/materials/BatteryIn.java View File

@@ -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
- 0
start.bat View File

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

+ 45
- 0
start.sh View File

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

+ 0
- 1
start_game.sh View File

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

Loading…
Cancel
Save