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.
Battleship.h
00001 #ifndef BATTLESHIP_H 00002 #define BATTLESHIP_H 00003 00004 #include "mbed.h" 00005 #include "N5110.h" 00006 #include "Gamepad.h" 00007 00008 /** Battleship Class 00009 * @brief Battleship 00010 * @author Haoyan Zhang 00011 * @date April, 2020 00012 */ 00013 00014 class Battleship 00015 { 00016 public: 00017 00018 Battleship(); // Constructor 00019 00020 ~Battleship(); // Destructor 00021 00022 void init(int x,int height,int width); // Initialization 00023 00024 void draw(N5110 &lcd); // Draw the pattern on lcd 00025 00026 void update(Direction d,float mag); // Update the values 00027 00028 void add_score(); // Add the score 00029 00030 int get_score(); // Get the score 00031 00032 Vector2D get_pos(); // Get the position 00033 00034 void minus_life(); // Minus the life 00035 00036 int get_life(); // Get the life 00037 00038 private: 00039 00040 int _x; 00041 00042 int _y; 00043 00044 int _height; 00045 00046 int _width; 00047 00048 int _speed; 00049 00050 int _score; 00051 00052 int _life; 00053 }; 00054 #endif 00055 00056 00057 00058 00059
Generated on Sat Aug 20 2022 05:26:48 by
1.7.2