Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
<classpathentry kind="src" path="test"/>
<classpathentry kind="output" path="bin"/>
</classpath>
17 changes: 17 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>SpaceWar</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
11 changes: 11 additions & 0 deletions .settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.7
Binary file added bin/SpaceWar/Bullet.class
Binary file not shown.
Binary file added bin/SpaceWar/Enemy.class
Binary file not shown.
Binary file added bin/SpaceWar/Explosion.class
Binary file not shown.
Binary file added bin/SpaceWar/Generals.class
Binary file not shown.
Binary file added bin/SpaceWar/Player.class
Binary file not shown.
Binary file added bin/SpaceWar/PowerUp.class
Binary file not shown.
Binary file added bin/SpaceWar/SpacePanel.class
Binary file not shown.
Binary file added bin/SpaceWar/SpaceWar.class
Binary file not shown.
Binary file added bin/SpaceWar/Text.class
Binary file not shown.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added bin/randoop/RandoopTest.class
Binary file not shown.
Binary file added bin/randoop/RandoopTest0.class
Binary file not shown.
Binary file added bin/randoop/RandoopTest1.class
Binary file not shown.
Binary file added bin/randoop/RandoopTest10.class
Binary file not shown.
Binary file added bin/randoop/RandoopTest2.class
Binary file not shown.
Binary file added bin/randoop/RandoopTest3.class
Binary file not shown.
Binary file added bin/randoop/RandoopTest4.class
Binary file not shown.
Binary file added bin/randoop/RandoopTest5.class
Binary file not shown.
Binary file added bin/randoop/RandoopTest6.class
Binary file not shown.
Binary file added bin/randoop/RandoopTest7.class
Binary file not shown.
Binary file added bin/randoop/RandoopTest8.class
Binary file not shown.
Binary file added bin/randoop/RandoopTest9.class
Binary file not shown.
Binary file added bin/randoopFailures/RandoopTest_failure_1.class
Binary file not shown.
Binary file added bin/randoopFailures/RandoopTest_failure_2.class
Binary file not shown.
89 changes: 89 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<project name="SpaceWar" basedir="." default="main">

<!-- Global Properties -->
<property name="src.dir" value="src"/>
<property name="test.dir" value="test"/>
<property name="build.dir" value="build"/>
<property name="classes.dir" value="${build.dir}/main/classes"/>
<property name="jar.dir" value="${build.dir}/main/jar"/>
<property name="main-class" value="SpaceWar.SpaceWar"/>
<property name="classes_test.dir" value="${build.dir}/test/classes"/>
<property name="jar_test.dir" value="${build.dir}/test/jar"/>
<property name="test_output.dir" value="${build.dir}/test/output"/>

<!-- Class Paths -->
<path id="junit.class.path">
<pathelement location="lib/junit.jar"></pathelement>
</path>
<path id="spacewar.class.path">
<pathelement location="build/main/jar/SpaceWar.jar"></pathelement>
</path>
<path id="randoop.class.path">
<pathelement location="build/test/jar/SpaceWar_Test.jar"></pathelement>
</path>

<!-- Build Targets -->
<target name="clean">
<delete dir="${build.dir}"/>
</target>

<target name="compile">
<mkdir dir="${classes.dir}"/>
<javac srcdir="${src.dir}" destdir="${classes.dir}" includeantruntime="true"/>
<copy todir="${classes.dir}">
<fileset dir="src"
includes="**/*" />
</copy>
</target>

<target name="jar" depends="compile">
<mkdir dir="${jar.dir}"/>
<jar destfile="${jar.dir}/${ant.project.name}.jar" basedir="${classes.dir}">
<manifest>
<attribute name="Main-Class" value="${main-class}"/>
</manifest>
</jar>
</target>

<target name="maketest" depends="jar">
<mkdir dir="${classes_test.dir}"/>
<javac srcdir="${test.dir}" destdir="${classes_test.dir}" includeantruntime="true">
<classpath refid="junit.class.path" />
<classpath refid="spacewar.class.path" />
</javac>
</target>

<target name="runtest_jar" depends="maketest">
<mkdir dir="${jar_test.dir}"/>
<jar destfile="${jar_test.dir}/${ant.project.name}_Test.jar" basedir="${classes_test.dir}">
<manifest>
<attribute name="Main-Class-Test" value="${test_class}"/>
</manifest>
</jar>
</target>

<target name="run" depends="jar">
<java jar="${jar.dir}/${ant.project.name}.jar" fork="true"/>
</target>

<!-- JUnit -->
<target name="runtest" depends="runtest_jar">
<mkdir dir="${test_output.dir}"/>
<junit printsummary="on" fork="true" haltonfailure="no">
<classpath refid="junit.class.path" />
<classpath refid="randoop.class.path" />
<classpath refid="spacewar.class.path" />
<formatter type="xml" />
<batchtest todir="${test_output.dir}">
<fileset dir="test/">
<include name="**/*Test*.java" />
</fileset>
</batchtest>
</junit>
</target>

