aboutsummaryrefslogtreecommitdiffstats
path: root/godot/scenes/Die.gd
diff options
context:
space:
mode:
authorLibravatar David <david003@gmx.net>2022-07-17 17:33:55 +0200
committerLibravatar David <david003@gmx.net>2022-07-17 17:33:55 +0200
commit0e33b66901e23e935bc2ba33d66e3c377261ebb8 (patch)
tree9b8b4bdec910ffe1aea9b66744f87aa8633fe89e /godot/scenes/Die.gd
parent97ec14041a61b10287489120d755770d4d61f444 (diff)
download2022-0e33b66901e23e935bc2ba33d66e3c377261ebb8.tar.gz
2022-0e33b66901e23e935bc2ba33d66e3c377261ebb8.tar.bz2
2022-0e33b66901e23e935bc2ba33d66e3c377261ebb8.zip
+1 animation
Diffstat (limited to 'godot/scenes/Die.gd')
-rw-r--r--godot/scenes/Die.gd13
1 files changed, 12 insertions, 1 deletions
diff --git a/godot/scenes/Die.gd b/godot/scenes/Die.gd
index f09a8b0..7879168 100644
--- a/godot/scenes/Die.gd
+++ b/godot/scenes/Die.gd
@@ -25,6 +25,7 @@ var target_bounce = 1
var default_gravity = 2
var default_bounciness = 0
var after_stroke = true
+var plus1Start = 999999999999
var curr_buff = buff.none
@@ -133,7 +134,7 @@ func _physics_process(delta):
dice_is_moving = true
$PowerUI3D/SpriteCircles.hide()
- if after_stroke && dice_still_timing == true && (OS.get_ticks_msec() - dice_is_still_since) > 500:
+ if after_stroke && dice_still_timing == true && (OS.get_ticks_msec() - dice_is_still_since) > 800:
print("stop timing while not morbin")
dice_is_moving = false
after_stroke = false
@@ -150,6 +151,15 @@ func _physics_process(delta):
func _process(delta):
var rot = $CamRoot/Horizontal/Vertical/Camera.get_global_transform().basis.get_euler()
$PowerUI3D.rotation_degrees.y = rad2deg(rot.y) + 180
+
+ var remaining = clamp(1000 - (OS.get_ticks_msec() - plus1Start), 0, 1000)
+ $PowerUI3D/SpritePlus1.translation.y = 2 + (1000-remaining)/300.0
+ print(remaining)
+ if remaining > 0 && remaining < 1000:
+ $PowerUI3D/SpritePlus1.show()
+ else:
+ $PowerUI3D/SpritePlus1.hide()
+
func draw_arrow():
var l = 1 + 5 * clamp(die_launch_force_magnitude, 0, die_launch_force_magnitude_max) / die_launch_force_magnitude_max
@@ -213,6 +223,7 @@ func low_gravity_revert():
func extra_stroke():
_game.revoke_stroke()
+ plus1Start = OS.get_ticks_msec()
func bounciness():
mat.bounce = target_bounce