From 0e33b66901e23e935bc2ba33d66e3c377261ebb8 Mon Sep 17 00:00:00 2001 From: David Date: Sun, 17 Jul 2022 17:33:55 +0200 Subject: +1 animation --- godot/scenes/Die.gd | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'godot/scenes/Die.gd') 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 -- cgit