From 341ec706180a456814228e646dacf57f78fe5dd5 Mon Sep 17 00:00:00 2001 From: Sara Date: Tue, 17 Jun 2025 19:38:43 +0200 Subject: [PATCH] feat: minor adjustments --- .gitignore | 2 ++ modules/going/player_body.cpp | 6 ++--- modules/going/player_body.h | 6 ++--- modules/going/player_states.cpp | 2 -- project/export_presets.cfg | 44 +++++++++++++++++++++++++++++++++ 5 files changed, 52 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index bd8767ca..e28af348 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,5 @@ going-linux-x86_64 going-linux-x86_64.zip going-windows-x86_64 going-windows-x86_64.zip +going-web +going-web.zip diff --git a/modules/going/player_body.cpp b/modules/going/player_body.cpp index ccd06e82..e956a9a3 100644 --- a/modules/going/player_body.cpp +++ b/modules/going/player_body.cpp @@ -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) { diff --git a/modules/going/player_body.h b/modules/going/player_body.h index 5fc4f544..d90ef35b 100644 --- a/modules/going/player_body.h +++ b/modules/going/player_body.h @@ -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}; diff --git a/modules/going/player_states.cpp b/modules/going/player_states.cpp index 6ea708a9..386c27e9 100644 --- a/modules/going/player_states.cpp +++ b/modules/going/player_states.cpp @@ -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) { diff --git a/project/export_presets.cfg b/project/export_presets.cfg index fa9deeb8..f5791bab 100644 --- a/project/export_presets.cfg +++ b/project/export_presets.cfg @@ -106,3 +106,47 @@ Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorActi ssh_remote_deploy/cleanup_script="Stop-ScheduledTask -TaskName godot_remote_debug -ErrorAction:SilentlyContinue Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue Remove-Item -Recurse -Force '{temp_dir}'" + +[preset.2] + +name="Web" +platform="Web" +runnable=true +advanced_options=true +dedicated_server=false +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="../going-web/index.html" +patches=PackedStringArray() +encryption_include_filters="" +encryption_exclude_filters="" +seed=0 +encrypt_pck=false +encrypt_directory=false +script_export_mode=2 + +[preset.2.options] + +custom_template/debug="/home/sara/Documents/gd-projects/going/engine/bin/godot.web.template_release.wasm32.zip" +custom_template/release="/home/sara/Documents/gd-projects/going/engine/bin/godot.web.template_release.wasm32.zip" +variant/extensions_support=false +variant/thread_support=false +vram_texture_compression/for_desktop=true +vram_texture_compression/for_mobile=false +html/export_icon=true +html/custom_html_shell="" +html/head_include="" +html/canvas_resize_policy=2 +html/focus_canvas_on_start=true +html/experimental_virtual_keyboard=false +progressive_web_app/enabled=false +progressive_web_app/ensure_cross_origin_isolation_headers=true +progressive_web_app/offline_page="" +progressive_web_app/display=1 +progressive_web_app/orientation=1 +progressive_web_app/icon_144x144="" +progressive_web_app/icon_180x180="" +progressive_web_app/icon_512x512="" +progressive_web_app/background_color=Color(0, 0, 0, 1)