enemy.tscn 832 B

12345678910111213141516171819202122232425
  1. [gd_scene load_steps=4 format=3]
  2. [ext_resource type="Script" path="res://enemy.gd" id="1"]
  3. [ext_resource type="Texture2D" path="res://enemy_crab.png" id="2_7p8lv"]
  4. [sub_resource type="RectangleShape2D" id="2"]
  5. size = Vector2(76, 76)
  6. [node name="Enemy" type="Node2D" groups=["enemy"]]
  7. position = Vector2(64, 160)
  8. script = ExtResource("1")
  9. [node name="Sprite2D" type="Sprite2D" parent="."]
  10. texture_filter = 1
  11. texture_repeat = 1
  12. scale = Vector2(4, 4)
  13. texture = ExtResource("2_7p8lv")
  14. [node name="AttackArea" type="Area2D" parent="."]
  15. [node name="CollisionShape2D" type="CollisionShape2D" parent="AttackArea"]
  16. shape = SubResource("2")
  17. [connection signal="body_entered" from="AttackArea" to="." method="_on_attack_area_body_entered"]
  18. [connection signal="body_exited" from="AttackArea" to="." method="_on_attack_area_body_exited"]