forked from team-sg/hero-mark-2
player can now be killed by death tiles directly
This commit is contained in:
parent
9552fee802
commit
89671b3ca9
3 changed files with 18 additions and 3 deletions
|
@ -354,3 +354,6 @@ func _on_SwordArea_area_entered(area):
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
target.die()
|
target.die()
|
||||||
|
|
||||||
|
func _on_Area2D_body_entered(body):
|
||||||
|
if body.is_in_group("death"): die()
|
||||||
|
|
|
@ -628,6 +628,7 @@ region_rect = Rect2( 0, 0, 32, 32 )
|
||||||
[node name="Area2D" type="Area2D" parent="." groups=["player"]]
|
[node name="Area2D" type="Area2D" parent="." groups=["player"]]
|
||||||
position = Vector2( 0, 3 )
|
position = Vector2( 0, 3 )
|
||||||
collision_layer = 9
|
collision_layer = 9
|
||||||
|
collision_mask = 33
|
||||||
|
|
||||||
[node name="CollisionShape2D2" type="CollisionShape2D" parent="Area2D"]
|
[node name="CollisionShape2D2" type="CollisionShape2D" parent="Area2D"]
|
||||||
position = Vector2( 0.5, 2 )
|
position = Vector2( 0.5, 2 )
|
||||||
|
@ -710,5 +711,6 @@ scale_amount = 0.25
|
||||||
scale_amount_random = 0.5
|
scale_amount_random = 0.5
|
||||||
scale_amount_curve = SubResource( 43 )
|
scale_amount_curve = SubResource( 43 )
|
||||||
|
|
||||||
|
[connection signal="body_entered" from="Area2D" to="." method="_on_Area2D_body_entered"]
|
||||||
[connection signal="animation_finished" from="AnimationPlayer" to="." method="_on_AnimationPlayer_animation_finished"]
|
[connection signal="animation_finished" from="AnimationPlayer" to="." method="_on_AnimationPlayer_animation_finished"]
|
||||||
[connection signal="area_entered" from="SwordArea" to="." method="_on_SwordArea_area_entered"]
|
[connection signal="area_entered" from="SwordArea" to="." method="_on_SwordArea_area_entered"]
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
[gd_resource type="TileSet" load_steps=4 format=2]
|
[gd_resource type="TileSet" load_steps=5 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://graphics/tiles/water.tres" type="Texture" id=1]
|
[ext_resource path="res://graphics/tiles/water.tres" type="Texture" id=1]
|
||||||
[ext_resource path="res://graphics/tiles/spike.png" type="Texture" id=2]
|
[ext_resource path="res://graphics/tiles/spike.png" type="Texture" id=2]
|
||||||
[ext_resource path="res://graphics/tiles/water_bottom.png" type="Texture" id=3]
|
[ext_resource path="res://graphics/tiles/water_bottom.png" type="Texture" id=3]
|
||||||
|
|
||||||
|
[sub_resource type="ConvexPolygonShape2D" id=1]
|
||||||
|
points = PoolVector2Array( 8, 8, 0, 8, 0, 0, 8, 0 )
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
0/name = "water.tres 0"
|
0/name = "water.tres 0"
|
||||||
0/texture = ExtResource( 1 )
|
0/texture = ExtResource( 1 )
|
||||||
|
@ -36,9 +39,16 @@
|
||||||
1/navigation_offset = Vector2( 0, 0 )
|
1/navigation_offset = Vector2( 0, 0 )
|
||||||
1/shape_offset = Vector2( 0, 0 )
|
1/shape_offset = Vector2( 0, 0 )
|
||||||
1/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
|
1/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||||
|
1/shape = SubResource( 1 )
|
||||||
1/shape_one_way = false
|
1/shape_one_way = false
|
||||||
1/shape_one_way_margin = 0.0
|
1/shape_one_way_margin = 1.0
|
||||||
1/shapes = [ ]
|
1/shapes = [ {
|
||||||
|
"autotile_coord": Vector2( 0, 0 ),
|
||||||
|
"one_way": false,
|
||||||
|
"one_way_margin": 1.0,
|
||||||
|
"shape": SubResource( 1 ),
|
||||||
|
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||||
|
} ]
|
||||||
1/z_index = 0
|
1/z_index = 0
|
||||||
2/name = "spike.png 2"
|
2/name = "spike.png 2"
|
||||||
2/texture = ExtResource( 2 )
|
2/texture = ExtResource( 2 )
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue