feat: minor adjustments

This commit is contained in:
Sara 2025-06-17 19:38:43 +02:00
parent e6385e114c
commit 341ec70618
5 changed files with 52 additions and 8 deletions

View file

@ -72,7 +72,7 @@ void PlayerBody::enter_tree() {
}
void PlayerBody::ready() {
this->camera->set_fov(this->min_fov);
this->camera->set("dist", this->min_dist);
this->last_checkpoint = Checkpoint::save_new(this);
}
@ -82,8 +82,8 @@ void PlayerBody::process(double delta) {
input->get_axis(self_type::move_right_action, self_type::move_left_action),
input->get_axis(self_type::move_back_action, self_type::move_forward_action)
}.normalized();
float fov_target{Math::lerp(this->min_fov, this->max_speed_fov, Math::sqrt(this->get_velocity().length() / this->target_speed))};
this->camera->set_fov(Math::move_toward(this->camera->get_fov(), fov_target, float(this->max_delta_fov * delta)));
float dist_target{Math::lerp(this->min_dist, this->max_speed_dist, Math::sqrt(this->get_velocity().length() / this->target_speed))};
this->camera->set("dist", Math::move_toward(this->camera->get("dist"), dist_target, float(this->max_delta_dist * delta)));
}
void PlayerBody::physics_process(double delta) {

View file

@ -78,9 +78,9 @@ private:
double bash_time{0.25};
double extra_bash_time{0.25};
Vector2 jump_impulse{5.f, 5.f};
float max_speed_fov{100.f};
float min_fov{80.f};
double max_delta_fov{100.f};
float max_speed_dist{2.4f};
float min_dist{2.1f};
double max_delta_dist{4.f};
float model_lean{0.25f};
float model_lean_speed{0.25f};
bool can_bash{false};

View file

@ -257,8 +257,6 @@ void VictoryState::process(double delta) {
if(this->get_body()->get_velocity().length() < 0.05) {
this->get_body()->set_velocity(Vector3{});
}
float fov{this->camera->get_fov()};
this->camera->set_fov(Math::move_toward(fov, 30.f, 20.f * (float)delta));
}
void VictoryState::physics_process(double delta) {