coin.tscn 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. [gd_scene load_steps=10 format=1]
  2. [ext_resource path="res://coin.gd" type="Script" id=1]
  3. [ext_resource path="res://coin.png" type="Texture" id=2]
  4. [ext_resource path="res://sound_coin.wav" type="Sample" id=3]
  5. [ext_resource path="res://bullet.png" type="Texture" id=4]
  6. [sub_resource type="CircleShape2D" id=1]
  7. custom_solver_bias = 0.0
  8. radius = 10.0
  9. [sub_resource type="Animation" id=2]
  10. resource/name = "spin"
  11. length = 1.5
  12. loop = true
  13. step = 0.25
  14. tracks/0/type = "value"
  15. tracks/0/path = NodePath("sprite:frame")
  16. tracks/0/interp = 1
  17. tracks/0/keys = { "cont":false, "times":FloatArray( 0, 0.25, 0.5, 0.75, 1, 1.25, 1.5 ), "transitions":FloatArray( 1, 1, 1, 1, 1, 1, 1 ), "values":[ 0, 1, 2, 3, 2, 1, 0 ] }
  18. [sub_resource type="Animation" id=3]
  19. length = 8.0
  20. loop = false
  21. step = 0.0
  22. tracks/0/type = "value"
  23. tracks/0/path = NodePath("sprite:frame")
  24. tracks/0/interp = 1
  25. tracks/0/keys = { "cont":true, "times":FloatArray( 0 ), "transitions":FloatArray( 1 ), "values":[ 0 ] }
  26. tracks/1/type = "value"
  27. tracks/1/path = NodePath("sound:play/play")
  28. tracks/1/interp = 1
  29. tracks/1/keys = { "cont":false, "times":FloatArray( 0 ), "transitions":FloatArray( 1 ), "values":[ "coin" ] }
  30. tracks/2/type = "value"
  31. tracks/2/path = NodePath("particles:visibility/self_opacity")
  32. tracks/2/interp = 1
  33. tracks/2/keys = { "cont":true, "times":FloatArray( 0, 1.66 ), "transitions":FloatArray( 1, 1 ), "values":[ 1.0, 0.0 ] }
  34. tracks/3/type = "value"
  35. tracks/3/path = NodePath("sprite:visibility/self_opacity")
  36. tracks/3/interp = 1
  37. tracks/3/keys = { "cont":true, "times":FloatArray( 0, 0.4 ), "transitions":FloatArray( 1, 1 ), "values":[ 1.0, 0.0 ] }
  38. tracks/4/type = "value"
  39. tracks/4/path = NodePath("particles:config/emitting")
  40. tracks/4/interp = 1
  41. tracks/4/keys = { "cont":false, "times":FloatArray( 0 ), "transitions":FloatArray( 1 ), "values":[ true ] }
  42. tracks/5/type = "method"
  43. tracks/5/path = NodePath(".")
  44. tracks/5/interp = 1
  45. tracks/5/keys = { "times":FloatArray( 2.7 ), "transitions":FloatArray( 1 ), "values":[ { "args":[ ], "method":"queue_free" } ] }
  46. [sub_resource type="SampleLibrary" id=4]
  47. samples/coin = { "db":0.0, "pitch":1.0, "sample":ExtResource( 3 ) }
  48. [sub_resource type="ColorRamp" id=5]
  49. offsets = FloatArray( 0, 1 )
  50. colors = ColorArray( 1, 1, 1, 1, 0, 0, 0, 1 )
  51. [node name="coin" type="Area2D"]
  52. input/pickable = true
  53. shapes/0/shape = SubResource( 1 )
  54. shapes/0/transform = Matrix32( 1, 0, 0, 1, 0, 0 )
  55. shapes/0/trigger = false
  56. gravity_vec = Vector2( 0, 1 )
  57. gravity = 98.0
  58. linear_damp = 0.1
  59. angular_damp = 1.0
  60. script/script = ExtResource( 1 )
  61. [node name="sprite" type="Sprite" parent="."]
  62. texture = ExtResource( 2 )
  63. hframes = 4
  64. [node name="anim" type="AnimationPlayer" parent="."]
  65. playback/process_mode = 1
  66. playback/default_blend_time = 0.0
  67. root/root = NodePath("..")
  68. anims/spin = SubResource( 2 )
  69. anims/taken = SubResource( 3 )
  70. playback/active = true
  71. playback/speed = 3.0
  72. blend_times = [ ]
  73. autoplay = "spin"
  74. [node name="collision" type="CollisionShape2D" parent="."]
  75. shape = SubResource( 1 )
  76. trigger = false
  77. _update_shape_index = -1
  78. [node name="sound" type="SamplePlayer2D" parent="."]
  79. params/volume_db = 0.0
  80. params/pitch_scale = 1.0
  81. params/attenuation/min_distance = 1.0
  82. params/attenuation/max_distance = 2048.0
  83. params/attenuation/distance_exp = 1.0
  84. config/polyphony = 1
  85. config/samples = SubResource( 4 )
  86. config/pitch_random = 0.0
  87. [node name="particles" type="Particles2D" parent="."]
  88. visibility/blend_mode = 1
  89. config/amount = 8
  90. config/lifetime = 0.4
  91. config/emitting = false
  92. config/half_extents = Vector2( 5, 5 )
  93. config/texture = ExtResource( 4 )
  94. params/direction = 0.0
  95. params/spread = 10.0
  96. params/linear_velocity = 0.0
  97. params/spin_velocity = 0.0
  98. params/orbit_velocity = 0.0
  99. params/gravity_direction = 0.0
  100. params/gravity_strength = 0.0
  101. params/radial_accel = 0.0
  102. params/tangential_accel = 0.0
  103. params/damping = 0.0
  104. params/initial_angle = 0.0
  105. params/initial_size = 0.2
  106. params/final_size = 0.2
  107. params/hue_variation = 0.0
  108. params/anim_speed_scale = 1.0
  109. params/anim_initial_pos = 0.0
  110. color/color_ramp = SubResource( 5 )
  111. [node name="enabler" type="VisibilityEnabler2D" parent="."]
  112. rect = Rect2( -10, -10, 20, 20 )
  113. enabler/pause_animations = true
  114. enabler/freeze_bodies = true
  115. enabler/pause_particles = true
  116. enabler/process_parent = false
  117. enabler/fixed_process_parent = false
  118. [connection signal="body_enter" from="." to="." method="_on_body_enter"]