diff options
author | IcECreAm777 <31211782+IcECreAm777@users.noreply.github.com> | 2022-07-17 17:20:38 +0200 |
---|---|---|
committer | IcECreAm777 <31211782+IcECreAm777@users.noreply.github.com> | 2022-07-17 17:20:38 +0200 |
commit | 96548ad6cc383b5e4cf58f7edf01f7a4e43fe798 (patch) | |
tree | 8c77b1011a7ebac081b91f7eb7eb7bdfacb09653 /godot/scenes/Die.gd | |
parent | 687b9b0c7844aed7c426166d181c90bb58be6124 (diff) | |
parent | 97ec14041a61b10287489120d755770d4d61f444 (diff) | |
download | 2022-96548ad6cc383b5e4cf58f7edf01f7a4e43fe798.tar.gz 2022-96548ad6cc383b5e4cf58f7edf01f7a4e43fe798.tar.bz2 2022-96548ad6cc383b5e4cf58f7edf01f7a4e43fe798.zip |
Merge branch 'main' of https://codeberg.org/code-your-friends/gmtk2022
Diffstat (limited to 'godot/scenes/Die.gd')
-rw-r--r-- | godot/scenes/Die.gd | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/godot/scenes/Die.gd b/godot/scenes/Die.gd index bae6c84..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 @@ -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() |