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 GameEngine/GameEngine.cpp

Revision Date Message Actions
87:832ca78426b5 2020-05-27 Final Submission. I have read and agreed with Statement of Academic Integrity. File  Diff  Annotate
86:eecd168c3a23 2020-05-27 Fixed bugs in play game and removed any excess included headers. File  Diff  Annotate
85:87bc28b151d8 2020-05-26 Spell checked all of code and comments File  Diff  Annotate
84:f61c85a5f13a 2020-05-26 Fixed bugs in the game and separated out long functions. File  Diff  Annotate
82:3211b31e9421 2020-05-25 Made commenting and formatting of code more consistent. File  Diff  Annotate
81:78c461e6770b 2020-05-25 Removed arrowing(deeply nested if statements) and added game lunch screen. File  Diff  Annotate
80:870bc6b4bf08 2020-05-25 Split GameEngine class into two different classes to reduce its size The parent class PlayEngine was created to hold the function that control the interaction between classes in the playable part of the game and so they can be unit tested. File  Diff  Annotate
79:66bcf8fa2d2d 2020-05-24 Added high score unit test which it passed! File  Diff  Annotate
77:2ee9d1f9e282 2020-05-24 High score area in the menu now displays the high score. High score updates correctly and correct error messages show when sd card isn't present or no high score is set. File  Diff  Annotate
76:6daba3002424 2020-05-24 Added functions to high score that save and read the high score. Displays "NEW HIGH SOCRE" on the game over screen and plays a different song File  Diff  Annotate
74:6827b43c689d 2020-05-23 Added music on/off setting which is fully integrated and works. File  Diff  Annotate
73:d1aea9b8da92 2020-05-23 Turning sound effects off now actually turns the sound fx off. File  Diff  Annotate
72:e7492591307e 2020-05-23 Added sound class to hold songs. Also added tones for when sprites explode. File  Diff  Annotate
71:bcbac2cfe005 2020-05-22 Added setting controls method to playable part of game, but also separated it into another function in the game engine File  Diff  Annotate
70:8c4572d17441 2020-05-22 Added unit test for the settings menu which it passed. And added one more unit test menu screen which it passed. File  Diff  Annotate
69:753ba27325ce 2020-05-22 Finished settings class and added it to into game engine. File  Diff  Annotate
68:bb1650c657ef 2020-05-21 Added sprites file to store letter for the title screen and arrows for menus. Also added a time to stop double-button presses. File  Diff  Annotate
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
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
62:f0c86a854a9e 2020-05-20 Can now fully save games and load games File  Diff  Annotate
61:7c4ec680a428 2020-05-20 Added no saved games screen File  Diff  Annotate
60:55fdc6bb29b9 2020-05-20 Added function to the screen that lets you select with file to save to 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
58:a9a39424df52 2020-05-19 Added play initialise function to reset variables each times playable part runs. File  Diff  Annotate
57:d4ce42c24561 2020-05-19 Added draw game over screen function to GameEngine File  Diff  Annotate
56:663d0546c235 2020-05-19 Added pause screen that can excite or save and excite from playable part of game File  Diff  Annotate
55:c04568b25617 2020-05-19 Added draw pause screen function to the game engine class. File  Diff  Annotate
51:35cb8e604b72 2020-05-19 Added check if the file can open function to saved games class. File  Diff  Annotate
49:ed569eceeaa4 2020-05-19 Created saved games class File  Diff  Annotate
47:49fa1adc10b4 2020-05-19 Added accelerometer control function to the game. File  Diff  Annotate
45:fc3238cd28c6 2020-05-19 Added progression to the game so as the time goes on it gets harder. File  Diff  Annotate
44:2d957de3bce3 2020-05-19 When lives equal to zero "game over" is displayed and returns to the menu. 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
36:27aa597db3d2 2020-05-15 Created Parent Classes folder to hold all of the parent class files. Shortened function lengths in Game Engine class and organised function definitions. File  Diff  Annotate
34:85ccc16f24d2 2020-05-15 Added when aliens collide with people, the people are abducted to the top of the screen. Then that alien tracks the spaceship and moves towards it rather than randomly moving. File  Diff  Annotate
33:7fedd8029473 2020-05-14 Began work on people class. People now randomly print on screen. File  Diff  Annotate
32:c006a9882778 2020-05-14 Multiple aliens now spawn in random positions and game has a set spawn rate. File  Diff  Annotate
31:6015e8ed859c 2020-05-14 Added get_pos function to position parent class. Added smart bomb weapon to weapons class. File  Diff  Annotate
30:814674b189f0 2020-05-14 Added if alien and ship collide the ship is destroyed. File  Diff  Annotate
29:e96d91f1d39c 2020-05-14 Fixed collision of spaceship bullets and alien. Added collision of alien bullet with spaceship which cause explosion. File  Diff  Annotate
28:a5958497d5ce 2020-05-13 Added Random Movement base class which is inherited by alien bullets and alien direction. Alien now shoots bullets randomly towards the spaceship. 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
25:70b55f5bfc87 2020-05-12 Added explosion class. When the alien is now shot it explodes. File  Diff  Annotate
24:479da6ca0e7e 2020-05-12 Alien moves randomly and loops with the map when the spaceship get to the edge of the map. Alien also cant move off the map and can move towards the spaceship. File  Diff  Annotate
21:f7d7834e3af1 2020-05-05 Alien now moves with the map as the spaceship moves. Alien also moves towards the x position of the spaceship by its self. File  Diff  Annotate
20:febd920ec29e 2020-05-04 Added collision detection so the alien and bullet is deleted if a bullet hits it. File  Diff  Annotate
19:1bc0a2d22054 2020-05-03 Bullets can now be shot in both directions. Began work on alien class. 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
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
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
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