diff options
author | David <david003@gmx.net> | 2022-07-17 15:10:33 +0200 |
---|---|---|
committer | David <david003@gmx.net> | 2022-07-17 15:10:33 +0200 |
commit | cbb2770401241f864fc0df712e27a3a84572e499 (patch) | |
tree | 3a61589e0e523bf11172859f5bcb4a8d1f5f2f03 /godot/scenes/Die.gd | |
parent | 1b015a5989a3da04f08aaa06db444c875ea97df1 (diff) | |
parent | 9e9101b8c27d723696367692ac7ba24e5248ce37 (diff) | |
download | 2022-cbb2770401241f864fc0df712e27a3a84572e499.tar.gz 2022-cbb2770401241f864fc0df712e27a3a84572e499.tar.bz2 2022-cbb2770401241f864fc0df712e27a3a84572e499.zip |
Merge branch 'main' of codeberg.org:code-your-friends/gmtk2022
Diffstat (limited to '')
-rw-r--r-- | godot/scenes/Die.gd | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/godot/scenes/Die.gd b/godot/scenes/Die.gd index 466366b..3591cba 100644 --- a/godot/scenes/Die.gd +++ b/godot/scenes/Die.gd @@ -24,6 +24,7 @@ var mat var target_bounce = 1 var default_gravity = 2 var default_bounciness = 0 +var after_stroke = true var curr_buff = buff.none @@ -91,6 +92,7 @@ func _input(event): $PowerUI/PowerBar.hide() $PowerUI3D/Arrow.hide() _game.add_stroke() + after_stroke = true #Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED) # add one to counter @@ -118,34 +120,34 @@ func _physics_process(delta): $PowerUI3D.translation.z = translation.z if dice_is_moving == true and dice_still_timing == false and angular_velocity.length() < 0.1 and linear_velocity.length() < 0.1: + print("stop morbin and start timing") dice_is_still_since = OS.get_ticks_msec() dice_still_timing = true - elif dice_is_moving == false and angular_velocity.length() >= 0.1 and linear_velocity.length() >= 0.1: + elif dice_is_moving == false and after_stroke and (angular_velocity.length() >= 0.1 or linear_velocity.length() >= 0.1): + print("start morbin") dice_still_timing = false dice_is_moving = true $PowerUI3D/SpriteCircles.hide() - if dice_still_timing == true && (OS.get_ticks_msec() - dice_is_still_since) > 200: - if curr_buff != buff.ball: - dice_is_moving = false - $PowerUI3D/SpriteCircles.show() + if after_stroke && dice_still_timing == true && (OS.get_ticks_msec() - dice_is_still_since) > 200: + print("stop timing while not morbin") + dice_is_moving = false + after_stroke = false + dice_still_timing = false + $PowerUI3D/SpriteCircles.show() 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() - - - # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(delta): var rot = $CamRoot/Horizontal/Vertical/Camera.get_global_transform().basis.get_euler() $PowerUI3D.rotation_degrees.y = rad2deg(rot.y) + 180 - print(rot.y) func draw_arrow(): var l = 1 + 5 * clamp(die_launch_force_magnitude, 0, die_launch_force_magnitude_max) / die_launch_force_magnitude_max @@ -177,6 +179,7 @@ func draw_arrow(): st.commit(tmpMesh) $PowerUI3D/Arrow.mesh = tmpMesh + """ BUFFS """ |