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.
Dependencies: 4DGL-uLCD-SE PinDetect mbed
Player.h
00001 #ifndef PLAYER_H 00002 #define PLAYER_H 00003 00004 #define CockpitColor 0x660000 00005 #define GlareColor 0x666666 00006 #define BodyColor 0x999999 00007 #define WingColor 0x333333 00008 #define GunColor 0xB50000 00009 #define Engine1Color 0xFF3300 00010 #define Engine2Color 0xFFFF00 00011 #define HealthColor 0xFF0000 00012 00013 #include "mbed.h" 00014 #include "Circle.h" 00015 #include "Rectangle.h" 00016 #include "Point.h" 00017 00018 class Player { 00019 public: 00020 Player(int x, int y, uLCD_4DGL *uLCD); 00021 void drawPlayer(); 00022 void addX(int dx); 00023 void addY(int dy); 00024 Point hitBoxStart(); 00025 Point hitBoxDim(); 00026 Point getLeftGunLoc(); 00027 Point getRightGunLoc(); 00028 void damage(int dmg); 00029 int getHealth(); 00030 00031 private: 00032 int _x; 00033 int _y; 00034 int _health; 00035 Circle _cockpit; 00036 Circle _glare; 00037 Rectangle _body; 00038 Rectangle _leftWing; 00039 Rectangle _rightWing; 00040 Rectangle _leftGun; 00041 Rectangle _rightGun; 00042 Rectangle _engine1; 00043 Rectangle _engine2; 00044 Rectangle _healthBar; 00045 uLCD_4DGL *_uLCDptr; 00046 }; 00047 00048 #endif
Generated on Sun Jul 17 2022 07:39:56 by
1.7.2