Ben Evans University Second Year Project. Game Called Defender.

Dependencies:   mbed

https://os.mbed.com/media/uploads/evanso/84bc1a30759fd6a1e3f1fd1fae3e97c2.png

Hello, soldier, you have been specially selected as the defender of planet earth.

Your mission, if you choose to accept it. Fly around the planet and pulverise invading alien ships for as long as you can. Stop the aliens abducting the innocent people on the ground. Be warned if an alien ship manages to abduct a person and take them to top of the screen, they will no longer move randomly and will begin to hunt you down. This sounds like a challenge you were trained for.

But don’t worry soldier you’re not going into battle empty-handed. Your ship is equipped with a state of the art laser beam that has unlimited ammo and four smart bombs that will destroy anything on the screen. The ship also has three lives so use them wisely.

As time goes on more alien ships will arrive on planet earth increasing the difficulty of your mission. And remember the landscape bellow loops around so if you continually fly in the same direction you go to your original position. Good luck soldier.

Revisions of main.cpp

Revision Date Message Actions
67:a2984682d641 2020-05-21 Added SaveGame unit test which all passed! Had to define the unit test that tests actually saving and reading from a file as kept getting an error when declaring the sd object. File  Diff  Annotate
66:33f479036a5d 2020-05-21 Added draw HUD unit test which it passed! File  Diff  Annotate
65:daa792a09e1f 2020-05-21 Added unit tests for menu wich both passed! File  Diff  Annotate
64:e9dfc35a1738 2020-05-21 Tidy up code in Game Engine class File  Diff  Annotate
63:4631447440cf 2020-05-21 Correct error screen show if save isn't present or sd card not inserted File  Diff  Annotate
59:0b2e43312d6b 2020-05-20 Added saved_game_overide_init function to add to saved data to the playable part of the game when it selected. File  Diff  Annotate
47:49fa1adc10b4 2020-05-19 Added accelerometer control function to the game. File  Diff  Annotate
43:d43759dbddb9 2020-05-18 Created settings class File  Diff  Annotate
42:3aed75338272 2020-05-18 Play game part of the menu works. Gamepad launches into the menu and plays the game when selected. File  Diff  Annotate
41:5959256f4aab 2020-05-17 Added function to main to select between different menu parts; File  Diff  Annotate
40:71f947254fda 2020-05-17 Added menu class wich scrolls through menu parts and displays them File  Diff  Annotate
39:fc5586b930e3 2020-05-16 Added HUD (heads up display) class wich displays point, lives and smart bombed lefts. The amount of lives also interacts with LED's through a function in GameEngine. File  Diff  Annotate
38:75bd968daa31 2020-05-16 Added one more unit test, collision of alien and people, which it passed. This also confirms that collision of alien and spaceship will work as it inherits same parent method. File  Diff  Annotate
37:a05eac7fcb4c 2020-05-16 Added unit test for people wich it passed!! Also changed alien unit test as added more code to the alien class.; File  Diff  Annotate
33:7fedd8029473 2020-05-14 Began work on people class. People now randomly print on screen. File  Diff  Annotate
27:8bb2bd97c319 2020-05-13 Added position parent class for other classes to inherit XY positions and direction bool. Added more Doxygen comments. Made code and comments multi-line to increase readability. File  Diff  Annotate
26:1a7056eb3253 2020-05-13 Added unit test for explosion class which it passed! File  Diff  Annotate
25:70b55f5bfc87 2020-05-12 Added explosion class. When the alien is now shot it explodes. File  Diff  Annotate
23:cc44e26c08fa 2020-05-06 Added unit test for weapons class which it passed! File  Diff  Annotate
22:053c11a202e1 2020-05-06 Now that the main code structure is finished for alien and weapons I can unit test those classes. Added a unit test for the alien class and it passed! File  Diff  Annotate
18:11068b98e261 2020-05-01 Added functions so if button A is press the spaceship shoots a bullet. File  Diff  Annotate
17:25d79cca203a 2020-04-29 Changed spaceship class to return x and y position as a Vector2D. Added calculate bullet start position function to weapons class. File  Diff  Annotate
16:1ee3d3804557 2020-04-28 Began work on weapons class. slightly changed map movement and spaceship movement functions to adjust where the spaceship sits on the screen when moving, in order to allow space for bullets. File  Diff  Annotate
15:90b6821bcf64 2020-04-28 Added DEBUG compile macros to check calculate_map_map was producing correct output File  Diff  Annotate
14:7419c680656f 2020-04-26 Added map movement test unit and doxygen details to comments. File  Diff  Annotate
13:12276eed13ac 2020-04-26 Changed spaceship unit test code so it now done properly and doesn't require my input. Changed where objects are defined to reduce the number of arguments that need passing when a function is called. Edited gamepad code to properly add ADC pin. File  Diff  Annotate
12:1c0b6796aaca 2020-04-24 Added unit test for map, which it passed. File  Diff  Annotate
11:ab578a151f67 2020-04-23 Added test files and ran a spaceship unit test, which it passed! Also cleaned up code and comments. File  Diff  Annotate
10:aca793aa7abc 2020-04-22 Reduced length of spaceship movement function using a switch statement. In the previous commit, I changed the draw line function in the LCD class; I changed its unassigned int variables to normal int variables as it was crashing the game. File  Diff  Annotate
9:1ddb8dc93e48 2020-04-21 Made the map loop back on its self when you reach the ends, therefore the map never ends File  Diff  Annotate
8:dd1037c5435b 2020-04-19 Added GameEnigne class to run the different parts of the game and tidied up code. File  Diff  Annotate
7:0af4ced868f5 2020-04-18 A random map now is drawn on the screen and the map moves with joystick input making it look like the spaceship is moving through the map. File  Diff  Annotate
6:12e8433382b3 2020-04-16 Restricted spaceship movement to middle third of the screen in the x-direction. Started adding drawing functions to map class. File  Diff  Annotate
4:0df2b85e47f1 2020-04-14 Added sprite movement using the analogue stick File  Diff  Annotate
3:dee187b8b30c 2020-04-13 Drawn spaceship sprite and displays it on LCD using event-triggered tasks File  Diff  Annotate
2:86e6a67f35a9 2020-04-09 initial commit File  Diff  Annotate
1:1f2ae263248e 2020-02-23 Sart of Project ; File  Diff  Annotate
0:b7f1f47bb26a 2020-02-03 ELEC2645 starter project File  Diff  Annotate