refactor ciąg dalszy
This commit is contained in:
@@ -28,7 +28,6 @@ public:
|
|||||||
void update_hearts();
|
void update_hearts();
|
||||||
void update();
|
void update();
|
||||||
void update_score();
|
void update_score();
|
||||||
void setOutOfBounds(bool status);
|
|
||||||
void spawn_player();
|
void spawn_player();
|
||||||
void spawn_enemy();
|
void spawn_enemy();
|
||||||
void spawn_advanced_enemy();
|
void spawn_advanced_enemy();
|
||||||
|
|||||||
@@ -46,9 +46,9 @@ Plansza::Plansza(unsigned int windowHeight, unsigned int windowWidth, sf::Render
|
|||||||
heartTexture.loadFromFile("../assets/img/hearts/heart.png");
|
heartTexture.loadFromFile("../assets/img/hearts/heart.png");
|
||||||
heartTextureGray.loadFromFile("../assets/img/hearts/heart_gray.png");
|
heartTextureGray.loadFromFile("../assets/img/hearts/heart_gray.png");
|
||||||
|
|
||||||
heartStats.emplace_back(sf::Sprite(heartTexture));
|
heartStats.emplace_back(heartTexture);
|
||||||
heartStats.emplace_back(sf::Sprite(heartTexture));
|
heartStats.emplace_back(heartTexture);
|
||||||
heartStats.emplace_back(sf::Sprite(heartTexture));
|
heartStats.emplace_back(heartTexture);
|
||||||
heartStats[0].setPosition(565, 10);
|
heartStats[0].setPosition(565, 10);
|
||||||
heartStats[1].setPosition(530, 10);
|
heartStats[1].setPosition(530, 10);
|
||||||
heartStats[2].setPosition(495, 10);
|
heartStats[2].setPosition(495, 10);
|
||||||
@@ -109,9 +109,6 @@ void Plansza::update() {
|
|||||||
spawn_bomber();
|
spawn_bomber();
|
||||||
spawn_kamikadze();
|
spawn_kamikadze();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// utrzymanie meteorów i pocisków w ruchu
|
// utrzymanie meteorów i pocisków w ruchu
|
||||||
for (auto &meteor: meteors) {
|
for (auto &meteor: meteors) {
|
||||||
meteor.update();
|
meteor.update();
|
||||||
@@ -121,7 +118,9 @@ void Plansza::update() {
|
|||||||
for (auto &heart: hearts) {
|
for (auto &heart: hearts) {
|
||||||
heart.update();
|
heart.update();
|
||||||
window->draw(heart.getSprite());
|
window->draw(heart.getSprite());
|
||||||
}for (auto &bullet: ship->getBullets()) {
|
}
|
||||||
|
|
||||||
|
for (auto &bullet: ship->getBullets()) {
|
||||||
bullet.update();
|
bullet.update();
|
||||||
window->draw(bullet.getSprite());
|
window->draw(bullet.getSprite());
|
||||||
}
|
}
|
||||||
@@ -136,7 +135,6 @@ void Plansza::update() {
|
|||||||
update_hearts();
|
update_hearts();
|
||||||
ship->updateBullets();
|
ship->updateBullets();
|
||||||
|
|
||||||
ship->update();
|
|
||||||
window->draw(ship->getSprite());
|
window->draw(ship->getSprite());
|
||||||
|
|
||||||
for (auto &meteor: meteors) {
|
for (auto &meteor: meteors) {
|
||||||
|
|||||||
Reference in New Issue
Block a user