This repository has been archived on 2025-06-06. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
LotoStatek/sources/EnemyBullet.cpp
2024-12-09 17:36:57 +01:00

18 lines
451 B
C++

#include "../headers/EnemyBullet.h"
EnemyBullet::EnemyBullet(float x, float y, sf::Texture &texture)
: Projectile(x, y, texture) {
speed = 5.0f; // Ruch w dół (dodatnia prędkość)
}
void EnemyBullet::update() {
sprite.move(0.0f, speed); // Przesuwanie pocisku w dół
position.y += speed;
if (position.y > 800) {
outOfBounds = true;
}
}
void EnemyBullet::setOutOfBounds(bool status) {
outOfBounds = status;
}