Mob.tscn 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. [gd_scene load_steps=10 format=3 uid="uid://ixe1g4hv46xs"]
  2. [ext_resource type="Script" path="res://Mob.cs" id="1"]
  3. [ext_resource type="Texture2D" uid="uid://cs7c2mx7kjda5" path="res://art/enemySwimming_1.png" id="2"]
  4. [ext_resource type="Texture2D" uid="uid://dwhy2f3yw4bc8" path="res://art/enemySwimming_2.png" id="3"]
  5. [ext_resource type="Texture2D" uid="uid://brrcidfqf6bgp" path="res://art/enemyWalking_1.png" id="4"]
  6. [ext_resource type="Texture2D" uid="uid://bctq8ot1ilm0m" path="res://art/enemyWalking_2.png" id="5"]
  7. [ext_resource type="Texture2D" uid="uid://6agt7sebvtk0" path="res://art/enemyFlyingAlt_1.png" id="6"]
  8. [ext_resource type="Texture2D" uid="uid://co0kr2y7s2u0e" path="res://art/enemyFlyingAlt_2.png" id="7"]
  9. [sub_resource type="SpriteFrames" id="1"]
  10. animations = [{
  11. "frames": [{
  12. "duration": 1.0,
  13. "texture": ExtResource("6")
  14. }, {
  15. "duration": 1.0,
  16. "texture": ExtResource("7")
  17. }],
  18. "loop": true,
  19. "name": &"fly",
  20. "speed": 3.0
  21. }, {
  22. "frames": [{
  23. "duration": 1.0,
  24. "texture": ExtResource("2")
  25. }, {
  26. "duration": 1.0,
  27. "texture": ExtResource("3")
  28. }],
  29. "loop": true,
  30. "name": &"swim",
  31. "speed": 4.0
  32. }, {
  33. "frames": [{
  34. "duration": 1.0,
  35. "texture": ExtResource("4")
  36. }, {
  37. "duration": 1.0,
  38. "texture": ExtResource("5")
  39. }],
  40. "loop": true,
  41. "name": &"walk",
  42. "speed": 4.0
  43. }]
  44. [sub_resource type="CapsuleShape2D" id="2"]
  45. radius = 37.0
  46. height = 100.0
  47. [node name="Mob" type="RigidBody2D" groups=["mobs"]]
  48. collision_mask = 0
  49. gravity_scale = 0.0
  50. script = ExtResource("1")
  51. [node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
  52. scale = Vector2(0.75, 0.75)
  53. sprite_frames = SubResource("1")
  54. animation = &"walk"
  55. [node name="CollisionShape2D" type="CollisionShape2D" parent="."]
  56. rotation = 1.5708
  57. shape = SubResource("2")
  58. [node name="VisibleOnScreenNotifier2D" type="VisibleOnScreenNotifier2D" parent="."]
  59. [connection signal="screen_exited" from="VisibleOnScreenNotifier2D" to="." method="OnVisibleOnScreenNotifier2DScreenExited"]