-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSpaceShip.h
59 lines (46 loc) · 1.04 KB
/
SpaceShip.h
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
52
53
54
55
56
57
58
59
#pragma once
#include <SFML/Graphics.hpp>
#include <vector>
struct Bullet {
float x, y;
float direction;
int radius;
};
class SpaceShip
{
public:
SpaceShip(int size);
sf::Color color;
bool overlap = false;
private:
const float PI = 3.14159f;
const float acceleration = 1.001f;
float centerX;
float centerY;
float rotation;
float screen_size;
float speed;
sf::Vector2f points[3];
std::vector<Bullet> bullet_buffer;
public :
sf::Vector2f* getVertices();
float getCenterX();
void setCenterX(float value);
float getCenterY();
void setCenterY(float value);
float getRotation();
void setRotation(float value);
float getScreenSize();
void setScreenSize(float value);
float getSpeed();
void setSpeed(float value);
void drawSpaceShip(sf::RenderWindow& window);
void checkCrossBorder();
void leftRotation();
void rightRotation();
void moveShip();
void addBullet();
void drawBullets(sf::RenderWindow& window);
std::vector<Bullet> getBullets();
void checkBadges();
};