John Aspinall / Mbed 2 deprecated SpaceGame

Dependencies:   4DGL-uLCD-SE PinDetect mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Player.h Source File

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