music and sound effects
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://876u7dhsa1tb"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
bus/1/name = &"Music"
|
||||||
|
bus/1/solo = false
|
||||||
|
bus/1/mute = false
|
||||||
|
bus/1/bypass_fx = false
|
||||||
|
bus/1/volume_db = -20.3764
|
||||||
|
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 = -31.0758
|
||||||
|
bus/2/send = &"Master"
|
@ -15,6 +15,10 @@ run/main_scene="res://scenes/game.tscn"
|
|||||||
config/features=PackedStringArray("4.3", "Forward Plus")
|
config/features=PackedStringArray("4.3", "Forward Plus")
|
||||||
config/icon="res://icon.svg"
|
config/icon="res://icon.svg"
|
||||||
|
|
||||||
|
[autoload]
|
||||||
|
|
||||||
|
Music="*res://scenes/music.tscn"
|
||||||
|
|
||||||
[input]
|
[input]
|
||||||
|
|
||||||
jump={
|
jump={
|
||||||
@ -33,7 +37,6 @@ move_left={
|
|||||||
move_right={
|
move_right={
|
||||||
"deadzone": 0.5,
|
"deadzone": 0.5,
|
||||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194321,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194321,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"location":0,"echo":false,"script":null)
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
112
scenes/coin.tscn
112
scenes/coin.tscn
@ -1,7 +1,8 @@
|
|||||||
[gd_scene load_steps=17 format=3 uid="uid://dbjp33ljlh1vh"]
|
[gd_scene load_steps=21 format=3 uid="uid://dbjp33ljlh1vh"]
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://db1subkmbj2d8" path="res://assets/sprites/coin.png" id="1_g13xr"]
|
[ext_resource type="Texture2D" uid="uid://db1subkmbj2d8" path="res://assets/sprites/coin.png" id="1_g13xr"]
|
||||||
[ext_resource type="Script" path="res://scripts/coin.gd" id="1_y3u7o"]
|
[ext_resource type="Script" path="res://scripts/coin.gd" id="1_y3u7o"]
|
||||||
|
[ext_resource type="AudioStream" uid="uid://djp87smeym64l" path="res://assets/sounds/coin.wav" id="3_jrqru"]
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_16edh"]
|
[sub_resource type="AtlasTexture" id="AtlasTexture_16edh"]
|
||||||
atlas = ExtResource("1_g13xr")
|
atlas = ExtResource("1_g13xr")
|
||||||
@ -98,6 +99,104 @@ animations = [{
|
|||||||
[sub_resource type="CircleShape2D" id="CircleShape2D_xb7vb"]
|
[sub_resource type="CircleShape2D" id="CircleShape2D_xb7vb"]
|
||||||
radius = 4.12311
|
radius = 4.12311
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_iyw47"]
|
||||||
|
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.5),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"values": [{
|
||||||
|
"args": [],
|
||||||
|
"method": &"queue_free"
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_gjsx2"]
|
||||||
|
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_ln4ma"]
|
||||||
|
_data = {
|
||||||
|
"RESET": SubResource("Animation_gjsx2"),
|
||||||
|
"pickup": SubResource("Animation_iyw47")
|
||||||
|
}
|
||||||
|
|
||||||
[node name="Coin" type="Area2D"]
|
[node name="Coin" type="Area2D"]
|
||||||
collision_mask = 2
|
collision_mask = 2
|
||||||
script = ExtResource("1_y3u7o")
|
script = ExtResource("1_y3u7o")
|
||||||
@ -105,9 +204,18 @@ script = ExtResource("1_y3u7o")
|
|||||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||||
sprite_frames = SubResource("SpriteFrames_gwbt3")
|
sprite_frames = SubResource("SpriteFrames_gwbt3")
|
||||||
autoplay = "default"
|
autoplay = "default"
|
||||||
frame_progress = 0.446115
|
frame_progress = 0.783864
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
shape = SubResource("CircleShape2D_xb7vb")
|
shape = SubResource("CircleShape2D_xb7vb")
|
||||||
|
|
||||||
|
[node name="pickupsound" type="AudioStreamPlayer2D" parent="."]
|
||||||
|
stream = ExtResource("3_jrqru")
|
||||||
|
bus = &"SFX"
|
||||||
|
|
||||||
|
[node name="puckupanimation" type="AnimationPlayer" parent="."]
|
||||||
|
libraries = {
|
||||||
|
"": SubResource("AnimationLibrary_ln4ma")
|
||||||
|
}
|
||||||
|
|
||||||
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
||||||
|
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://c2oh5qgnw2i62"]
|
||||||
|
|
||||||
|
[ext_resource type="AudioStream" uid="uid://c7tnblkq60gu0" path="res://assets/music/time_for_adventure.mp3" id="1_v3xit"]
|
||||||
|
|
||||||
|
[node name="Music" type="AudioStreamPlayer2D"]
|
||||||
|
stream = ExtResource("1_v3xit")
|
||||||
|
autoplay = true
|
||||||
|
bus = &"Music"
|
@ -1,8 +1,9 @@
|
|||||||
extends Area2D
|
extends Area2D
|
||||||
|
|
||||||
@onready var game_manager: Node = %GameManager
|
@onready var game_manager: Node = %GameManager
|
||||||
|
@onready var puckupanimation: AnimationPlayer = $puckupanimation
|
||||||
|
|
||||||
|
|
||||||
func _on_body_entered(body: Node2D) -> void:
|
func _on_body_entered(body: Node2D) -> void:
|
||||||
game_manager.add_point()
|
game_manager.add_point()
|
||||||
queue_free()
|
puckupanimation.play("pickup")
|
||||||
|
Reference in New Issue
Block a user