From 9cb0b053b337742aae96517a8c5c4700698faa03 Mon Sep 17 00:00:00 2001 From: IcECreAm777 <31211782+IcECreAm777@users.noreply.github.com> Date: Sun, 17 Jul 2022 12:20:31 +0200 Subject: fixed: bounce works again and +1 can't be activated twice in a row gravity is deactivated for now --- godot/scenes/Die.gd | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'godot/scenes/Die.gd') diff --git a/godot/scenes/Die.gd b/godot/scenes/Die.gd index 1f82417..0d11d73 100644 --- a/godot/scenes/Die.gd +++ b/godot/scenes/Die.gd @@ -109,7 +109,10 @@ func _physics_process(delta): if curr_buff != buff.ball: dice_is_moving = false revert_current_buff() + var last_buff = curr_buff curr_buff = get_buff_from_upwards_side() + if last_buff == curr_buff && curr_buff == buff.stroke: + return apply_buff() elif dice_is_moving == false and angular_velocity.length() >= 0.1 and linear_velocity.length() >= 0.1: @@ -137,7 +140,7 @@ func get_buff_from_upwards_side(): if $Ball1.get_overlapping_areas().size() > 0 || $Ball2.get_overlapping_areas().size() > 0: return buff.ball if $Bounce1.get_overlapping_areas().size() > 0 || $Bounce2.get_overlapping_areas().size() > 0: - return buff.gravity + return buff.bounce if $Phase1.get_overlapping_areas().size() > 0 || $Phase2.get_overlapping_areas().size() > 0: return buff.phase @@ -193,15 +196,15 @@ func revert_current_buff(): gravity_scale = default_gravity func apply_buff(): + gravity_scale = default_gravity match curr_buff: buff.ball: - gravity_scale = default_gravity ball() buff.bounce: - gravity_scale = default_gravity bounciness() buff.phase: phase() - gravity_scale = default_gravity buff.stroke: + extra_stroke() + buff.gravity: low_gravity() -- cgit