Skip to content

Commit

Permalink
feat: rotate dice immediately to ground on landing
Browse files Browse the repository at this point in the history
  • Loading branch information
myin142 committed Jul 17, 2022
1 parent fc106d3 commit 21d2eb3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions scenes/dice/Dice.gd
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,8 @@ func _process(delta):

func _rotate_to_ground(diff: int, delta: float):
var target_rotation = sprite.rotation_degrees - diff
var needed_rotation_abs = abs(diff)
sprite.rotation_degrees = target_rotation

sprite.rotation_degrees = move_toward(sprite.rotation_degrees, target_rotation, (rotation_landing_speed / needed_rotation_abs) * delta)

func _roll_random_number():
var random_num = random.randi_range(1, 6)
Expand Down

0 comments on commit 21d2eb3

Please sign in to comment.