fix: cards don"t push each other when highlited

This commit is contained in:
betalars 2023-07-15 13:05:08 +02:00
parent d215ba58d5
commit fc1cd50430
1 changed files with 2 additions and 2 deletions

View File

@ -95,10 +95,10 @@ func _process(delta: float) -> void:
if get_overlapping_areas().size() > 0: if get_overlapping_areas().size() > 0:
for area in get_overlapping_areas(): for area in get_overlapping_areas():
if area is Card or area is CardCollider and not area.is_dragged: if area is Card or area is CardCollider:
if area is CardCollider: if area is CardCollider:
position += area.direction * delta position += area.direction * delta
else: elif not area.highlighted:
var diff:Vector2 = position - area.position var diff:Vector2 = position - area.position
position -= diff.normalized() * ((diff.length()-diameter)/diameter) * bounce_speed * (delta/(1.0/60)) position -= diff.normalized() * ((diff.length()-diameter)/diameter) * bounce_speed * (delta/(1.0/60))