Dodane regulacja prędkości i płynejsze poruszanie się
This commit is contained in:
@@ -18,19 +18,11 @@ sf::Sprite &Actor::getSprite() {
|
||||
return actorSprite;
|
||||
}
|
||||
|
||||
void Actor::move(float deltaX, float deltaY) {
|
||||
actorSprite.move(deltaX, deltaY);
|
||||
}
|
||||
void Actor::move(float deltaX, float deltaY) {}
|
||||
|
||||
void Actor::moveLeft() {
|
||||
move(-10.0f, 0.0f);
|
||||
position.x -= 10;
|
||||
}
|
||||
void Actor::moveLeft() {}
|
||||
|
||||
void Actor::moveRight() {
|
||||
move(10.0f, 0.0f);
|
||||
position.x += 10;
|
||||
}
|
||||
void Actor::moveRight() {}
|
||||
|
||||
Position Actor::getPosition() {
|
||||
return {position.x, position.y};
|
||||
@@ -43,3 +35,11 @@ void Actor::shoot() {
|
||||
std::vector<Bullet> &Actor::getBullets() {
|
||||
return bullets;
|
||||
}
|
||||
|
||||
void Actor::updateBullets() {
|
||||
for (auto& bullet : bullets) {
|
||||
if(bullet.getStatus()) {
|
||||
bullets.erase(bullets.begin());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user