aboutsummaryrefslogtreecommitdiffstats
path: root/godot/scenes/Die.gd
diff options
context:
space:
mode:
authorLibravatar IcECreAm777 <31211782+IcECreAm777@users.noreply.github.com>2022-07-17 18:16:36 +0200
committerLibravatar IcECreAm777 <31211782+IcECreAm777@users.noreply.github.com>2022-07-17 18:16:36 +0200
commitbd28c467aa188d292b05a094f64613363c6d79ad (patch)
treee93b5c80b7d026558a01b6891b8979ab18d7d73e /godot/scenes/Die.gd
parent1234f970eeb95e56fcb480fe3e8c7903606291ed (diff)
parentcaaba9f0b3f2c1906fb9bc26aa1eb55dd5526be6 (diff)
download2022-bd28c467aa188d292b05a094f64613363c6d79ad.tar.gz
2022-bd28c467aa188d292b05a094f64613363c6d79ad.tar.bz2
2022-bd28c467aa188d292b05a094f64613363c6d79ad.zip
Merge branch 'main' of https://codeberg.org/code-your-friends/gmtk2022
Diffstat (limited to '')
-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