-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShip.h
More file actions
executable file
·51 lines (45 loc) · 1.65 KB
/
Copy pathShip.h
File metadata and controls
executable file
·51 lines (45 loc) · 1.65 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
* Ship.h
*
* Created on: May 5, 2018
* Author: parkerqueen
*/
#ifndef SHIP_H_
#define SHIP_H_
#include "Entity.h"
#include "Gun.h"
#define SHIP 30
#define MAXSPEED 20
#define SPINR -5
#define SPINL 5
#define SPNULL 0
class Ship : public Entity {
private:
Gun gun;
int rotAngle, safetyTimer;
bool fuel, safe, mingled;
public:
Ship(); // Constructor
void constructGeometry(); // Constructs the geometry of ship
Point* getVertices() const; // Returns the vertices of ship
void triggerGun(Point = Point()); // Triggers the ship's gun
void accelarate(bool); // Sets if a fuel is being accelarated or not
void spin(float); // Sets if a ship is to be rotated
void setSafety(bool); // Sets if the ship is invincible or not
bool isSafe()
const; // Returns if the ship is invincible at the moment or not
void recenter(); // Recenters the ship
void setRandom(); // Randomly positions the ship
void mingle(); // Animates the ship destruction
void hyperdrive(); // Calls the hyperdrive functionality
bool isMingled() const; // Returns if the ship is destroyed
void timer(); // Logs the time to turn safety off
void move(); // Moves the ship
void draw(); // Draws the ship
void loadGun(); // Loads the ship's gun
float shipspeed() const; // Returns the ship's speed
void rotate(float); // Actually rotates the ship
int type() const; // Returns the type
Gun& getGun(); // Returns the ship's gun
};
#endif /* SHIP_H_ */