Skip to content

vakiovale/meteoroids

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

meteoroids

Clone of the classic Asteroids game.

What's happening?

You must protect Earth from flying meteoroids! Destroy all the meteoroids before they hit the ground.

Save Earth! - Meteoroids

Jupiter needs your help!

How to play

Try to keep planets alive as long as you can by shooting all the meteoroids.

Key Action
UP Accelerate
DOWN Slow down
LEFT Steer left
RIGHT Steer right
SPACE Fire
LEFT CTRL Change weapon
P Pause game
ESC Main menu

Running Meteoroids from command line (Linux - easy)

This is the easiest way to build and run Meteoroids when you are in Linux environment. This has been tested also on Windows when using GitBash (unix like shell).

Run these Linux scripts from Meteoroids/ folder:

./libinstall ./cleanbuild

...and then you can start the program with:

./run

Happy shooting!

Running Meteoroids from command line

  1. Install slick-util library:
mvn install:install-file -Dfile=lib/slick-util.jar -DgroupId=slick-util -DartifactId=slick-util -Dversion=1.0 -Dpackaging=jar
  1. Clean and compile project with Maven:
mvn clean:clean && mvn compile && mvn nativedependencies:copy
  1. Sometimes needed when failing to copy native dependencies to the target/natives directory: mvn package

  2. Set up MAVEN_OPTS environment variable (use unix version ALSO in Windows when using GitBash in unix mode):

**windows:** set MAVEN_OPTS="-Djava.library.path=target/natives" **unix:** export MAVEN_OPTS=-Djava.library.path=target/natives
  1. Run Meteoroids: mvn compile exec:java -Dexec.mainClass=meteoroids.Meteoroids.Main

More information on setting up LWJGL project with Maven: http://wiki.lwjgl.org/wiki/Setting_Up_LWJGL_with_Maven

Importing project to Eclipse, Netbeans, etc. (IDE)

Use IDE's own import Maven project tool and import the Meteoroids folder. Add -Djava.library.path=target/natives to the project's VM options.

Eclipse: "Run" -> "Run configurations..." -> "Java Application" -> "Main" -> "Arguments" -> "VM arguments:"

NetBeans: Project Properties -> "Run" -> "VM Options:"

Troubleshooting

Problems starting the application?

Try this:

mvn clean:clean && mvn compile && mvn nativedependencies:copy && mvn package && export MAVEN_OPTS=-Djava.library.path=target/natives && mvn compile exec:java -Dexec.mainClass=meteoroids.Meteoroids.Main

After this, the program should start. Hope this works!

Known issues

  • some graphical glitches appear
    • star field isn't drawn on some Windows machines when running from jar/exe-file
    • some objects are drawn wrong when OpenGL version > 3.0
  • mvn package does not include native libraries (using JarSplice instead)
  • tests run with mvn test doesn't work if native libraries are needed (works well when using IDE)