_Simple retro game space-invaders like for Android platform._
I built this video game in 2014 as part of a mobile devices programming course I took. It was developed using just native Android, no frameworks were used. I decided to upload it for two reasons. On the one hand, because it may be useful to people who are getting started on android game programming. On the other hand, because when I re-discover it after a couple of years, I found it nice in some way, so I wanted to preserve it.
Controls are simple. Just tap to shoot and turn your device left and right to move the ship. Accelerometer values will be used to control the horizontal position. Destroy all enemy ships to pass to the level.
Building from source should be straightforward. Clone the repository and import the project with Android Studio.
A GameView
object is created in MainActivity.java
constructor and set as content view.
gameView = new GameView(this,this);
setContentView(gameView);
GameView
extends from SurfaceView and it is the place where the game logic lives. A callback listener to the holder is added in the constructor. The surfaceCreated
method is overriden to start the gameLoopThread
.
This thread will call the onDraw
method of the GameView
class within a loop. This method will draw all the game components with its updated positions each time it is called.
A disclaimer here: If you take a look at the code, you will find a lot of stuff to improve (mostly due to time restrictions and student-level android programming). It is not my idea to spend much more time improving this project however, contributions are always welcome.
The high-level design was taken from edu4java site, using ideas from the android game programming tutorial.
Sprites were taken from MillionthVector. It is a cool blog with many sprites licensed under Creative Commons license.
I had to change the original music because I was not able to find any reference to it on the web. When looking for new songs, I found this great website patrickdearteaga.com which contains lots of royalty-free soundtracks for video games. I picked the one called "New Hope"
This project is licensed under GNU General Public License. See the LICENSE file for details.