feat(entities): migrar la configuració del player a data/entities/player/player.yaml

This commit is contained in:
2026-05-25 08:32:49 +02:00
parent 9f278772bb
commit 6447932212
18 changed files with 396 additions and 121 deletions
+2 -2
View File
@@ -53,7 +53,7 @@ void Bullet::init() {
body_.clearAccumulators();
}
void Bullet::fire(const Vec2& position, float angle, uint8_t owner_id) {
void Bullet::fire(const Vec2& position, float angle, uint8_t owner_id, float bullet_speed) {
// Activar bullet
is_active_ = true;
@@ -71,7 +71,7 @@ void Bullet::fire(const Vec2& position, float angle, uint8_t owner_id) {
body_.angle = angle;
const float DIR_X = std::cos(angle - (Constants::PI / 2.0F));
const float DIR_Y = std::sin(angle - (Constants::PI / 2.0F));
body_.velocity = Vec2{.x = DIR_X * Defaults::Game::BULLET_SPEED, .y = DIR_Y * Defaults::Game::BULLET_SPEED};
body_.velocity = Vec2{.x = DIR_X * bullet_speed, .y = DIR_Y * bullet_speed};
body_.angular_velocity = 0.0F;
body_.clearAccumulators();