Skip to content
Snippets Groups Projects
Commit 7b037a86 authored by Fabian Keßler's avatar Fabian Keßler
Browse files
parents e6173555 b08d53f2
No related merge requests found
......@@ -47,13 +47,13 @@ func notify_pengu_suspend():
p.suspend()
func _on_timer_timeout():
var coin = randf_range(0, 1)
var coin = randf_range(0, 2)
var pengu_to_move: Penguin
if (coin == 1):
pengu_to_move = penguins.reduce(func(best, current): return best if best.cluster_score > current.cluster_score else current)
else:
pengu_to_move = penguins[randf_range(0, len(penguins)-1)]
else:
pengu_to_move = penguins.reduce(func(best, current): return best if best.cluster_score > current.cluster_score else current)
if not is_instance_valid(pengu_to_move):
return
if pengu_to_move.get_parent() is IceFloe:
......
......@@ -166,7 +166,6 @@ func _ungrapple() -> void:
print("Un-Grabbed")
Grappled = false
lastGrabbedEisscholle = null
Grappled = false
# Apply a slight dampening when releasing to further reduce slingshot effect
velocity *= 0.85
......@@ -180,3 +179,7 @@ func _on_fish_cooldown_timer_timeout() -> void:
func _on_area_2d_body_entered(body: Node2D) -> void:
CurrentEisscholle = body
func _on_area_2d_body_exited(body: Node2D) -> void:
CurrentEisscholle = null
......@@ -78,3 +78,4 @@ shape = SubResource("CircleShape2D_b3kip")
[connection signal="timeout" from="FishCooldownTimer" to="." method="_on_fish_cooldown_timer_timeout"]
[connection signal="timeout" from="FishDespawnTimer" to="." method="_on_fish_despawn_timer_timeout"]
[connection signal="body_entered" from="Area2D" to="." method="_on_area_2d_body_entered"]
[connection signal="body_exited" from="Area2D" to="." method="_on_area_2d_body_exited"]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment