diff options
author | IcECreAm777 <31211782+IcECreAm777@users.noreply.github.com> | 2022-07-17 12:44:10 +0200 |
---|---|---|
committer | IcECreAm777 <31211782+IcECreAm777@users.noreply.github.com> | 2022-07-17 12:44:10 +0200 |
commit | 18ab11eeb4464626fe27cbc8296967be0f5de993 (patch) | |
tree | 1e08d2981a3588f6ed96089b163df1e5cd76a287 /godot/scenes | |
parent | 9cb0b053b337742aae96517a8c5c4700698faa03 (diff) | |
download | 2022-18ab11eeb4464626fe27cbc8296967be0f5de993.tar.gz 2022-18ab11eeb4464626fe27cbc8296967be0f5de993.tar.bz2 2022-18ab11eeb4464626fe27cbc8296967be0f5de993.zip |
fixed reapplying buff bug
Diffstat (limited to 'godot/scenes')
-rw-r--r-- | godot/scenes/Die.gd | 10 | ||||
-rw-r--r-- | godot/scenes/Die.tscn | 1 |
2 files changed, 6 insertions, 5 deletions
diff --git a/godot/scenes/Die.gd b/godot/scenes/Die.gd index 0d11d73..3b3a5e7 100644 --- a/godot/scenes/Die.gd +++ b/godot/scenes/Die.gd @@ -21,6 +21,7 @@ var mat var target_bounce = 10 var default_gravity = 2 var default_bounciness = 0 +var after_stroke = false var curr_buff = buff.none @@ -83,6 +84,7 @@ func _input(event): self.apply_torque_impulse(die_launch_force) $PowerUI/PowerBar.hide() _game.add_stroke() + after_stroke = true #Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED) # add one to counter @@ -108,6 +110,9 @@ func _physics_process(delta): if dice_is_moving == true and angular_velocity.length() < 0.1 and linear_velocity.length() < 0.1: if curr_buff != buff.ball: dice_is_moving = false + if !after_stroke: + return + after_stroke = false revert_current_buff() var last_buff = curr_buff curr_buff = get_buff_from_upwards_side() @@ -119,11 +124,6 @@ func _physics_process(delta): dice_is_moving = true -# Called every frame. 'delta' is the elapsed time since the previous frame. -#func _process(delta): -# pass - - """ BUFFS """ diff --git a/godot/scenes/Die.tscn b/godot/scenes/Die.tscn index bab53ad..75f7223 100644 --- a/godot/scenes/Die.tscn +++ b/godot/scenes/Die.tscn @@ -32,6 +32,7 @@ surfaces/0 = { radius = 0.1 [node name="Die" type="RigidBody"] +collision_layer = 3 collision_mask = 3 physics_material_override = SubResource( 7 ) linear_damp = 0.0 |