-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpowderup.h
45 lines (32 loc) · 810 Bytes
/
powderup.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
#ifndef POWDERUP_H
#define POWDERUP_H
#include <SFML/Graphics.hpp>
#include "Player.h"
#include <string>
#include "powderup.h"
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <random>
class PowderUp {
public:
enum class Type {
ATK1,
HP1
};
PowderUp(const string& textureFile, float posX, float posY, Type type);
static PowderUp createATK1();
static PowderUp createHP1();
void setPosition(float x, float y);
const Sprite& getPowderSprite() const;
void draw(RenderTarget& target) const;
void applyEffect(Player* player);
private:
Texture powderTexture;
Sprite powderSprite;
Type type;
static Vector2f generateRandomPosition();
bool loadTexture(const string& textureFile);
};
void initializeRandomSeed();
#endif