forked from team-sg/hero-mark-2
the damage system refactor!
killing is now done based on groups, the same way enemies already killed the player. these groups go on the entity's hitbox, not the entity itself. enemies' hitboxes have all been put in "enemy_hitbox" the arrow_projectile has a variable for the target group, so it could easily be simply set to "player" for arrows shot by enemies blocking is also done with groups. any hitbox with "blocks_arrow" will block arrows, same with "blocks_sword" and "blocks_squash"
This commit is contained in:
parent
5a02d02ceb
commit
a2974d8dd3
14 changed files with 102 additions and 66 deletions
|
@ -40,11 +40,11 @@ position = Vector2( 1, 3 )
|
|||
frames = SubResource( 4 )
|
||||
playing = true
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="."]
|
||||
[node name="Hitbox" type="Area2D" parent="." groups=["enemy_hitbox"]]
|
||||
position = Vector2( -4, 0 )
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"]
|
||||
position = Vector2( 4.5, 3.5 )
|
||||
shape = SubResource( 5 )
|
||||
|
||||
[connection signal="area_entered" from="Area2D" to="." method="_on_Area2D_area_entered"]
|
||||
[connection signal="area_entered" from="Hitbox" to="." method="_on_Hitbox_area_entered"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue