Multiple fixes
Obracające się meteoryty, koniec gry przy natrafieniu na meteoryt. Poprawione sprajty statku, meteorytu i pocisku
This commit is contained in:
@@ -5,7 +5,7 @@ Player::Player(int x, int y, std::string path) : Actor(x, y, path) {};
|
||||
void Player::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, bulletTextureLeft);
|
||||
bullets.emplace_back(float(position.x) + actorSprite.getGlobalBounds().width / 2, position.y, bulletTextureLeft);
|
||||
lastShotTime = now;
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@ 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);
|
||||
bullets.emplace_back(float(position.x) + actorSprite.getGlobalBounds().width / 2, position.y, bulletTextureRight);
|
||||
lastShotTime = now;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user