aboutsummaryrefslogtreecommitdiffstats
path: root/godot/scenes/Die.gd
diff options
context:
space:
mode:
authorLibravatar IcECreAm777 <31211782+IcECreAm777@users.noreply.github.com>2022-07-17 12:44:10 +0200
committerLibravatar IcECreAm777 <31211782+IcECreAm777@users.noreply.github.com>2022-07-17 12:44:10 +0200
commit18ab11eeb4464626fe27cbc8296967be0f5de993 (patch)
tree1e08d2981a3588f6ed96089b163df1e5cd76a287 /godot/scenes/Die.gd
parent9cb0b053b337742aae96517a8c5c4700698faa03 (diff)
download2022-18ab11eeb4464626fe27cbc8296967be0f5de993.tar.gz
2022-18ab11eeb4464626fe27cbc8296967be0f5de993.tar.bz2
2022-18ab11eeb4464626fe27cbc8296967be0f5de993.zip
fixed reapplying buff bug
Diffstat (limited to 'godot/scenes/Die.gd')
-rw-r--r--godot/scenes/Die.gd10
1 files changed, 5 insertions, 5 deletions
diff --git a/godot/scenes/Die.gd b/godot/scenes/Die.gd
index 0d11d73..3b3a5e7 100644
--- a/godot/scenes/Die.gd
+++ b/godot/scenes/Die.gd
@@ -21,6 +21,7 @@ var mat
var target_bounce = 10
var default_gravity = 2
var default_bounciness = 0
+var after_stroke = false
var curr_buff = buff.none
@@ -83,6 +84,7 @@ func _input(event):
self.apply_torque_impulse(die_launch_force)
$PowerUI/PowerBar.hide()
_game.add_stroke()
+ after_stroke = true
#Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
# add one to counter
@@ -108,6 +110,9 @@ func _physics_process(delta):
if dice_is_moving == true and angular_velocity.length() < 0.1 and linear_velocity.length() < 0.1:
if curr_buff != buff.ball:
dice_is_moving = false
+ if !after_stroke:
+ return
+ after_stroke = false
revert_current_buff()
var last_buff = curr_buff
curr_buff = get_buff_from_upwards_side()
@@ -119,11 +124,6 @@ func _physics_process(delta):
dice_is_moving = true
-# Called every frame. 'delta' is the elapsed time since the previous frame.
-#func _process(delta):
-# pass
-
-
"""
BUFFS
"""