aboutsummaryrefslogtreecommitdiffstats
path: root/godot/scenes/Die.gd
diff options
context:
space:
mode:
authorLibravatar IcECreAm777 <31211782+IcECreAm777@users.noreply.github.com>2022-07-17 05:50:52 +0200
committerLibravatar IcECreAm777 <31211782+IcECreAm777@users.noreply.github.com>2022-07-17 05:50:52 +0200
commit2463d0532a63ae4d7f67dbd56d9d886b214b2ac5 (patch)
tree45132337370dbf4c40bf950b91c39e49d58d75f8 /godot/scenes/Die.gd
parentb8d6ba924c60c13bca838655b1fa876758c47ed7 (diff)
download2022-2463d0532a63ae4d7f67dbd56d9d886b214b2ac5.tar.gz
2022-2463d0532a63ae4d7f67dbd56d9d886b214b2ac5.tar.bz2
2022-2463d0532a63ae4d7f67dbd56d9d886b214b2ac5.zip
finished base die
Diffstat (limited to 'godot/scenes/Die.gd')
-rw-r--r--godot/scenes/Die.gd29
1 files changed, 28 insertions, 1 deletions
diff --git a/godot/scenes/Die.gd b/godot/scenes/Die.gd
index 6f061b5..76c1474 100644
--- a/godot/scenes/Die.gd
+++ b/godot/scenes/Die.gd
@@ -22,6 +22,8 @@ var mat
var target_bounce = 1
var previous_bounciness = 0
+var curr_buff = buff.none
+
var _game: Game = null
enum buff {
@@ -101,7 +103,10 @@ func _physics_process(delta):
if dice_is_moving == true and angular_velocity.length() < 0.01 and linear_velocity.length() < 0.01:
dice_is_moving = false
- get_buff_from_upwards_side()
+ revert_current_buff()
+ curr_buff = get_buff_from_upwards_side()
+ apply_buff()
+
elif dice_is_moving == false and angular_velocity.length() >= 0.01 and linear_velocity.length() >= 0.01:
dice_is_moving = true
@@ -158,3 +163,25 @@ func ball_revert():
$BallShape.hide()
$BallShape.set_process(false)
$BallShape.disabled = true
+
+
+func revert_current_buff():
+ match curr_buff:
+ buff.ball:
+ ball_revert()
+ buff.bounce:
+ bounciness_revert()
+ buff.phase:
+ phase_revert()
+
+
+func apply_buff():
+ match curr_buff:
+ buff.ball:
+ ball()
+ buff.bounce:
+ bounciness()
+ buff.phase:
+ phase()
+ buff.stroke:
+ extra_stroke()