diff options
author | IcECreAm777 <31211782+IcECreAm777@users.noreply.github.com> | 2022-07-17 12:20:31 +0200 |
---|---|---|
committer | IcECreAm777 <31211782+IcECreAm777@users.noreply.github.com> | 2022-07-17 12:20:31 +0200 |
commit | 9cb0b053b337742aae96517a8c5c4700698faa03 (patch) | |
tree | 3d64563a49f498b79dfced19b2371dd97797250f /godot/scenes/Die.gd | |
parent | 1cb66d602745d176b113e76a7f77bd007768b509 (diff) | |
download | 2022-9cb0b053b337742aae96517a8c5c4700698faa03.tar.gz 2022-9cb0b053b337742aae96517a8c5c4700698faa03.tar.bz2 2022-9cb0b053b337742aae96517a8c5c4700698faa03.zip |
fixed: bounce works again and +1 can't be activated twice in a row
gravity is deactivated for now
Diffstat (limited to 'godot/scenes/Die.gd')
-rw-r--r-- | godot/scenes/Die.gd | 11 |
1 files changed, 7 insertions, 4 deletions
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() |