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.

Changes

RevisionDateWhoCommit message
87:832ca78426b5 2020-05-27 evanso Final Submission. I have read and agreed with Statement of Academic Integrity. default tip
86:eecd168c3a23 2020-05-27 evanso Fixed bugs in play game and removed any excess included headers.
85:87bc28b151d8 2020-05-26 evanso Spell checked all of code and comments
84:f61c85a5f13a 2020-05-26 evanso Fixed bugs in the game and separated out long functions.
83:35d1e846eab2 2020-05-25 evanso Added many unit tests for PlayEngine class wich all passed!
82:3211b31e9421 2020-05-25 evanso Made commenting and formatting of code more consistent.
81:78c461e6770b 2020-05-25 evanso Removed arrowing(deeply nested if statements) and added game lunch screen.
80:870bc6b4bf08 2020-05-25 evanso 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.
79:66bcf8fa2d2d 2020-05-24 evanso Added high score unit test which it passed!
78:6a6c93c19ed1 2020-05-24 evanso Added SD Errors parent class.
77:2ee9d1f9e282 2020-05-24 evanso 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.
76:6daba3002424 2020-05-24 evanso 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
75:643a509cf9ed 2020-05-23 evanso Created high score menu and added it to the menu.
74:6827b43c689d 2020-05-23 evanso Added music on/off setting which is fully integrated and works.
73:d1aea9b8da92 2020-05-23 evanso Turning sound effects off now actually turns the sound fx off.
72:e7492591307e 2020-05-23 evanso Added sound class to hold songs. Also added tones for when sprites explode.
71:bcbac2cfe005 2020-05-22 evanso Added setting controls method to playable part of game, but also separated it into another function in the game engine
70:8c4572d17441 2020-05-22 evanso Added unit test for the settings menu which it passed. And added one more unit test menu screen which it passed.
69:753ba27325ce 2020-05-22 evanso Finished settings class and added it to into game engine.
68:bb1650c657ef 2020-05-21 evanso Added sprites file to store letter for the title screen and arrows for menus. Also added a time to stop double-button presses.
67:a2984682d641 2020-05-21 evanso 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.
66:33f479036a5d 2020-05-21 evanso Added draw HUD unit test which it passed!
65:daa792a09e1f 2020-05-21 evanso Added unit tests for menu wich both passed!
64:e9dfc35a1738 2020-05-21 evanso Tidy up code in Game Engine class
63:4631447440cf 2020-05-21 evanso Correct error screen show if save isn't present or sd card not inserted
62:f0c86a854a9e 2020-05-20 evanso Can now fully save games and load games
61:7c4ec680a428 2020-05-20 evanso Added no saved games screen
60:55fdc6bb29b9 2020-05-20 evanso Added function to the screen that lets you select with file to save to
59:0b2e43312d6b 2020-05-20 evanso Added saved_game_overide_init function to add to saved data to the playable part of the game when it selected.
58:a9a39424df52 2020-05-19 evanso Added play initialise function to reset variables each times playable part runs.
57:d4ce42c24561 2020-05-19 evanso Added draw game over screen function to GameEngine
56:663d0546c235 2020-05-19 evanso Added pause screen that can excite or save and excite from playable part of game
55:c04568b25617 2020-05-19 evanso Added draw pause screen function to the game engine class.
54:d46459104dea 2020-05-19 evanso Added display_saved_games function and scroll_saved_games function to SavedGames class.
53:01be7898c23f 2020-05-19 evanso Added read saved data function to SavedGames class
52:feb8cf28bcff 2020-05-19 evanso Added add_saved_data function to savedata class
51:35cb8e604b72 2020-05-19 evanso Added check if the file can open function to saved games class.
50:13c8710985f4 2020-05-19 evanso Added check for sd function to saved games
49:ed569eceeaa4 2020-05-19 evanso Created saved games class
48:e308067cfea5 2020-05-19 evanso Added sd card class folder to project folder
47:49fa1adc10b4 2020-05-19 evanso Added accelerometer control function to the game.
46:142a3914c3e3 2020-05-19 evanso Added accelerometer header file
45:fc3238cd28c6 2020-05-19 evanso Added progression to the game so as the time goes on it gets harder.
44:2d957de3bce3 2020-05-19 evanso When lives equal to zero "game over" is displayed and returns to the menu.
43:d43759dbddb9 2020-05-18 evanso Created settings class
42:3aed75338272 2020-05-18 evanso Play game part of the menu works. Gamepad launches into the menu and plays the game when selected.
41:5959256f4aab 2020-05-17 evanso Added function to main to select between different menu parts;
40:71f947254fda 2020-05-17 evanso Added menu class wich scrolls through menu parts and displays them
39:fc5586b930e3 2020-05-16 evanso 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.
38:75bd968daa31 2020-05-16 evanso 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.
37:a05eac7fcb4c 2020-05-16 evanso Added unit test for people wich it passed!! Also changed alien unit test as added more code to the alien class.;
36:27aa597db3d2 2020-05-15 evanso Created Parent Classes folder to hold all of the parent class files. Shortened function lengths in Game Engine class and organised function definitions.
35:577c65bf914e 2020-05-15 evanso Moved check_alien_collision and check_collision into sperate parent classes as code was being written twice.
34:85ccc16f24d2 2020-05-15 evanso 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.
33:7fedd8029473 2020-05-14 evanso Began work on people class. People now randomly print on screen.
32:c006a9882778 2020-05-14 evanso Multiple aliens now spawn in random positions and game has a set spawn rate.
31:6015e8ed859c 2020-05-14 evanso Added get_pos function to position parent class. Added smart bomb weapon to weapons class.
30:814674b189f0 2020-05-14 evanso Added if alien and ship collide the ship is destroyed.
29:e96d91f1d39c 2020-05-14 evanso Fixed collision of spaceship bullets and alien. Added collision of alien bullet with spaceship which cause explosion.
28:a5958497d5ce 2020-05-13 evanso Added Random Movement base class which is inherited by alien bullets and alien direction. Alien now shoots bullets randomly towards the spaceship.