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
Enemy.h
00001 #ifndef ENEMY_H 00002 #define ENEMY_H 00003 00004 #define EnemyCockpitColor 0x3300FF 00005 #define EnemyGlareColor1 0x330000 00006 #define EnemyGlareColor2 0xCC3300 00007 #define EnemyGunColor 0xCCCCCC 00008 #define EnemyEngineColor 0xFFFFFF 00009 #define HealthColor 0xFF0000 00010 00011 #include "mbed.h" 00012 #include "Circle.h" 00013 #include "Rectangle.h" 00014 #include "Point.h" 00015 00016 class Enemy { 00017 public: 00018 void fireToggle(); 00019 Enemy(int x, uLCD_4DGL *uLCD); 00020 void drawEnemy(); 00021 void addY(int dy); 00022 void damage(int dmg); 00023 int getY(); 00024 int getHealth(); 00025 Point hitBoxStart(); 00026 Point hitBoxDim(); 00027 Point getGunLoc(); 00028 00029 00030 private: 00031 int _x; 00032 int _y; 00033 int _health; 00034 00035 Circle _cockpit; 00036 Circle _glare1; 00037 Circle _glare2; 00038 Rectangle _gun; 00039 Rectangle _engine; 00040 Rectangle _healthBar; 00041 uLCD_4DGL *_uLCDptr; 00042 }; 00043 00044 #endif
Generated on Sun Jul 17 2022 07:39:55 by
1.7.2