Space War is a 2D side-scrolling space arcade game. The objective of this project was to create an exciting action game which is enjoyable to play. It includes a level editor so that people can build their own levels. Travel through space, shooting enemies and gaining points. Prepare for the final battle and try to stay alive. Destroy enemy space ships to receive power-ups including health, weapon upgrades and special weapon capabilities.
This project was my final assignement for a mobile technology module at Kingston University. The source code is all written in the Java with the Android SDK.
The keyboard controls for the Java SE version of the game in the release are as follows:
Arrow keys = Move spaceship
Space = Shoot
Ctrl = Fire powerup
Enter = Select Menu Item or Pause
Here are some screenshots of the game running:
Below are the instructions on how to setup and run the various projects.
The following Java projects were built using Eclipse.
- SpaceWar-Java
- SpaceWar-Applet
Download the required software here:
Here are the instructions to install the Java SDK and setup Eclipse:
- Run the jdk-7u80-windows-x64.exe file to install the SDK
- Extract the adt-bundle-windows-x86_64-20140702.zip to C:\Program Files\Eclipse
To import the projects in Eclipse follow these instructions:
- Open Eclipse
- Select File -> Import...
- Choose the import source -> General -> Existing Projects into Workspace
- Select the directory of the project you want to open in the source code folder
- Select Finish
You should now be able to choose the project in the Package Explorer and select Run to start the application.
The SpaceWar-Java project includes an editor to create new levels.
- From the main game menu select Edit Level and 1.lvl to open an example level map
- The editor includes instructions on how to edit or create a level
- Press the enter key and select options to edit level settings such as background, tileset and dimensions
Download the required software here:
- Install Android Studio
- Open the SpaceWar-Android project
- Select Tools -> SDK Manager -> SDK Platforms tab and ensure Android API 34 is installed
- Select Tools -> SDK Manager -> SDK Tools tab and ensure Android SDK Build-Tools 34 is installed
- If there are still build errors try selecting File -> Invalidate Caches...
If you get an error stating SDK Location not found this is because the local.properties file is not found as it should not be checked into version control and should be generated automatically by Android Studio. If this happens create a new text file in the root of the project folder called local.properties and add the following specifying the location of your Android SDK folder:
sdk.dir=C\:\\Users\\User\\AppData\\Local\\Android\\Sdk
You should now be able to press the run button and launch the application on a connected device.
If you want to test the application using a virtual device:
- Select Tools -> Device Manager
- Click Create Device
- Choose a device. I recommend Nexus S
- Download a system image
- Give the device a name and click Finish
You should now be able to press the run button and launch the application on a AVD.