<!-- ANT Commands -->
<target name="clean-build" depends="clean,jar"/>
<target name="main" depends="clean,runtest"/>

</project>
Binary file added lib/junit.jar
Binary file not shown.
3 changes: 3 additions & 0 deletions Bullet.java → src/SpaceWar/Bullet.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
package SpaceWar;

import java.awt.*;

public class Bullet {
private double x, y, rad, speed, dx, dy;
private int r;
private Color color;
private int test;

public Bullet (double angle, int x, int y) {
this.x = x;
Expand Down
2 changes: 2 additions & 0 deletions Enemy.java → src/SpaceWar/Enemy.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package SpaceWar;

import java.awt.*;
import java.awt.image.*;
import java.net.URL;
Expand Down
2 changes: 2 additions & 0 deletions Explosion.java → src/SpaceWar/Explosion.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package SpaceWar;

import java.awt.*;

public class Explosion {
Expand Down
2 changes: 2 additions & 0 deletions Generals.java → src/SpaceWar/Generals.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package SpaceWar;

import java.awt.image.*;
import java.net.URL;
import javax.imageio.*;
Expand Down
2 changes: 2 additions & 0 deletions Player.java → src/SpaceWar/Player.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package SpaceWar;

import java.awt.*;
import java.awt.image.*;
import java.net.URL;
Expand Down
2 changes: 2 additions & 0 deletions PowerUp.java → src/SpaceWar/PowerUp.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package SpaceWar;

import java.awt.*;

public class PowerUp {
Expand Down
2 changes: 2 additions & 0 deletions SpacePanel.java → src/SpaceWar/SpacePanel.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package SpaceWar;

import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
Expand Down
2 changes: 2 additions & 0 deletions SpaceWar.java → src/SpaceWar/SpaceWar.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

Image sprites: http://sm.ingenieriamultimedia.org/lib/exe/fetch.php?media=alumnos:grupo_13:naves.png
*/
package SpaceWar;

import javax.swing.JFrame;

public class SpaceWar {
Expand Down
2 changes: 2 additions & 0 deletions Text.java → src/SpaceWar/Text.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package SpaceWar;

import java.awt.*;

public class Text {
Expand Down
Binary file added src/SpaceWarLevel2.png
Binary file added src/SpaceWarLevel4.png
Binary file added src/img/badass/badass1.png
Binary file added src/img/badass/badass1Large.png
Binary file added src/img/badass/badass1Medium.png
Binary file added src/img/badass/badass1Mini.png
Binary file added src/img/badass/badass2.png
Binary file added src/img/badass/badass2Large.png
Binary file added src/img/badass/badass2Medium.png
Binary file added src/img/badass/badass2Mini.png
Binary file added src/img/badass/badass3.png
Binary file added src/img/badass/badass3Large.png
Binary file added src/img/badass/badass3Medium.png
Binary file added src/img/badass/badass3Mini.png
Binary file added src/img/badass/transparency/badass1-transp.png
Binary file added src/img/badass/transparency/badass2-transp.png
Binary file added src/img/badass/transparency/badass3-transp.png
Binary file added src/img/hero-down.png
Binary file added src/img/hero-left.png
Binary file added src/img/hero-right.png
Binary file added src/img/hero-up.png
Binary file added src/img/hero/hero-down-transp.png
Binary file added src/img/hero/hero-down.png
Binary file added src/img/hero/hero-left-transp.png
Binary file added src/img/hero/hero-left.png
Binary file added src/img/hero/hero-right-transp.png
Binary file added src/img/hero/hero-right.png
Binary file added src/img/hero/hero-up-transp.png
Binary file added src/img/hero/hero-up.png
Binary file added src/img/stage/stage.jpg
37 changes: 37 additions & 0 deletions test/randoop/RandoopTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package randoop;
import junit.framework.*;
import junit.textui.*;

public class RandoopTest extends TestCase {

public static void main(String[] args) {
TestRunner runner = new TestRunner();
TestResult result = runner.doRun(suite(), false);
if (! result.wasSuccessful()) {
System.exit(1);
}
}

public RandoopTest(String name) {
super(name);
}

public static Test suite() {
TestSuite result = new TestSuite();
result.addTest(new TestSuite(RandoopTest0.class));
result.addTest(new TestSuite(RandoopTest1.class));
result.addTest(new TestSuite(RandoopTest2.class));
result.addTest(new TestSuite(RandoopTest3.class));
result.addTest(new TestSuite(RandoopTest4.class));
result.addTest(new TestSuite(RandoopTest5.class));
result.addTest(new TestSuite(RandoopTest6.class));
result.addTest(new TestSuite(RandoopTest7.class));
result.addTest(new TestSuite(RandoopTest8.class));
result.addTest(new TestSuite(RandoopTest9.class));
result.addTest(new TestSuite(RandoopTest10.class));
result.addTest(new TestSuite(randoopFailures.RandoopTest_failure_1.class));
result.addTest(new TestSuite(randoopFailures.RandoopTest_failure_2.class));
return result;
}

}
Loading