blob: 46b681728f1105ed000f11a7ddcfcd695ac83a0c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#ifndef ship_h
#define ship_h
#define SHIP_SIZE 10
#define ROTATE_AMOUNT 6
#define THRUST_AMOUNT 0.5
#include "flyingObject.h"
#include "uiDraw.h"
#include "uiInteract.h"
using namespace std;
class Ship : public FlyingObject
{
private:
float angle;
bool isThrusting;
int fuel;
public:
Ship( const Point &point ) : FlyingObject() , fuel ( 1000 ) , angle ( 90.0 ) , isThrusting( false ) { setPoint ( point ); }
float getAngle() const { return this->angle; }
float getFuel() { return this->fuel; }
void setFuel ( const int fuel ) { this->fuel - fuel; }
void thrust( const bool isUp );
void rotate( const bool isRight );
bool getIsThrusting() { return isThrusting; }
void setThrusting( const bool isThrusting ) { this->isThrusting = isThrusting; }
void draw() const;
};
#endif /* ship_h */
|