monster.tscn 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. [gd_scene load_steps=8 format=2]
  2. [ext_resource path="res://art/Untitledcxz.png" type="Texture" id=1]
  3. [sub_resource type="AtlasTexture" id=9]
  4. atlas = ExtResource( 1 )
  5. region = Rect2( 0, 0, 112, 113 )
  6. [sub_resource type="AtlasTexture" id=10]
  7. atlas = ExtResource( 1 )
  8. region = Rect2( 112, 0, 112, 113 )
  9. [sub_resource type="AtlasTexture" id=11]
  10. atlas = ExtResource( 1 )
  11. region = Rect2( 224, 0, 112, 113 )
  12. [sub_resource type="AtlasTexture" id=12]
  13. atlas = ExtResource( 1 )
  14. region = Rect2( 336, 0, 112, 113 )
  15. [sub_resource type="SpriteFrames" id=3]
  16. animations = [ {
  17. "frames": [ SubResource( 9 ), SubResource( 10 ), SubResource( 11 ), SubResource( 12 ) ],
  18. "loop": true,
  19. "name": "goblin",
  20. "speed": 5.0
  21. } ]
  22. [sub_resource type="GDScript" id=8]
  23. script/source = "extends AnimatedSprite
  24. # Declare member variables here. Examples:
  25. # var a = 2
  26. # var b = \"text\"
  27. # Called when the node enters the scene tree for the first time.
  28. func _ready():
  29. speed_scale = rand_range(0.8,1.2)
  30. pass # Replace with function body.
  31. # Called every frame. 'delta' is the elapsed time since the previous frame.
  32. #func _process(delta):
  33. # pass
  34. "
  35. [node name="monster" type="AnimatedSprite"]
  36. visible = false
  37. frames = SubResource( 3 )
  38. animation = "goblin"
  39. frame = 1
  40. playing = true
  41. script = SubResource( 8 )