tornem al pc d'anit

This commit is contained in:
2025-07-12 09:55:56 +02:00
parent 6082a72392
commit 719c448779
5 changed files with 25 additions and 17 deletions

View File

@@ -14,8 +14,8 @@ Bullet::Bullet(float x, float y, BulletType bullet_type, bool powered, int owner
bullet_type_(bullet_type),
owner_(owner)
{
vel_x_ = (bullet_type_ == BulletType::LEFT) ? BULLET_VEL_X_LEFT_
: (bullet_type_ == BulletType::RIGHT) ? BULLET_VEL_X_RIGHT_
vel_x_ = (bullet_type_ == BulletType::LEFT) ? VEL_X_LEFT_
: (bullet_type_ == BulletType::RIGHT) ? VEL_X_RIGHT_
: 0;
std::string powered_type = powered ? "powered_" : "normal_";
@@ -37,7 +37,7 @@ Bullet::Bullet(float x, float y, BulletType bullet_type, bool powered, int owner
break;
}
collider_.r = BULLET_WIDTH_ / 2;
collider_.r = WIDTH / 2;
shiftColliders();
}
@@ -59,14 +59,14 @@ BulletMoveStatus Bullet::update()
BulletMoveStatus Bullet::move()
{
pos_x_ += vel_x_;
if (pos_x_ < param.game.play_area.rect.x - BULLET_WIDTH_ || pos_x_ > param.game.play_area.rect.w)
if (pos_x_ < param.game.play_area.rect.x - WIDTH || pos_x_ > param.game.play_area.rect.w)
{
disable();
return BulletMoveStatus::OUT;
}
pos_y_ += BULLET_VEL_Y_;
if (pos_y_ < param.game.play_area.rect.y - BULLET_HEIGHT_)
pos_y_ += VEL_Y_;
if (pos_y_ < param.game.play_area.rect.y - HEIGHT)
{
disable();
return BulletMoveStatus::OUT;