Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Canon.h
00001 #ifndef CANON_H 00002 #define CANON_H 00003 00004 #include "mbed.h" 00005 #include "N5110.h" 00006 #include "Gamepad.h" 00007 00008 /** Canon.h 00009 * @brief Defines variables and methods for the Canon. 00010 * @author Helios A. Lyons 00011 * @date April, 2020 00012 */ 00013 00014 class Canon 00015 { 00016 public: 00017 00018 Canon(); 00019 ~Canon(); // destructor 00020 00021 void init(int x,int height,int width); 00022 void draw(N5110 &lcd); 00023 void update(Direction d,float mag); 00024 // int add_total_kills(); –– replaced by adding individual type kills 00025 00026 /** Increment Invader 1 Kills 00027 * @param increase kills by 1 for Invader 1 00028 */ 00029 int add_inv1_kill(int n); // invader type 1 (first row) 00030 00031 /** Increment Invader 2 Kills 00032 * @param increase kills by 1 for Invader 2 00033 */ 00034 int add_inv2_kill(int n); 00035 00036 /** Increment Invader 3 Kills 00037 * @param increase kills by 1 for Invader 3 00038 */ 00039 int add_inv3_kill(int n); 00040 00041 /** Increment Boss Kills 00042 * @param increase kills by 1 for Boss mobs 00043 */ 00044 int add_boss_kill(); // seperate for different boss levels? narrative structure? 00045 00046 /** Get total kills 00047 * @return total kills by adding invader subtype kills 00048 */ 00049 int get_total_kill(); 00050 00051 /** Get the score 00052 * @return current score based on current kills 00053 */ 00054 int get_score(); 00055 00056 /** Get the position 00057 * @return current Canon position based on direction 00058 */ 00059 Vector2D get_pos(); 00060 00061 /** Get remaining lives 00062 * @return current lives remaining 00063 */ 00064 int get_life(); 00065 00066 /** Remove a life 00067 * @param decrease number of lives by 1 00068 */ 00069 int remove_life(); 00070 00071 /** Reset lives 00072 * @param reset lives to 3 00073 */ 00074 int reset_life(); 00075 00076 private: 00077 00078 int _height; 00079 int _width; 00080 int _x; 00081 int _y; 00082 int _speed; 00083 int _score; 00084 int _inv1_kill; 00085 int _inv2_kill; 00086 int _inv3_kill; 00087 int _boss_kill; 00088 int _total_kill; 00089 int _life; 00090 00091 }; 00092 #endif
Generated on Thu Jul 14 2022 22:11:37 by
 1.7.2
 1.7.2