JacksonHoggard / voodoo2d

👹 2D Java Game Engine built in OpenGL
MIT License
131 stars 50 forks source link

Windows specific hardcoded paths causes sample game to crush #22

Closed merlinDM closed 2 years ago

merlinDM commented 3 years ago

Describe the bug Windows specific hardcoded paths causes IO Exceptions during runtime.

  1. java.io.FileNotFoundException: /path/to/voodoo2d/src\main\resources\maps\example.tmx Probable cause is hardcoded path here: src/main/java/com/github/crembluray/voodoo2d/game/MapTree.java
  2. javax.imageio.IIOException: Can't read input file! Probable cause is hardcoded path here: src/main/java/com/github/crembluray/voodoo2d/engine/mapping/Layer.java

Changing the paths helped to run the demo.

To Reproduce Steps to reproduce the behavior:

  1. Use any POSIX OS.
  2. Switch to 83c745.
  3. Add Maven exec plugin to pom.xml and specify com.github.crembluray.voodoo2d.game.Main as main class:
    <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>1.6.0</version>
        <configuration>
        <mainClass>com.github.crembluray.voodoo2d.game.Main</mainClass>
        </configuration>
    </plugin>
  4. Run $ mvn clean install exec:java

Expected behavior Demo shouldn't crash.

Desktop (please complete the following information):

JacksonHoggard commented 3 years ago

Thanks for catching this! I've been meaning to change this, I used the hardcoded path for testing and I forgot to remove it. Bad commit practice on my part!