fix: Frog jumps on harmful if its also food for him

This commit is contained in:
Jakob Feldmann 2023-10-10 14:00:52 +02:00
parent bf802571a2
commit 44b6cbf379
2 changed files with 2 additions and 1 deletions

View File

@ -257,7 +257,7 @@ cast_to = Vector2( 0, -1 )
collision_mask = 56
collide_with_areas = true
[node name="EnemyBody" type="CollisionShape2D" parent="." groups=["harmful"]]
[node name="EnemyBody" type="CollisionShape2D" parent="." groups=["frogfood", "harmful"]]
position = Vector2( 0, -0.5 )
shape = SubResource( 1 )

View File

@ -517,6 +517,7 @@ func is_jump_path_safe(v: Vector2, pos: Vector2) -> bool:
abs(node_pos.x - pos.x) > abs(jump_distance) * 3
|| abs(node_pos.y - pos.y) > block_size * 4
|| abs(node_pos.x - pos.x) < 1
|| node.is_in_group("frogfood")
):
continue
var node_y = node_pos.y - block_size / 2.0