Strzelanie Lewym i Prawym przyciskiem myszy.
Dodanie tekstury strzału alternatywnego
This commit is contained in:
@@ -10,6 +10,14 @@ void Player::shoot() {
|
||||
}
|
||||
}
|
||||
|
||||
void Player::alternate_shoot() {
|
||||
auto now = std::chrono::steady_clock::now();
|
||||
if (std::chrono::duration_cast<std::chrono::milliseconds>(now - lastShotTime).count() >= firerate) {
|
||||
bullets.emplace_back(float(position.x) + actorSprite.getGlobalBounds().width / 2-62, position.y, bulletTextureRight);
|
||||
lastShotTime = now;
|
||||
}
|
||||
}
|
||||
|
||||
void Player::setFirerate(unsigned int firerate) {
|
||||
this->firerate = firerate;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user