Hapi is an API provided by the University with the aim to create a game in it. This API handles all the background DirectX and inputs. The API provides interfaces to input devices and a pointer to the top left of the screen or image being loaded. With this API the screen is held in Main Memory and then copied over into the graphics card. It is rather inefficient for any 3d game today but for a simple 2d game like this one, it handles fine.
I Want To Play The Game!
Here is the game in all it’s simplicity. You will want to make sure you have DirectX 9 installed on your PC. The game uses either keyboard and mouse or the Xbox 360 controller. In the RAR archive you will find a ReadMe to show you how to play the game and the Visitor TT2 -BRK font to make it look nice:
This is a simple 2d game that will have you shooting at alien ships from your ship. You bullets fire forwards and you cant turn, only strafe from side to side. The enemies will spawn in waves and if you make it past wave 6 you will start a new round. The game ends when you loose all your health and lives. Your enemies will move from side to side shooting down, you can fly into them and cause them significant damage but it will also damage you as well just as much. If you do fly into one, it will try to fly in the opposite direction to get away from you. They will also change direction if they fly into one of your bullets.
The game has blackboxed components that seperate out parts of the game and make it easier to work with. In this game I have a Visualisation, World and Input class. The Visualisation class handles all the drawing to the screen and stores an array of sprites that can be used.
The World class manages all of the entities in the world. It can update the positions and healths and other attributes of all the entities. Some entities can update their positions by themselves like the bullets so that they will reach their destination and the world class does not have to update them itself.
The Input class provideds a minimal interface to get the values of the controller, keyboard and mouse so that it doesn’t make the world component messy with it’s implementation.