-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEntities.hpp
More file actions
46 lines (36 loc) · 972 Bytes
/
Entities.hpp
File metadata and controls
46 lines (36 loc) · 972 Bytes
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
#include<SFML/Graphics.hpp>
class Player : public sf::Drawable {
virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const;
int score;
float multiplier;
public:
Player();
void shootLaser();
void getHurt(int);
void scoreIncrease(sf::Vector2f);
sf::Texture playership;
sf::Texture healthbartext;
sf::Texture healthtile;
sf::Texture lasertext;
sf::Sprite healthbar;
std::vector<sf::Sprite> healthblocks;
std::vector<sf::Sprite> sprites;
std::vector<sf::Sprite> lasers;
sf::Vector2f pos;
int hp;
float acceleration;
float xSpeed;
float ySpeed;
};
class Enemy : public sf::Drawable {
virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const;
public:
Enemy();
sf::Texture enemyshiptileset;
sf::Sprite sprite;
int hp;
sf::Vector2f pos;
sf::Vector2f worth;
float xSpeed;
float ySpeed;
};