Niby strzela, ale bez kolizji
This commit is contained in:
18
sources/EnemyBullet.cpp
Normal file
18
sources/EnemyBullet.cpp
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user