Segismundo / Calidad-Software-Junio

GNU General Public License v3.0
0 stars 0 forks source link

Quality Gate Status

Android Space Invader

_Simple retro game space-invaders like for Android platform._

Motivation

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

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

Building from source should be straightforward. Clone the repository and import the project with Android Studio.

Design Overview

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.

Credits

License

This project is licensed under GNU General Public License. See the LICENSE file for details.