Fixed snowmen enemy bug
The snowmen enemy were acting funny - turns out there were acknowledging the walls as the player, oops. added fix for them to ignore the wall
This commit is contained in:
22
World.tscn
22
World.tscn
@@ -48,7 +48,7 @@ position = Vector2( 72.0738, 92.0067 )
|
||||
texture = ExtResource( 5 )
|
||||
|
||||
[node name="snowmen_enemy5" parent="YSort" instance=ExtResource( 6 )]
|
||||
position = Vector2( 153.088, 50.9116 )
|
||||
position = Vector2( 292.382, 22.7352 )
|
||||
script = ExtResource( 7 )
|
||||
|
||||
[node name="snowmen_enemy4" parent="YSort" instance=ExtResource( 6 )]
|
||||
@@ -56,13 +56,13 @@ position = Vector2( 261.1, 142.19 )
|
||||
script = ExtResource( 7 )
|
||||
|
||||
[node name="snowmen_enemy2" parent="YSort" instance=ExtResource( 4 )]
|
||||
position = Vector2( 206.587, 89.0259 )
|
||||
position = Vector2( 190.316, 146.569 )
|
||||
|
||||
[node name="snowmen_enemy" parent="YSort" instance=ExtResource( 4 )]
|
||||
position = Vector2( 67.4812, 153.194 )
|
||||
|
||||
[node name="Player" parent="YSort" instance=ExtResource( 1 )]
|
||||
position = Vector2( 27.8223, 26.4711 )
|
||||
position = Vector2( 19.4884, 26.0742 )
|
||||
collision_mask = 2
|
||||
|
||||
[node name="tree5" type="StaticBody2D" parent="YSort"]
|
||||
@@ -136,30 +136,30 @@ shape = SubResource( 1 )
|
||||
position = Vector2( 156.836, 92.3404 )
|
||||
texture = ExtResource( 5 )
|
||||
|
||||
[node name="StaticBody2D2" type="StaticBody2D" parent="YSort"]
|
||||
[node name="wall" type="StaticBody2D" parent="YSort"]
|
||||
position = Vector2( -17.4614, 141.279 )
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="YSort/StaticBody2D2"]
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="YSort/wall"]
|
||||
position = Vector2( 329.803, -41.5425 )
|
||||
shape = SubResource( 2 )
|
||||
|
||||
[node name="StaticBody2D3" type="StaticBody2D" parent="YSort"]
|
||||
[node name="wall1" type="StaticBody2D" parent="YSort"]
|
||||
position = Vector2( 15.874, -26.1921 )
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="YSort/StaticBody2D3"]
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="YSort/wall1"]
|
||||
position = Vector2( -3.71627, -0.261772 )
|
||||
shape = SubResource( 3 )
|
||||
|
||||
[node name="StaticBody2D" type="StaticBody2D" parent="YSort"]
|
||||
[node name="wall2" type="StaticBody2D" parent="YSort"]
|
||||
position = Vector2( -7.93701, 71.8299 )
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="YSort/StaticBody2D"]
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="YSort/wall2"]
|
||||
position = Vector2( 8.36367, 26.9858 )
|
||||
shape = SubResource( 2 )
|
||||
|
||||
[node name="StaticBody2D4" type="StaticBody2D" parent="YSort"]
|
||||
[node name="wall3" type="StaticBody2D" parent="YSort"]
|
||||
position = Vector2( -49.6063, 34.526 )
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="YSort/StaticBody2D4"]
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="YSort/wall3"]
|
||||
position = Vector2( 0, -4.25 )
|
||||
shape = SubResource( 4 )
|
||||
|
@@ -20,12 +20,12 @@ func _physics_process(delta: float) -> void:
|
||||
|
||||
|
||||
func _on_Area2D_body_entered(body: Node) -> void:
|
||||
if body != self && !(body.name.begins_with("tree")) && !(body.name.begins_with("snowmen_enemy")):
|
||||
if body != self && !(body.name.begins_with("tree")) && !(body.name.begins_with("snowmen_enemy")) && !(body.name.begins_with("wall")):
|
||||
player = body
|
||||
|
||||
|
||||
func _on_Area2D_body_exited(body: Node) -> void:
|
||||
if !(body.name.begins_with("tree")) && !(body.name.begins_with("snowmen_enemy")):
|
||||
if !(body.name.begins_with("tree")) && !(body.name.begins_with("snowmen_enemy")) && !(body.name.begins_with("wall")):
|
||||
player = null
|
||||
|
||||
|
||||
|
@@ -20,12 +20,12 @@ func _physics_process(delta: float) -> void:
|
||||
|
||||
|
||||
func _on_Area2D_body_entered(body: Node) -> void:
|
||||
if body != self && !(body.name.begins_with("tree")) && !(body.name.begins_with("snowmen_enemy")):
|
||||
if body != self && !(body.name.begins_with("tree")) && !(body.name.begins_with("snowmen_enemy")) && !(body.name.begins_with("wall")):
|
||||
player = body
|
||||
|
||||
|
||||
func _on_Area2D_body_exited(body: Node) -> void:
|
||||
if !(body.name.begins_with("tree")) && !(body.name.begins_with("snowmen_enemy")):
|
||||
if !(body.name.begins_with("tree")) && !(body.name.begins_with("snowmen_enemy")) && !(body.name.begins_with("wall")):
|
||||
player = null
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user