diff options
author | David <david003@gmx.net> | 2022-07-17 16:32:10 +0200 |
---|---|---|
committer | David <david003@gmx.net> | 2022-07-17 16:32:10 +0200 |
commit | dc25502e4c5714d5b4e18ae50979ce2ba41ca3d3 (patch) | |
tree | 238b904f41a2e7cfaf258f472f70cb778c827868 /godot/scenes/Die.gd | |
parent | d4a7159ddf728fbd6567c0e18963bc0ad580ad41 (diff) | |
parent | e146111ffbee2b133ea16bf97905c5f4559af95e (diff) | |
download | 2022-dc25502e4c5714d5b4e18ae50979ce2ba41ca3d3.tar.gz 2022-dc25502e4c5714d5b4e18ae50979ce2ba41ca3d3.tar.bz2 2022-dc25502e4c5714d5b4e18ae50979ce2ba41ca3d3.zip |
Merge branch 'dave'
Diffstat (limited to '')
-rw-r--r-- | godot/scenes/Die.gd | 29 |
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() |