-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSpaceship.h
More file actions
50 lines (49 loc) · 1.21 KB
/
Spaceship.h
File metadata and controls
50 lines (49 loc) · 1.21 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
#include <SFML/Audio.hpp>
#include <SFML/Graphics.hpp>
#pragma once
class Spaceship
{
private:
sf::Texture texture;
sf::Sprite sprite;
sf::Vector3i guns;
bool _doubleGun = false;
int _speed, _health, _skin, _color;
float _maxHealth;
std::string getColor(int color) const;
void initSpaceship(int type);
public:
enum {
SPACESHIP_SKIN_0, SPACESHIP_SKIN_1, SPACESHIP_SKIN_2,
SPACESHIP_SKIN_3, SPACESHIP_SKIN_4, SPACESHIP_SKIN_5,
SPACESHIP_SKIN_6, SPACESHIP_SKIN_7, SPACESHIP_SKIN_8
};
enum {
SPACESHIP_COLOR_RED, SPACESHIP_COLOR_YELLOW,
SPACESHIP_COLOR_GREEN, SPACESHIP_COLOR_BLUE,
SPACESHIP_COLOR_PURPLE, SPACESHIP_COLOR_PINK,
SPACESHIP_COLOR_GREY, SPACESHIP_COLOR_ORANGE,
};
Spaceship();
Spaceship(int skinType);
Spaceship(int skinType, int colorType);
~Spaceship();
void setPosition(int x, int y);
void move(int x, int y);
void takeDamages();
//Setter
void setSkin(int skinType, int colorType);
void addHealth();
//Getters
int getWidth() const;
int getHeight() const;
int getSkin() const;
int getColor() const;
int getX() const;
int getY() const;
int getHealth() const;
float getMaxHealth() const;
bool hasDoubleGun() const;
sf::Vector3i getGuns() const;
sf::Sprite getSprite() const;
};