-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMagicSlow.cpp
More file actions
19 lines (14 loc) · 782 Bytes
/
Copy pathMagicSlow.cpp
File metadata and controls
19 lines (14 loc) · 782 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "MagicSlow.h"
MagicSlow::MagicSlow(float pozitieX_dat, float pozitieY_dat, const float desiredWidth2, const float desiredHeight2, const std::string& sfTexture) :
MagicObject(pozitieX_dat, pozitieY_dat, desiredWidth2, desiredHeight2, sfTexture) {}
const int MagicSlow::speedMultiplier = 2;
void MagicSlow::fallCustom(float speed, [[maybe_unused]] float windowWidth, [[maybe_unused]] float windowHeight) {
int nr_random = rand() % static_cast<int>(speed);
pozitieY += static_cast<float>((nr_random == 0 ? 1 * speedMultiplier : nr_random * speedMultiplier)/2.0f);
}
void MagicSlow::afisareCustom(std::ostream& os) const {
os << "MagicSlow la pozitia (" << pozitieX << ", " << pozitieY << ")";
}
sf::Color MagicSlow::GetColor() const {
return color;
}