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.

Committer:
evanso
Date:
Wed May 27 02:06:05 2020 +0000
Revision:
87:832ca78426b5
Parent:
48:e308067cfea5
Final Submission. I have read and agreed with Statement of Academic Integrity.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
evanso 48:e308067cfea5 1 /* mbed Microcontroller Library
evanso 48:e308067cfea5 2 * Copyright (c) 2006-2012 ARM Limited
evanso 48:e308067cfea5 3 *
evanso 48:e308067cfea5 4 * Permission is hereby granted, free of charge, to any person obtaining a copy
evanso 48:e308067cfea5 5 * of this software and associated documentation files (the "Software"), to deal
evanso 48:e308067cfea5 6 * in the Software without restriction, including without limitation the rights
evanso 48:e308067cfea5 7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
evanso 48:e308067cfea5 8 * copies of the Software, and to permit persons to whom the Software is
evanso 48:e308067cfea5 9 * furnished to do so, subject to the following conditions:
evanso 48:e308067cfea5 10 *
evanso 48:e308067cfea5 11 * The above copyright notice and this permission notice shall be included in
evanso 48:e308067cfea5 12 * all copies or substantial portions of the Software.
evanso 48:e308067cfea5 13 *
evanso 48:e308067cfea5 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
evanso 48:e308067cfea5 15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
evanso 48:e308067cfea5 16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
evanso 48:e308067cfea5 17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
evanso 48:e308067cfea5 18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
evanso 48:e308067cfea5 19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
evanso 48:e308067cfea5 20 * SOFTWARE.
evanso 48:e308067cfea5 21 */
evanso 48:e308067cfea5 22 #ifndef MBED_FATFILESYSTEM_H
evanso 48:e308067cfea5 23 #define MBED_FATFILESYSTEM_H
evanso 48:e308067cfea5 24
evanso 48:e308067cfea5 25 #include "FileSystemLike.h"
evanso 48:e308067cfea5 26 #include "FileHandle.h"
evanso 48:e308067cfea5 27 #include "ff.h"
evanso 48:e308067cfea5 28 #include <stdint.h>
evanso 48:e308067cfea5 29
evanso 48:e308067cfea5 30 using namespace mbed;
evanso 48:e308067cfea5 31
evanso 48:e308067cfea5 32 /**
evanso 48:e308067cfea5 33 * FATFileSystem based on ChaN's Fat Filesystem library v0.8
evanso 48:e308067cfea5 34 */
evanso 48:e308067cfea5 35 class FATFileSystem : public FileSystemLike {
evanso 48:e308067cfea5 36 public:
evanso 48:e308067cfea5 37
evanso 48:e308067cfea5 38 FATFileSystem(const char* n);
evanso 48:e308067cfea5 39 virtual ~FATFileSystem();
evanso 48:e308067cfea5 40
evanso 48:e308067cfea5 41 static FATFileSystem * _ffs[_VOLUMES]; // FATFileSystem objects, as parallel to FatFs drives array
evanso 48:e308067cfea5 42 FATFS _fs; // Work area (file system object) for logical drive
evanso 48:e308067cfea5 43 char _fsid[2];
evanso 48:e308067cfea5 44
evanso 48:e308067cfea5 45 /**
evanso 48:e308067cfea5 46 * Opens a file on the filesystem
evanso 48:e308067cfea5 47 */
evanso 48:e308067cfea5 48 virtual FileHandle *open(const char* name, int flags);
evanso 48:e308067cfea5 49 virtual int open(FileHandle **file, const char *name, int flags);
evanso 48:e308067cfea5 50
evanso 48:e308067cfea5 51 /**
evanso 48:e308067cfea5 52 * Removes a file path
evanso 48:e308067cfea5 53 */
evanso 48:e308067cfea5 54 virtual int remove(const char *filename);
evanso 48:e308067cfea5 55
evanso 48:e308067cfea5 56 /**
evanso 48:e308067cfea5 57 * Renames a file
evanso 48:e308067cfea5 58 */
evanso 48:e308067cfea5 59 virtual int rename(const char *oldname, const char *newname);
evanso 48:e308067cfea5 60
evanso 48:e308067cfea5 61 /**
evanso 48:e308067cfea5 62 * Formats a logical drive, FDISK artitioning rule, 512 bytes per cluster
evanso 48:e308067cfea5 63 */
evanso 48:e308067cfea5 64 virtual int format();
evanso 48:e308067cfea5 65
evanso 48:e308067cfea5 66 /**
evanso 48:e308067cfea5 67 * Opens a directory on the filesystem
evanso 48:e308067cfea5 68 */
evanso 48:e308067cfea5 69 virtual DirHandle *opendir(const char *name);
evanso 48:e308067cfea5 70 virtual int open(DirHandle **dir, const char *name);
evanso 48:e308067cfea5 71
evanso 48:e308067cfea5 72 /**
evanso 48:e308067cfea5 73 * Creates a directory path
evanso 48:e308067cfea5 74 */
evanso 48:e308067cfea5 75 virtual int mkdir(const char *name, mode_t mode);
evanso 48:e308067cfea5 76
evanso 48:e308067cfea5 77 /**
evanso 48:e308067cfea5 78 * Mounts the filesystem
evanso 48:e308067cfea5 79 */
evanso 48:e308067cfea5 80 virtual int mount();
evanso 48:e308067cfea5 81
evanso 48:e308067cfea5 82 /**
evanso 48:e308067cfea5 83 * Unmounts the filesystem
evanso 48:e308067cfea5 84 */
evanso 48:e308067cfea5 85 virtual int unmount();
evanso 48:e308067cfea5 86
evanso 48:e308067cfea5 87 virtual int disk_initialize() { return 0; }
evanso 48:e308067cfea5 88 virtual int disk_status() { return 0; }
evanso 48:e308067cfea5 89 virtual int disk_read(uint8_t *buffer, uint32_t sector, uint32_t count) = 0;
evanso 48:e308067cfea5 90 virtual int disk_write(const uint8_t *buffer, uint32_t sector, uint32_t count) = 0;
evanso 48:e308067cfea5 91 virtual int disk_sync() { return 0; }
evanso 48:e308067cfea5 92 virtual uint32_t disk_sectors() = 0;
evanso 48:e308067cfea5 93
evanso 48:e308067cfea5 94 };
evanso 48:e308067cfea5 95
evanso 48:e308067cfea5 96 #endif