Enemy2.tscn 590 B

1234567891011121314151617181920212223
  1. [gd_scene load_steps=3 format=2]
  2. [sub_resource type="GDScript" id=2]
  3. script/source = "extends KinematicBody2D
  4. var id = 0
  5. func damage( damage, attacker):
  6. get_parent().dict.arrayvida[id] -= damage
  7. get_parent().death_count(attacker)
  8. # get_node('CollisionShape2D').disabled = true
  9. # queue_free()
  10. # print(get_parent().dict.arrayvida[id])
  11. pass
  12. "
  13. [sub_resource type="RectangleShape2D" id=1]
  14. [node name="Enemy" type="KinematicBody2D"]
  15. collision_layer = 4
  16. collision_mask = 0
  17. script = SubResource( 2 )
  18. [node name="CollisionShape2D" type="CollisionShape2D" parent="."]
  19. shape = SubResource( 1 )