Ministar Galactica


Ministar Galactica is a small interactive, web-based game built using the HTML5 canvas and JavaScript. The game itself is based on the fictional Battlestar Galactica war between human and Cylon forces, where both sides primarily use small single pilot space craft to attack the enemy's larger cruisers. In this game, the player takes control of one of Battlestar Galactica's "Viper" fighters to help defend the ship against the oncoming Cylon "Raiders".

The player must dodge enemy fighters whilst using the Viper's energy weapons to destroy them and increase their score. As the player destroys more enemies, they will advance to higher levels where enemies appear more frequently and in higher numbers. Throughout the game, random powersups will appear that the player can collec to to give them an advantage such as an extra life, or to destroy all enemies on screen. Each time the player gets hit by an enemy they will lose a life, and the game ends when the player has run out of spare lives and dies once more. Once dead, the player has a chance to upload their score to the leader boards, or play again.

Versions of this game

The main, fully working version is located at A copy is also stored at that has no high score functionality, as this is located in a MySQL database on the servers.


Some of the game's features that I am particularly proud of include:

Resources Used

I used JQuery to make the keyboard controlled movement smoother by setting a Boolean flag to true when a key was pressed down, then updated the position of the player depending on which flag was true. This made it very easy to move the player diagonally, as I just had to detect when 2 flags were true before checking each individual one. The JQuery methods I used were "onKeyDown" and "onKeyUp" and used this JQuery link.

As well as code that I had previously written myself in university modules (such as CS25010), I also used some resources found on the web to improve my HTML5 and JavaScript, such as w3schools and an intriguing article entitled " No tears guide to HTML5 Games" where I learnt about how to move enemies by using the "sin" function. When an increasing value is entered into the following equation: ( speed = 3 * Math.sin(incrementingValue * Math.PI / 64); ) the output will be a mathematical "Sin" wave. I saw this as a great base on which to build on for the randomised movement of each enemy. From this tutorial, w3schools and a few Google searches, I learnt about other things like how constructors can be used in JavaScript like Java classes.


All images used on this site including player, enemy and powerup sprites, backgrounds and logos were created by myself using Macromedia Fireworks.


I use many sound effects in my game as well as some background music. All of these files were obtained off free, royalty free music sites such as Some sound clips I have edited myself using tools like Mp3 cut to make my own sound effects.

I found my sounds at the following locations:

Declaration of Originality

I declare that the contents of this site are entirely my own work, with the excptions outlined above(such as JQuery and "Sin" method of movement). Resources I used include the example code for this module, W3Schools and my own code. I also searched the internet for solutions to many problems and error messages etc. The Images made by myself, and sounds are royalty free/free to use. Disclaimer: The information provided on this and other pages by me, Matt Robbins (, is under my own personal responsibility and not that of Aberystwyth University. Similarly, any opinions expressed are my own and are in no way to be taken as those of A.U.

Matt Robbins 23/04/2012