aboutsummaryrefslogtreecommitdiffstats
path: root/godot/scenes/Die.gd
diff options
context:
space:
mode:
Diffstat (limited to 'godot/scenes/Die.gd')
-rw-r--r--godot/scenes/Die.gd29
1 files changed, 21 insertions, 8 deletions
diff --git a/godot/scenes/Die.gd b/godot/scenes/Die.gd
index bae6c84..dcf165c 100644
--- a/godot/scenes/Die.gd
+++ b/godot/scenes/Die.gd
@@ -142,9 +142,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.
@@ -201,13 +200,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()
@@ -241,9 +243,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()
@@ -252,11 +265,11 @@ func revert_current_buff():
buff.phase:
phase_revert()
buff.gravity:
- gravity_scale = default_gravity
+ low_gravity_revert()
func apply_buff():
- gravity_scale = default_gravity
+ $PowerUI/LabelBuff.text = buff_text()
match curr_buff:
buff.ball:
ball()