Coin.tscn 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. [gd_scene load_steps=12 format=2]
  2. [ext_resource path="res://coin/coin.gd" type="Script" id=1]
  3. [ext_resource path="res://coin/coin.png" type="Texture" id=2]
  4. [ext_resource path="res://audio/sound_coin.wav" type="AudioStream" id=3]
  5. [ext_resource path="res://player/bullet.png" type="Texture" id=4]
  6. [sub_resource type="Animation" id=1]
  7. resource_name = "spin"
  8. length = 1.5
  9. loop = true
  10. step = 0.25
  11. tracks/0/type = "value"
  12. tracks/0/path = NodePath("Sprite:frame")
  13. tracks/0/interp = 1
  14. tracks/0/loop_wrap = true
  15. tracks/0/imported = false
  16. tracks/0/enabled = true
  17. tracks/0/keys = {
  18. "times": PoolRealArray( 0, 0.25, 0.5, 0.75, 1, 1.25, 1.5 ),
  19. "transitions": PoolRealArray( 1, 1, 1, 1, 1, 1, 1 ),
  20. "update": 1,
  21. "values": [ 0, 1, 2, 3, 2, 1, 0 ]
  22. }
  23. [sub_resource type="Animation" id=2]
  24. length = 8.0
  25. step = 0.0
  26. tracks/0/type = "value"
  27. tracks/0/path = NodePath("Sprite:frame")
  28. tracks/0/interp = 1
  29. tracks/0/loop_wrap = true
  30. tracks/0/imported = false
  31. tracks/0/enabled = true
  32. tracks/0/keys = {
  33. "times": PoolRealArray( 0 ),
  34. "transitions": PoolRealArray( 1 ),
  35. "update": 0,
  36. "values": [ 0 ]
  37. }
  38. tracks/1/type = "value"
  39. tracks/1/path = NodePath("Particles:emitting")
  40. tracks/1/interp = 1
  41. tracks/1/loop_wrap = true
  42. tracks/1/imported = false
  43. tracks/1/enabled = true
  44. tracks/1/keys = {
  45. "times": PoolRealArray( 0 ),
  46. "transitions": PoolRealArray( 1 ),
  47. "update": 1,
  48. "values": [ true ]
  49. }
  50. tracks/2/type = "method"
  51. tracks/2/path = NodePath(".")
  52. tracks/2/interp = 1
  53. tracks/2/loop_wrap = true
  54. tracks/2/imported = false
  55. tracks/2/enabled = true
  56. tracks/2/keys = {
  57. "times": PoolRealArray( 2.7 ),
  58. "transitions": PoolRealArray( 1 ),
  59. "values": [ {
  60. "args": [ ],
  61. "method": "queue_free"
  62. } ]
  63. }
  64. tracks/3/type = "value"
  65. tracks/3/path = NodePath("Sound:playing")
  66. tracks/3/interp = 1
  67. tracks/3/loop_wrap = true
  68. tracks/3/imported = false
  69. tracks/3/enabled = true
  70. tracks/3/keys = {
  71. "times": PoolRealArray( 0 ),
  72. "transitions": PoolRealArray( 1 ),
  73. "update": 1,
  74. "values": [ true ]
  75. }
  76. tracks/4/type = "value"
  77. tracks/4/path = NodePath("Sprite:self_modulate")
  78. tracks/4/interp = 1
  79. tracks/4/loop_wrap = true
  80. tracks/4/imported = false
  81. tracks/4/enabled = true
  82. tracks/4/keys = {
  83. "times": PoolRealArray( 0, 0.41 ),
  84. "transitions": PoolRealArray( 1, 1 ),
  85. "update": 0,
  86. "values": [ Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0 ) ]
  87. }
  88. [sub_resource type="CircleShape2D" id=3]
  89. radius = 5.0
  90. [sub_resource type="CanvasItemMaterial" id=4]
  91. blend_mode = 1
  92. [sub_resource type="Curve" id=5]
  93. [sub_resource type="CurveTexture" id=6]
  94. curve = SubResource( 5 )
  95. [sub_resource type="ParticlesMaterial" id=7]
  96. emission_shape = 1
  97. emission_sphere_radius = 20.0
  98. flag_disable_z = true
  99. gravity = Vector3( 0, 0, 0 )
  100. initial_velocity = 1.0
  101. angular_velocity = 0.0191222
  102. orbit_velocity = 0.0
  103. orbit_velocity_random = 0.0
  104. scale = 0.3
  105. scale_curve = SubResource( 6 )
  106. [node name="Coin" type="Area2D"]
  107. script = ExtResource( 1 )
  108. [node name="Sprite" type="Sprite" parent="."]
  109. texture = ExtResource( 2 )
  110. hframes = 4
  111. [node name="AnimationPlayer" type="AnimationPlayer" parent="."]
  112. autoplay = "spin"
  113. anims/spin = SubResource( 1 )
  114. anims/taken = SubResource( 2 )
  115. [node name="Collision" type="CollisionShape2D" parent="."]
  116. shape = SubResource( 3 )
  117. [node name="Sound" type="AudioStreamPlayer2D" parent="."]
  118. stream = ExtResource( 3 )
  119. [node name="Particles" type="Particles2D" parent="."]
  120. modulate = Color( 0.596863, 0.638745, 1, 1 )
  121. material = SubResource( 4 )
  122. emitting = false
  123. one_shot = true
  124. explosiveness = 0.7
  125. process_material = SubResource( 7 )
  126. texture = ExtResource( 4 )
  127. [node name="Enabler" type="VisibilityEnabler2D" parent="."]
  128. rect = Rect2( -5, -5, 10, 10 )
  129. pause_particles = false
  130. [connection signal="body_entered" from="." to="." method="_on_body_enter"]