diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..359bb5307e8535ab7d59faf27a7377033291821e --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# 默认忽略的文件 +/shelf/ +/workspace.xml diff --git a/.idea/jiaxi3-project-1.iml b/.idea/jiaxi3-project-1.iml new file mode 100644 index 0000000000000000000000000000000000000000..29870a6e8dc0a32f457a5a8cae8e38bec3a953bd --- /dev/null +++ b/.idea/jiaxi3-project-1.iml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4"> + <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_11"> + <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$/res" type="java-resource" /> + <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: org.lwjgl:lwjgl:3.3.1" level="project" /> + <orderEntry type="library" name="Maven: org.lwjgl:lwjgl-assimp:3.3.1" level="project" /> + <orderEntry type="library" name="Maven: org.lwjgl:lwjgl-glfw:3.3.1" level="project" /> + <orderEntry type="library" name="Maven: org.lwjgl:lwjgl-openal:3.3.1" level="project" /> + <orderEntry type="library" name="Maven: org.lwjgl:lwjgl-opengl:3.3.1" level="project" /> + <orderEntry type="library" name="Maven: org.lwjgl:lwjgl-stb:3.3.1" level="project" /> + <orderEntry type="library" name="Maven: org.lwjgl:lwjgl:natives-windows:3.3.1" level="project" /> + <orderEntry type="library" name="Maven: org.lwjgl:lwjgl-assimp:natives-windows:3.3.1" level="project" /> + <orderEntry type="library" name="Maven: org.lwjgl:lwjgl-glfw:natives-windows:3.3.1" level="project" /> + <orderEntry type="library" name="Maven: org.lwjgl:lwjgl-openal:natives-windows:3.3.1" level="project" /> + <orderEntry type="library" name="Maven: org.lwjgl:lwjgl-opengl:natives-windows:3.3.1" level="project" /> + <orderEntry type="library" name="Maven: org.lwjgl:lwjgl-stb:natives-windows:3.3.1" level="project" /> + <orderEntry type="library" name="Maven: io.github.eleanor-em:bagel:1.9.3" level="project" /> + </component> +</module> \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000000000000000000000000000000000000..c985a2f3799948495529de7a6610ff4319963310 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="MavenProjectsManager"> + <option name="originalFiles"> + <list> + <option value="$PROJECT_DIR$/pom.xml" /> + </list> + </option> + </component> + <component name="ProjectRootManager" version="2" languageLevel="JDK_18" default="true" project-jdk-name="openjdk-18" project-jdk-type="JavaSDK"> + <output url="file://$PROJECT_DIR$/out" /> + </component> +</project> \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000000000000000000000000000000000000..d3e083cf4649e2e4a563bdc40095d04788dc8cc9 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ProjectModuleManager"> + <modules> + <module fileurl="file://$PROJECT_DIR$/.idea/jiaxi3-project-1.iml" filepath="$PROJECT_DIR$/.idea/jiaxi3-project-1.iml" /> + </modules> + </component> +</project> \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000000000000000000000000000000000000..830674470f8052bb64c64a5b513f5df2815a70c1 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="VcsDirectoryMappings"> + <mapping directory="" vcs="Git" /> + <mapping directory="$PROJECT_DIR$" vcs="Git" /> + </component> +</project> \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..75602ffdcff8e9d1f69201ded75b8c466f83da41 --- /dev/null +++ b/pom.xml @@ -0,0 +1,70 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <groupId>au.edu.unimelb.cis</groupId> + <artifactId>bagel</artifactId> + <version>0.1-SNAPSHOT</version> + <packaging>jar</packaging> + + <build> + <sourceDirectory>src/</sourceDirectory> + <plugins> + <plugin> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <source>11</source> + <target>11</target> + </configuration> + </plugin> + </plugins> + </build> + + <properties> + <maven.compiler.source>11</maven.compiler.source> + <maven.compiler.target>11</maven.compiler.target> + <lwjgl.version>3.3.1</lwjgl.version> + </properties> + + <profiles> + <profile><id>lwjgl-natives-linux-amd64</id><activation><os><family>unix</family><arch>amd64</arch></os></activation><properties><lwjgl.natives>natives-linux</lwjgl.natives></properties></profile> + <profile><id>lwjgl-natives-linux-aarch64</id><activation><os><family>unix</family><arch>aarch64</arch></os></activation><properties><lwjgl.natives>natives-linux-arm64</lwjgl.natives></properties></profile> + <profile><id>lwjgl-natives-macos-x86_64</id><activation><os><family>mac</family><arch>x86_64</arch></os></activation><properties><lwjgl.natives>natives-macos</lwjgl.natives></properties></profile> + <profile><id>lwjgl-natives-macos-aarch64</id><activation><os><family>mac</family><arch>aarch64</arch></os></activation><properties><lwjgl.natives>natives-macos-arm64</lwjgl.natives></properties></profile> + <profile><id>lwjgl-natives-windows-amd64</id><activation><os><family>windows</family><arch>amd64</arch></os></activation><properties><lwjgl.natives>natives-windows</lwjgl.natives></properties></profile> + </profiles> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.lwjgl</groupId> + <artifactId>lwjgl-bom</artifactId> + <version>${lwjgl.version}</version> + <scope>import</scope> + <type>pom</type> + </dependency> + </dependencies> + </dependencyManagement> + + <dependencies> + <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl</artifactId></dependency> + <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-assimp</artifactId></dependency> + <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-glfw</artifactId></dependency> + <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-openal</artifactId></dependency> + <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-opengl</artifactId></dependency> + <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-stb</artifactId></dependency> + <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl</artifactId><classifier>${lwjgl.natives}</classifier></dependency> + <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-assimp</artifactId><classifier>${lwjgl.natives}</classifier></dependency> + <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-glfw</artifactId><classifier>${lwjgl.natives}</classifier></dependency> + <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-openal</artifactId><classifier>${lwjgl.natives}</classifier></dependency> + <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-opengl</artifactId><classifier>${lwjgl.natives}</classifier></dependency> + <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-stb</artifactId><classifier>${lwjgl.natives}</classifier></dependency> + <dependency> + <groupId>io.github.eleanor-em</groupId> + <artifactId>bagel</artifactId> + <version>1.9.3</version> + </dependency> + </dependencies> +</project> \ No newline at end of file diff --git a/res/background0.png b/res/background0.png new file mode 100644 index 0000000000000000000000000000000000000000..ef55eec4b7b0c7e8cb0e6eeef04cca49354758b8 Binary files /dev/null and b/res/background0.png differ diff --git a/res/faeLeft.png b/res/faeLeft.png new file mode 100644 index 0000000000000000000000000000000000000000..8eb977be88b8fb2a7a89ecea67efb4019fa50ffe Binary files /dev/null and b/res/faeLeft.png differ diff --git a/res/faeRight.png b/res/faeRight.png new file mode 100644 index 0000000000000000000000000000000000000000..38eb7d6d5ab536c808f2cfbbaf78e9ea5b2cf2e3 Binary files /dev/null and b/res/faeRight.png differ diff --git a/res/frostbite.ttf b/res/frostbite.ttf new file mode 100644 index 0000000000000000000000000000000000000000..714a9a1b03a2b0f2b7691d148fc2f144195470c8 Binary files /dev/null and b/res/frostbite.ttf differ diff --git a/res/level0.csv b/res/level0.csv new file mode 100644 index 0000000000000000000000000000000000000000..4241ee8d2ffbb9010b064f36651757afac768893 --- /dev/null +++ b/res/level0.csv @@ -0,0 +1,60 @@ +Player,5,696 +Wall,120,700 +Wall,120,650 +Wall,120,600 +Wall,120,550 +Wall,120,500 +Wall,120,450 +Wall,120,400 +Wall,120,250 +Wall,120,200 +Wall,120,150 +Wall,65,150 +Wall,177,250 +Wall,235,550 +Wall,235,500 +Wall,235,450 +Wall,235,400 +Wall,235,350 +Wall,235,300 +Wall,290,550 +Wall,345,550 +Wall,485,700 +Wall,485,650 +Wall,485,600 +Wall,292,252 +Wall,350,252 +Wall,160,10 +Wall,220,15 +Wall,280,15 +Wall,340,15 +Wall,340,85 +Wall,540,150 +Wall,540,100 +Wall,615,500 +Wall,670,500 +Wall,725,500 +Wall,780,500 +Wall,780,450 +Wall,780,400 +Wall,780,350 +Wall,723,300 +Wall,664,250 +Wall,604,200 +Wall,615,700 +Wall,670,700 +Wall,725,700 +Wall,780,700 +Wall,780,640 +Wall,960,570 +Wall,690,15 +Wall,760,75 +Wall,830,135 +Wall,890,195 +Sinkhole,255,655 +Sinkhole,960,250 +Sinkhole,550,550 +Sinkhole,450,150 +Sinkhole,58,240 +TopLeft,0,0 +BottomRight,984,709 \ No newline at end of file diff --git a/res/sinkhole.png b/res/sinkhole.png new file mode 100644 index 0000000000000000000000000000000000000000..9785b68255ce1fa5a8cf8f6003de7b51db4cccf4 Binary files /dev/null and b/res/sinkhole.png differ diff --git a/res/wall.png b/res/wall.png new file mode 100644 index 0000000000000000000000000000000000000000..f7eb82cc58563ded1bc13f6f2ab8a87ea481d3bc Binary files /dev/null and b/res/wall.png differ diff --git a/src/ShadowDimension.java b/src/ShadowDimension.java new file mode 100644 index 0000000000000000000000000000000000000000..b781d1866f5291ca67b64718b168f91ef43d787e --- /dev/null +++ b/src/ShadowDimension.java @@ -0,0 +1,49 @@ +import bagel.*; + +/** + * Skeleton Code for SWEN20003 Project 1, Semester 2, 2022 + * + * Please enter your name below + * @author + */ + +public class ShadowDimension extends AbstractGame { + private final static int WINDOW_WIDTH = 1024; + private final static int WINDOW_HEIGHT = 768; + private final static String GAME_TITLE = "SHADOW DIMENSION"; + private final Image BACKGROUND_IMAGE = new Image("res/background0.png"); + + public ShadowDimension(){ + super(WINDOW_WIDTH, WINDOW_HEIGHT, GAME_TITLE); + } + + /** + * The entry point for the program. + */ + public static void main(String[] args) { + ShadowDimension game = new ShadowDimension(); + game.run(); + } + + /** + * Method used to read file and create objects (You can change this + * method as you wish). + */ + private void readCSV(){ + + } + + /** + * Performs a state update. + * allows the game to exit when the escape key is pressed. + */ + @Override + protected void update(Input input) { + BACKGROUND_IMAGE.draw(Window.getWidth()/2.0, Window.getHeight()/2.0); + + if (input.wasPressed(Keys.ESCAPE)){ + Window.close(); + } + + } +}