aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar David <david003@gmx.net>2022-07-16 16:01:31 +0200
committerLibravatar David <david003@gmx.net>2022-07-16 16:01:31 +0200
commitbdf6f0328e870c308299f37155b9e89d91a2859c (patch)
tree620e5ef2a2843bf140346f0171e955cbde8b9622
parentea7596edf57149b3c3f84378276c9d0558aed050 (diff)
download2022-bdf6f0328e870c308299f37155b9e89d91a2859c.tar.gz
2022-bdf6f0328e870c308299f37155b9e89d91a2859c.tar.bz2
2022-bdf6f0328e870c308299f37155b9e89d91a2859c.zip
fix up angle and force
Diffstat (limited to '')
-rw-r--r--godot/scenes/objects/Player.tscn2
-rwxr-xr-xlib/x86_64-unknown-linux-gnu/libcode_with_your_friends2022.sobin29349872 -> 29349984 bytes
-rw-r--r--rust/src/basic_die.rs3
3 files changed, 3 insertions, 2 deletions
diff --git a/godot/scenes/objects/Player.tscn b/godot/scenes/objects/Player.tscn
index 9730147..aeb8f51 100644
--- a/godot/scenes/objects/Player.tscn
+++ b/godot/scenes/objects/Player.tscn
@@ -8,7 +8,7 @@
script = ExtResource( 3 )
camera/camera_clamp = Vector2( 0, -1.3 )
shooting/max_force = 30.0
-shooting/up_angle = 1.0
+shooting/up_angle = 0.3
shooting/stopping_velocity = 0.003
input/camera_mouse_sensitivity = Vector2( 0.003, 0.002 )
input/shoot_sensitivity = 0.1
diff --git a/lib/x86_64-unknown-linux-gnu/libcode_with_your_friends2022.so b/lib/x86_64-unknown-linux-gnu/libcode_with_your_friends2022.so
index 97b6350..03ade02 100755
--- a/lib/x86_64-unknown-linux-gnu/libcode_with_your_friends2022.so
+++ b/lib/x86_64-unknown-linux-gnu/libcode_with_your_friends2022.so
Binary files differ
diff --git a/rust/src/basic_die.rs b/rust/src/basic_die.rs
index ab53720..2a61197 100644
--- a/rust/src/basic_die.rs
+++ b/rust/src/basic_die.rs
@@ -219,6 +219,7 @@ impl BasicDie {
if save_event.is_action_released(GodotString::from_str(&self.action_shooting), false) {
self.input_state = InputState::Moving;
self.shoot();
+ self.current_force = 0.0;
return;
}
@@ -294,7 +295,7 @@ impl BasicDie {
None => { godot_warn!("No camera assigned!"); return; },
Some(cam) => {
// get the forward vector of the camera setting the up angle to the defined value in the editor
- let mut forward_vector = -cam.assume_safe().global_transform().basis.c();
+ let mut forward_vector = -cam.assume_safe().global_transform().basis.c().normalized();
forward_vector.y = self.up_angle;
// calculate the impulse force