add coin sound and game music
This commit is contained in:
@@ -12,8 +12,8 @@ dest_files=["res://.godot/imported/time_for_adventure.mp3-b8a49ae1cfc83b211be9d8
|
|||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
loop=false
|
loop=true
|
||||||
loop_offset=0
|
loop_offset=0.0
|
||||||
bpm=0
|
bpm=0.0
|
||||||
beat_count=0
|
beat_count=0
|
||||||
bar_beats=4
|
bar_beats=4
|
||||||
|
|||||||
15
default_bus_layout.tres
Normal file
15
default_bus_layout.tres
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
[gd_resource type="AudioBusLayout" format=3 uid="uid://c1lwgrovjcusp"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
bus/1/name = &"Music"
|
||||||
|
bus/1/solo = false
|
||||||
|
bus/1/mute = false
|
||||||
|
bus/1/bypass_fx = false
|
||||||
|
bus/1/volume_db = -13.552524
|
||||||
|
bus/1/send = &"Master"
|
||||||
|
bus/2/name = &"SFX"
|
||||||
|
bus/2/solo = false
|
||||||
|
bus/2/mute = false
|
||||||
|
bus/2/bypass_fx = false
|
||||||
|
bus/2/volume_db = -15.434999
|
||||||
|
bus/2/send = &"Master"
|
||||||
@@ -18,6 +18,7 @@ config/icon="res://icon.svg"
|
|||||||
[autoload]
|
[autoload]
|
||||||
|
|
||||||
NodeTypes="*res://scripts/NodeTypes.gd"
|
NodeTypes="*res://scripts/NodeTypes.gd"
|
||||||
|
Music="*res://scenes/music.tscn"
|
||||||
|
|
||||||
[input]
|
[input]
|
||||||
|
|
||||||
|
|||||||
110
scenes/coin.tscn
110
scenes/coin.tscn
@@ -1,7 +1,8 @@
|
|||||||
[gd_scene load_steps=17 format=3 uid="uid://dotk5aceo1m0k"]
|
[gd_scene load_steps=21 format=3 uid="uid://dotk5aceo1m0k"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://dkgme2xunqgmi" path="res://scripts/coin.gd" id="1_i64fm"]
|
[ext_resource type="Script" uid="uid://dkgme2xunqgmi" path="res://scripts/coin.gd" id="1_i64fm"]
|
||||||
[ext_resource type="Texture2D" uid="uid://be3is0ecci8ro" path="res://assets/sprites/coin.png" id="1_rwqht"]
|
[ext_resource type="Texture2D" uid="uid://be3is0ecci8ro" path="res://assets/sprites/coin.png" id="1_rwqht"]
|
||||||
|
[ext_resource type="AudioStream" uid="uid://mijt27axngn4" path="res://assets/sounds/coin.wav" id="3_11l1o"]
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_i64fm"]
|
[sub_resource type="AtlasTexture" id="AtlasTexture_i64fm"]
|
||||||
atlas = ExtResource("1_rwqht")
|
atlas = ExtResource("1_rwqht")
|
||||||
@@ -98,6 +99,104 @@ animations = [{
|
|||||||
[sub_resource type="CircleShape2D" id="CircleShape2D_ssuvv"]
|
[sub_resource type="CircleShape2D" id="CircleShape2D_ssuvv"]
|
||||||
radius = 5.0
|
radius = 5.0
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_11l1o"]
|
||||||
|
resource_name = "pickup"
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("AnimatedSprite2D:visible")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [false]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("CollisionShape2D:disabled")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [true]
|
||||||
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath("PickupSound:playing")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [true]
|
||||||
|
}
|
||||||
|
tracks/3/type = "method"
|
||||||
|
tracks/3/imported = false
|
||||||
|
tracks/3/enabled = true
|
||||||
|
tracks/3/path = NodePath(".")
|
||||||
|
tracks/3/interp = 1
|
||||||
|
tracks/3/loop_wrap = true
|
||||||
|
tracks/3/keys = {
|
||||||
|
"times": PackedFloat32Array(0.96666664),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"values": [{
|
||||||
|
"args": [],
|
||||||
|
"method": &"queue_free"
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_d14el"]
|
||||||
|
length = 0.001
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("AnimatedSprite2D:visible")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [true]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("CollisionShape2D:disabled")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [false]
|
||||||
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath("PickupSound:playing")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [false]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="AnimationLibrary" id="AnimationLibrary_1ikuy"]
|
||||||
|
_data = {
|
||||||
|
&"RESET": SubResource("Animation_d14el"),
|
||||||
|
&"pickup": SubResource("Animation_11l1o")
|
||||||
|
}
|
||||||
|
|
||||||
[node name="Coin" type="Area2D"]
|
[node name="Coin" type="Area2D"]
|
||||||
collision_mask = 2
|
collision_mask = 2
|
||||||
script = ExtResource("1_i64fm")
|
script = ExtResource("1_i64fm")
|
||||||
@@ -109,4 +208,13 @@ autoplay = "default"
|
|||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
shape = SubResource("CircleShape2D_ssuvv")
|
shape = SubResource("CircleShape2D_ssuvv")
|
||||||
|
|
||||||
|
[node name="PickupSound" type="AudioStreamPlayer2D" parent="."]
|
||||||
|
stream = ExtResource("3_11l1o")
|
||||||
|
bus = &"SFX"
|
||||||
|
|
||||||
|
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||||
|
libraries = {
|
||||||
|
&"": SubResource("AnimationLibrary_1ikuy")
|
||||||
|
}
|
||||||
|
|
||||||
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
||||||
|
|||||||
@@ -358,10 +358,10 @@ unique_name_in_owner = true
|
|||||||
script = ExtResource("2_0tnpc")
|
script = ExtResource("2_0tnpc")
|
||||||
|
|
||||||
[node name="ScoreLabel" type="Label" parent="GameManager"]
|
[node name="ScoreLabel" type="Label" parent="GameManager"]
|
||||||
offset_left = 572.0
|
offset_left = 564.0
|
||||||
offset_top = -149.0
|
offset_top = -128.0
|
||||||
offset_right = 719.0
|
offset_right = 731.0
|
||||||
offset_bottom = -139.0
|
offset_bottom = -118.0
|
||||||
theme_override_colors/font_color = Color(0.09803922, 0.3137255, 0.7529412, 1)
|
theme_override_colors/font_color = Color(0.09803922, 0.3137255, 0.7529412, 1)
|
||||||
theme_override_constants/outline_size = 0
|
theme_override_constants/outline_size = 0
|
||||||
theme_override_fonts/font = ExtResource("4_vtaks")
|
theme_override_fonts/font = ExtResource("4_vtaks")
|
||||||
@@ -483,10 +483,10 @@ theme_override_font_sizes/font_size = 8
|
|||||||
text = "Almost there!"
|
text = "Almost there!"
|
||||||
|
|
||||||
[node name="FinalLabel" type="Label" parent="Labels"]
|
[node name="FinalLabel" type="Label" parent="Labels"]
|
||||||
offset_left = 579.0
|
offset_left = 571.0
|
||||||
offset_top = -164.0
|
offset_top = -143.0
|
||||||
offset_right = 726.0
|
offset_right = 718.0
|
||||||
offset_bottom = -155.0
|
offset_bottom = -134.0
|
||||||
theme_override_colors/font_color = Color(0.09803922, 0.3137255, 0.7529412, 1)
|
theme_override_colors/font_color = Color(0.09803922, 0.3137255, 0.7529412, 1)
|
||||||
theme_override_fonts/font = ExtResource("8_gee14")
|
theme_override_fonts/font = ExtResource("8_gee14")
|
||||||
theme_override_font_sizes/font_size = 8
|
theme_override_font_sizes/font_size = 8
|
||||||
|
|||||||
8
scenes/music.tscn
Normal file
8
scenes/music.tscn
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
[gd_scene load_steps=2 format=3 uid="uid://b273objkep8ww"]
|
||||||
|
|
||||||
|
[ext_resource type="AudioStream" uid="uid://duejyb1yui8j5" path="res://assets/music/time_for_adventure.mp3" id="1_05ggv"]
|
||||||
|
|
||||||
|
[node name="Music" type="AudioStreamPlayer2D"]
|
||||||
|
stream = ExtResource("1_05ggv")
|
||||||
|
autoplay = true
|
||||||
|
bus = &"Music"
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
extends Area2D
|
extends Area2D
|
||||||
|
|
||||||
|
@onready var animation_player: AnimationPlayer = $AnimationPlayer
|
||||||
@onready var game_manager: Node = %GameManager
|
@onready var game_manager: Node = %GameManager
|
||||||
|
|
||||||
func _on_body_entered(_body: Node2D) -> void:
|
func _on_body_entered(_body: Node2D) -> void:
|
||||||
game_manager.add_point()
|
game_manager.add_point()
|
||||||
queue_free()
|
animation_player.play("pickup")
|
||||||
|
|||||||
Reference in New Issue
Block a user