Niby strzela, ale bez kolizji

This commit is contained in:
2024-12-09 17:36:57 +01:00
parent 44f4556fda
commit 13066709a7
10 changed files with 128 additions and 6 deletions

18
sources/EnemyBullet.cpp Normal file
View File

@@ -0,0 +1,18 @@
#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;
}