From 7c9aec177476c7aaa45b98ace88433caa1e80006 Mon Sep 17 00:00:00 2001 From: David Date: Sun, 17 Jul 2022 15:33:45 +0200 Subject: change phase to low gravity --- godot/scenes/Die.gd | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'godot/scenes/Die.gd') diff --git a/godot/scenes/Die.gd b/godot/scenes/Die.gd index 3591cba..121f27d 100644 --- a/godot/scenes/Die.gd +++ b/godot/scenes/Die.gd @@ -139,9 +139,8 @@ func _physics_process(delta): revert_current_buff() var last_buff = curr_buff curr_buff = get_buff_from_upwards_side() - if last_buff == curr_buff && curr_buff == buff.stroke: - return - apply_buff() + if not(last_buff == curr_buff && curr_buff == buff.stroke): + apply_buff() # Called every frame. 'delta' is the elapsed time since the previous frame. @@ -198,13 +197,16 @@ func get_buff_from_upwards_side(): if $Bounce1.get_overlapping_areas().size() > 0 || $Bounce2.get_overlapping_areas().size() > 0: return buff.bounce if $Phase1.get_overlapping_areas().size() > 0 || $Phase2.get_overlapping_areas().size() > 0: - return buff.phase + return buff.gravity return buff.none func low_gravity(): - gravity_scale = 0.2 + gravity_scale = 0.3 * default_gravity + +func low_gravity_revert(): + gravity_scale = default_gravity func extra_stroke(): _game.revoke_stroke() @@ -249,10 +251,9 @@ func revert_current_buff(): buff.phase: phase_revert() buff.gravity: - gravity_scale = default_gravity + low_gravity_revert() func apply_buff(): - gravity_scale = default_gravity match curr_buff: buff.ball: ball() -- cgit From ddbcd54013ac76016c39f76394654c4d1451c662 Mon Sep 17 00:00:00 2001 From: David Date: Sun, 17 Jul 2022 15:58:16 +0200 Subject: display buff text --- godot/scenes/Die.gd | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'godot/scenes/Die.gd') diff --git a/godot/scenes/Die.gd b/godot/scenes/Die.gd index 121f27d..b6b9b9e 100644 --- a/godot/scenes/Die.gd +++ b/godot/scenes/Die.gd @@ -240,9 +240,20 @@ func ball_revert(): $BallShape.set_process(false) $BallShape.disabled = true - +func buff_text(): + match curr_buff: + buff.ball: + return "" + buff.bounce: + return "You're bouncy!" + buff.phase: + return "WooOOoOO you can phase through walls" + buff.gravity: + return "Warning, Low gravity!" + return "" func revert_current_buff(): + $PowerUI/LabelBuff.text = "" match curr_buff: buff.ball: ball_revert() @@ -254,6 +265,7 @@ func revert_current_buff(): low_gravity_revert() func apply_buff(): + $PowerUI/LabelBuff.text = buff_text() match curr_buff: buff.ball: ball() -- cgit From 97ec14041a61b10287489120d755770d4d61f444 Mon Sep 17 00:00:00 2001 From: David Date: Sun, 17 Jul 2022 16:46:59 +0200 Subject: 500ms before we are still --- godot/scenes/Die.gd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'godot/scenes/Die.gd') diff --git a/godot/scenes/Die.gd b/godot/scenes/Die.gd index dcf165c..f09a8b0 100644 --- a/godot/scenes/Die.gd +++ b/godot/scenes/Die.gd @@ -133,7 +133,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) > 200: + if after_stroke && dice_still_timing == true && (OS.get_ticks_msec() - dice_is_still_since) > 500: print("stop timing while not morbin") dice_is_moving = false after_stroke = false -- cgit