aboutsummaryrefslogtreecommitdiffstats
path: root/godot/scenes/Die.gd
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--godot/scenes/Die.gd11
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()