diff --git a/.DS_Store b/.DS_Store index 74fe1b8e85eb33d57af98a3f6a73f8490efde7b6..31ea054eaf624438156c24e926a13df7fb58990c 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000000000000000000000000000000000000..e5199ee79ccef033b3d3412968c960ebf7ffe811 --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +bagel \ No newline at end of file diff --git a/.idea/SWEN20003_a1.iml b/.idea/SWEN20003_a1.iml index d6ebd4805981b8400db3e3291c74a743fef9a824..1d041d2ad70f907af5c709c8f6702db639b211c5 100644 --- a/.idea/SWEN20003_a1.iml +++ b/.idea/SWEN20003_a1.iml @@ -1,9 +1,26 @@ <?xml version="1.0" encoding="UTF-8"?> -<module type="JAVA_MODULE" version="4"> - <component name="NewModuleRootManager" inherit-compiler-output="true"> - <exclude-output /> - <content url="file://$MODULE_DIR$" /> +<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4"> + <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_14"> + <output url="file://$MODULE_DIR$/target/classes" /> + <output-test url="file://$MODULE_DIR$/target/test-classes" /> + <content url="file://$MODULE_DIR$"> + <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> + <excludeFolder url="file://$MODULE_DIR$/target" /> + </content> <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="library" name="Maven: io.github.eleanor-em:bagel:1.9.3" level="project" /> + <orderEntry type="library" name="Maven: org.lwjgl:lwjgl:3.2.2" level="project" /> + <orderEntry type="library" name="Maven: org.lwjgl:lwjgl-assimp:3.2.2" level="project" /> + <orderEntry type="library" name="Maven: org.lwjgl:lwjgl-glfw:3.2.2" level="project" /> + <orderEntry type="library" name="Maven: org.lwjgl:lwjgl-openal:3.2.2" level="project" /> + <orderEntry type="library" name="Maven: org.lwjgl:lwjgl-opengl:3.2.2" level="project" /> + <orderEntry type="library" name="Maven: org.lwjgl:lwjgl-stb:3.2.2" level="project" /> + <orderEntry type="library" name="Maven: org.lwjgl:lwjgl:natives-macos:3.2.2" level="project" /> + <orderEntry type="library" name="Maven: org.lwjgl:lwjgl-assimp:natives-macos:3.2.2" level="project" /> + <orderEntry type="library" name="Maven: org.lwjgl:lwjgl-glfw:natives-macos:3.2.2" level="project" /> + <orderEntry type="library" name="Maven: org.lwjgl:lwjgl-openal:natives-macos:3.2.2" level="project" /> + <orderEntry type="library" name="Maven: org.lwjgl:lwjgl-opengl:natives-macos:3.2.2" level="project" /> + <orderEntry type="library" name="Maven: org.lwjgl:lwjgl-stb:natives-macos:3.2.2" level="project" /> </component> </module> \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 5ed7d1ee1d47a9d2bb314a87f99538d402e982e0..73c96b118e1f4906e3610370d05b47d08d4ec4a5 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -7,10 +7,12 @@ <sourceTestOutputDir name="target/generated-test-sources/test-annotations" /> <outputRelativeToContentRoot value="true" /> <module name="bagel" /> + <module name="SWEN20003_a1" /> </profile> </annotationProcessing> <bytecodeTargetLevel> <module name="bagel" target="14" /> + <module name="SWEN20003_a1" target="14" /> </bytecodeTargetLevel> </component> </project> \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 6359b69b9d63c9d581e8a70fe24bfd01ea05b245..0fa498d68481a6301a5ab9b54cd660492e48d643 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -4,6 +4,7 @@ <option name="originalFiles"> <list> <option value="$PROJECT_DIR$/project-1/pom.xml" /> + <option value="$PROJECT_DIR$/pom.xml" /> </list> </option> </component> diff --git a/src/APoint.java b/src/APoint.java index 700306577908679fbf15708178b00c03ac9a07cc..bac524e8b0491be59374f8b3314945cecbe226ec 100644 --- a/src/APoint.java +++ b/src/APoint.java @@ -1,5 +1,9 @@ import java.lang.Math; +/** + * APoint class in ShadowTreasure game. + * contains X and Y coordinates for location management in ShadowTreasure game. + */ public class APoint { private double x,y; diff --git a/src/Entity.java b/src/Entity.java index f2b1cad257fdd28852943200586a8ad39749fdf9..a99a55228ecc356c54904b3c2ae66b9382831005 100644 --- a/src/Entity.java +++ b/src/Entity.java @@ -3,6 +3,11 @@ import bagel.*; import bagel.util.*; import java.lang.*; +/** + * Entity abstract class in ShadowTreasure game, + * This class provides a frame for all objects which exist in + * the ShadowTreasure game. + */ public abstract class Entity { private Image img; private APoint pos; @@ -19,7 +24,5 @@ public abstract class Entity { } public void setPos(APoint pos) { this.pos = pos; } -// @Override -// public String toString() { -// } + } diff --git a/src/Sandwich.java b/src/Sandwich.java index d58250fbed0420193df57b1dc340772e3b0dfbfd..ea8d8d3648980f021694f86badec90597a12e3fe 100644 --- a/src/Sandwich.java +++ b/src/Sandwich.java @@ -1,5 +1,9 @@ import bagel.*; +/** + * Sandwich class in ShadowTreasure game, + * which will increase player's energy when passed through. + */ public class Sandwich extends Entity { public Sandwich(String filename, APoint pos) { super(filename, pos); diff --git a/src/ShadowTreasure.java b/src/ShadowTreasure.java index e36fad9b334195e02deaaa12fa1a43aa213e0759..854ad3f8a295ba847429c6f3c3c5d627610fa3ee 100644 --- a/src/ShadowTreasure.java +++ b/src/ShadowTreasure.java @@ -1,3 +1,9 @@ +/** + Shadow Treasure Game + Template Code by The University of Melbourne + Code edited by: Keigo Nagai (1112132) + */ + import bagel.*; import java.io.File; @@ -8,9 +14,6 @@ import java.text.DecimalFormat; import java.util.Scanner; -/** - * An example Bagel game. - */ public class ShadowTreasure extends AbstractGame { public static final String UTF8_BOM = "\uFEFF"; @@ -21,7 +24,7 @@ public class ShadowTreasure extends AbstractGame { private Player player; private Zombie zombie; private Sandwich sandwich; - private static int count=0; + private int count=0; private final Font deja = new Font("res/font/DejaVuSans-Bold.ttf",24); private Image bg; diff --git a/src/Zombie.java b/src/Zombie.java index e0eab539ac077517b434a7944a6c8c6c2b2337e6..c055b99a6f4f5558b7f60e5429536dbf69894b72 100644 --- a/src/Zombie.java +++ b/src/Zombie.java @@ -1,5 +1,8 @@ import java.lang.*; +/** + * Zombie class in ShadowTreasure game, + */ public class Zombie extends Entity{ public Zombie(String filename, APoint pos) { diff --git a/src/test.java b/src/test.java deleted file mode 100644 index da0decdc18e25b3dd429d0041c1be3bb5013c455..0000000000000000000000000000000000000000 --- a/src/test.java +++ /dev/null @@ -1,7 +0,0 @@ -import bagel.*; -public class test { - public static void main(String[] args) { - Font dejavu = new Font("res/font/DejaVuSans-Bold.ttf",24); - - } -} diff --git a/target/classes/IO/environment.csv b/target/classes/IO/environment.csv deleted file mode 100644 index 79fea88a9ab126ee1e10f0828bcff2047ec182f7..0000000000000000000000000000000000000000 --- a/target/classes/IO/environment.csv +++ /dev/null @@ -1,3 +0,0 @@ -Player,650,100,2 -Zombie,300,200 -Sandwich,500,400 \ No newline at end of file diff --git a/target/classes/font/DejaVuSans-Bold.ttf b/target/classes/font/DejaVuSans-Bold.ttf deleted file mode 100644 index c0d8e5e462df7f268efba09f6931e37daad151e1..0000000000000000000000000000000000000000 Binary files a/target/classes/font/DejaVuSans-Bold.ttf and /dev/null differ diff --git a/target/classes/images/background.png b/target/classes/images/background.png deleted file mode 100644 index a6601996a24eebf1b568ad8e05d2e137a030b52e..0000000000000000000000000000000000000000 Binary files a/target/classes/images/background.png and /dev/null differ diff --git a/target/classes/images/player.png b/target/classes/images/player.png deleted file mode 100644 index 103a2ff1c64ccd5bf18b9ef8b2ca444dbdf204d1..0000000000000000000000000000000000000000 Binary files a/target/classes/images/player.png and /dev/null differ diff --git a/target/classes/images/sandwich.png b/target/classes/images/sandwich.png deleted file mode 100644 index 87e12ec3db6704914262fd359822407fb9ecd172..0000000000000000000000000000000000000000 Binary files a/target/classes/images/sandwich.png and /dev/null differ diff --git a/target/classes/images/zombie.png b/target/classes/images/zombie.png deleted file mode 100644 index 41519c41828d76f5cdfbd9493025d3867347d926..0000000000000000000000000000000000000000 Binary files a/target/classes/images/zombie.png and /dev/null differ diff --git a/target/maven-archiver/pom.properties b/target/maven-archiver/pom.properties deleted file mode 100644 index f50533bad05a26dbc0891a8c413e57c7bfd9d17d..0000000000000000000000000000000000000000 --- a/target/maven-archiver/pom.properties +++ /dev/null @@ -1,5 +0,0 @@ -#Generated by Maven -#Thu Mar 18 12:46:42 AEDT 2021 -groupId=au.edu.unimelb.cis -artifactId=bagel -version=0.1-SNAPSHOT diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst deleted file mode 100644 index 253ae07e82b3e0fff072cc239eba9ee9d4c51140..0000000000000000000000000000000000000000 --- a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst +++ /dev/null @@ -1,5 +0,0 @@ -ShadowTreasure.class -Zombie.class -Sandwich.class -Record.class -Player.class diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst deleted file mode 100644 index cde17032e59ef7d58ce0e5e35b62db883326bf25..0000000000000000000000000000000000000000 --- a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst +++ /dev/null @@ -1,5 +0,0 @@ -/Users/nid1/Desktop/ShadowTreasure/project1/src/Zombie.java -/Users/nid1/Desktop/ShadowTreasure/project1/src/Sandwich.java -/Users/nid1/Desktop/ShadowTreasure/project1/src/Record.java -/Users/nid1/Desktop/ShadowTreasure/project1/src/ShadowTreasure.java -/Users/nid1/Desktop/ShadowTreasure/project1/src/Player.java diff --git a/test/.DS_Store b/test/.DS_Store deleted file mode 100644 index bc5cd1f4e93b98585802e729226ae928f2d68e4b..0000000000000000000000000000000000000000 Binary files a/test/.DS_Store and /dev/null differ diff --git a/test/test1/environment.csv b/test/test1/environment.csv deleted file mode 100644 index 79fea88a9ab126ee1e10f0828bcff2047ec182f7..0000000000000000000000000000000000000000 --- a/test/test1/environment.csv +++ /dev/null @@ -1,3 +0,0 @@ -Player,650,100,2 -Zombie,300,200 -Sandwich,500,400 \ No newline at end of file diff --git a/test/test1/output.csv b/test/test1/output.csv deleted file mode 100644 index 062873bc791d58c919a322121d89fc5ec59203aa..0000000000000000000000000000000000000000 --- a/test/test1/output.csv +++ /dev/null @@ -1,54 +0,0 @@ -650.00,100.00,2 -645.53,108.94,2 -641.06,117.89,2 -636.58,126.83,2 -632.11,135.78,2 -627.64,144.72,2 -623.17,153.67,2 -618.70,162.61,2 -614.22,171.55,2 -609.75,180.50,2 -605.28,189.44,2 -600.81,198.39,2 -596.33,207.33,2 -591.86,216.28,2 -587.39,225.22,2 -582.92,234.16,2 -578.45,243.11,2 -573.97,252.05,2 -569.50,261.00,2 -565.03,269.94,2 -560.56,278.89,2 -556.09,287.83,2 -551.61,296.77,2 -547.14,305.72,2 -542.67,314.66,2 -538.20,323.61,2 -533.72,332.55,2 -529.25,341.50,2 -524.78,350.44,2 -520.31,359.38,2 -512.21,353.52,7 -504.10,347.66,7 -496.00,341.80,7 -487.90,335.94,7 -479.80,330.08,7 -471.70,324.21,7 -463.59,318.35,7 -455.49,312.49,7 -447.39,306.63,7 -439.29,300.77,7 -431.19,294.91,7 -423.08,289.05,7 -414.98,283.18,7 -406.88,277.32,7 -398.78,271.46,7 -390.68,265.60,7 -382.57,259.74,7 -374.47,253.88,7 -366.37,248.02,7 -358.27,242.15,7 -350.17,236.29,7 -342.06,230.43,7 -333.96,224.57,7 -325.86,218.71,4 diff --git a/test/test2/environment.csv b/test/test2/environment.csv deleted file mode 100644 index 114e4b5d2caee833c42560d1813c65d6bb319405..0000000000000000000000000000000000000000 --- a/test/test2/environment.csv +++ /dev/null @@ -1,3 +0,0 @@ -Player,650,100,3 -Zombie,500,500 -Sandwich,300,200 \ No newline at end of file diff --git a/test/test2/output.csv b/test/test2/output.csv deleted file mode 100644 index 8fd27742b73803f50848852a0f79ad6d03929230..0000000000000000000000000000000000000000 --- a/test/test2/output.csv +++ /dev/null @@ -1,40 +0,0 @@ -650.00,100.00,3 -646.49,109.36,3 -642.98,118.73,3 -639.47,128.09,3 -635.96,137.45,3 -632.44,146.82,3 -628.93,156.18,3 -625.42,165.54,3 -621.91,174.91,3 -618.40,184.27,3 -614.89,193.63,3 -611.38,203.00,3 -607.87,212.36,3 -604.35,221.72,3 -600.84,231.09,3 -597.33,240.45,3 -593.82,249.81,3 -590.31,259.18,3 -586.80,268.54,3 -583.29,277.90,3 -579.78,287.27,3 -576.26,296.63,3 -572.75,305.99,3 -569.24,315.36,3 -565.73,324.72,3 -562.22,334.08,3 -558.71,343.45,3 -555.20,352.81,3 -551.69,362.17,3 -548.17,371.54,3 -544.66,380.90,3 -541.15,390.26,3 -537.64,399.63,3 -534.13,408.99,3 -530.62,418.35,3 -527.11,427.72,3 -523.60,437.08,3 -520.08,446.44,3 -516.57,455.81,3 -510.11,448.17,0