Haoyan Zhang
/
el17h2z1
deemo1
Diff: Battleship/Battleship.h
- Revision:
- 1:8c48fb8ca5e0
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Battleship/Battleship.h Mon May 11 06:50:18 2020 +0000 @@ -0,0 +1,59 @@ +#ifndef BATTLESHIP_H +#define BATTLESHIP_H + +#include "mbed.h" +#include "N5110.h" +#include "Gamepad.h" + +/** Battleship Class +* @brief Battleship +* @author Haoyan Zhang +* @date April, 2020 +*/ + +class Battleship +{ +public: + + Battleship(); // Constructor + + ~Battleship(); // Destructor + + void init(int x,int height,int width); // Initialization + + void draw(N5110 &lcd); // Draw the pattern on lcd + + void update(Direction d,float mag); // Update the values + + void add_score(); // Add the score + + int get_score(); // Get the score + + Vector2D get_pos(); // Get the position + + void minus_life(); // Minus the life + + int get_life(); // Get the life + +private: + + int _x; + + int _y; + + int _height; + + int _width; + + int _speed; + + int _score; + + int _life; +}; +#endif + + + + + \ No newline at end of file