Pokitto Community Team / Pokitto_Game_Lost

Dependencies:   PokittoLib

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers aircraft.h Source File

aircraft.h

Go to the documentation of this file.
00001 /**************************************************************************/
00002 /*!
00003     @file     aircraft.h
00004     @author   WTW
00005 
00006     @section  v0.3
00007 
00008 collision
00009 */
00010 /**************************************************************************/
00011 
00012 #ifndef AIRCRAFT_H
00013 #define AIRCRAFT_H
00014 #include "Pokitto.h"
00015 #define AIRCRAFT_INIT_XAXIX 47
00016 #define AIRCRAFT_INIT_YAXIX 35
00017 #define AIRCRAFT_COLLISION_XAXIS_OFFSET 7
00018 #define AIRCRAFT_COLLISION_YAXIS_OFFSET 7
00019 #define AIRCRAFT_COLLISION_WIDTH 2
00020 #define AIRCRAFT_COLLISION_HEIGHT 2
00021 //Sprite sheet:3x3
00022 extern const uint8_t aircraft_bmp [][114];
00023 
00024 class aircraft {
00025 public:
00026 
00027     aircraft():xaxis(AIRCRAFT_INIT_XAXIX),yaxis(AIRCRAFT_INIT_YAXIX),upsign(false), leftsign(false), rightsign(false), downsign(false){
00028 
00029         }
00030     void move();
00031     void display();
00032     void clear(){xaxis = AIRCRAFT_INIT_XAXIX;yaxis = AIRCRAFT_INIT_YAXIX;upsign = false;leftsign = false;rightsign = false;downsign = false;}
00033     int16_t getx() const{ return xaxis; }
00034     int16_t gety() const{ return yaxis; }
00035     int16_t getLeft() const{
00036         return xaxis + AIRCRAFT_COLLISION_XAXIS_OFFSET;
00037     }
00038 
00039     int16_t getRight() const{
00040         return xaxis + AIRCRAFT_COLLISION_XAXIS_OFFSET + AIRCRAFT_COLLISION_WIDTH;
00041     }
00042 
00043     int16_t getTop() const{
00044         return yaxis + AIRCRAFT_COLLISION_YAXIS_OFFSET;
00045     }
00046 
00047     int16_t getBottom() const{
00048         return yaxis + AIRCRAFT_COLLISION_YAXIS_OFFSET + AIRCRAFT_COLLISION_HEIGHT;
00049     }
00050 
00051 private:
00052     int16_t xaxis;
00053     int16_t yaxis;
00054     bool upsign, leftsign, rightsign, downsign;
00055 };
00056 
00057 
00058 
00059 #endif
00060 
00061