Hacker News new | ask | show | jobs
by joelackner 5288 days ago
i'm not a programmer. how do i build his source in eclipse? the closest i get is this and i'm stumped: http://i41.tinypic.com/opxrna.png
2 comments

I don't know how to configure eclipse to build this, but I spent a few minutes and made an ant script. Save [it](https://gist.github.com/1dd9bd89748f489f67c9) as `build.xml` in root directory of the project and run `$ ant jar`. This will produce `minicraft.jar` which you can execute by running `$ java -jar minicraft.jar`.

(Details: The reason eclipse is complaining is because the images weren't included as resources in the classpath. This cause a null pointer exception when the game attempts to load it's sprites. I don't really use eclipse, so I'm not sure how to fix it)

That happened to me as well (also not a programmer). It is because the directory with the sounds and images, called 'res', is not in the right place. You need to move the 'res' folder into the 'bin' folder.
Try this version on github, you can compile and run the source with 'ant run': https://github.com/skeeto/Minicraft
I hope you two will have some fun browsing the code and just messing around. Might be a well-motivated introduction to programming.