Add dynamic audio and particle system for the campfire
@@ -4,12 +4,12 @@ importer="scene"
|
|||||||
importer_version=1
|
importer_version=1
|
||||||
type="PackedScene"
|
type="PackedScene"
|
||||||
uid="uid://ceovc780lyj1r"
|
uid="uid://ceovc780lyj1r"
|
||||||
path="res://.godot/imported/campfire.blend-1967172202db68012bf33114a0780a5f.scn"
|
path="res://.godot/imported/campfire.blend-0f4f394f7ed7f3b3e2d3c3ac81a19ebb.scn"
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://levels/lobby-scene/campfire.blend"
|
source_file="res://levels/lobby-scene/campfire/campfire.blend"
|
||||||
dest_files=["res://.godot/imported/campfire.blend-1967172202db68012bf33114a0780a5f.scn"]
|
dest_files=["res://.godot/imported/campfire.blend-0f4f394f7ed7f3b3e2d3c3ac81a19ebb.scn"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
22
splunk/levels/lobby-scene/campfire/campfire.gd
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
extends Node3D
|
||||||
|
|
||||||
|
@export var campfire_lit: bool = false
|
||||||
|
@export var fire_particles: GPUParticles3D
|
||||||
|
@export var smoke_particles: GPUParticles3D
|
||||||
|
@export var audio_stream_player_3d: AudioStreamPlayer3D
|
||||||
|
@export var sfx_files: Array[AudioStreamWAV] = []
|
||||||
|
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
audio_stream_player_3d.finished.connect(play_random_sfx)
|
||||||
|
play_random_sfx()
|
||||||
|
|
||||||
|
|
||||||
|
func light_campfire():
|
||||||
|
fire_particles.emitting = true
|
||||||
|
smoke_particles.emitting = true
|
||||||
|
|
||||||
|
|
||||||
|
func play_random_sfx():
|
||||||
|
audio_stream_player_3d.stream = sfx_files.pick_random()
|
||||||
|
audio_stream_player_3d.play()
|
||||||
1
splunk/levels/lobby-scene/campfire/campfire.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://mjtng3tgusx0
|
||||||
@@ -1,7 +1,9 @@
|
|||||||
[gd_scene load_steps=17 format=3 uid="uid://wcsd1tb0quj3"]
|
[gd_scene load_steps=19 format=3 uid="uid://wcsd1tb0quj3"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://ceovc780lyj1r" path="res://levels/lobby-scene/campfire.blend" id="1_5k61m"]
|
[ext_resource type="PackedScene" uid="uid://ceovc780lyj1r" path="res://levels/lobby-scene/campfire/campfire.blend" id="1_5k61m"]
|
||||||
[ext_resource type="Texture2D" uid="uid://ciegdylo5csyt" path="res://levels/lobby-scene/textures/smoke-particle-texture.png" id="2_4swet"]
|
[ext_resource type="Script" uid="uid://mjtng3tgusx0" path="res://levels/lobby-scene/campfire/campfire.gd" id="1_pgdjc"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://ciegdylo5csyt" path="res://levels/lobby-scene/campfire/textures/smoke-particle-texture.png" id="2_4swet"]
|
||||||
|
[ext_resource type="AudioStream" uid="uid://bx01sxorforuo" path="res://levels/lobby-scene/campfire/fire.wav" id="4_u2sse"]
|
||||||
|
|
||||||
[sub_resource type="Gradient" id="Gradient_5k61m"]
|
[sub_resource type="Gradient" id="Gradient_5k61m"]
|
||||||
offsets = PackedFloat32Array(0.175439, 0.859649)
|
offsets = PackedFloat32Array(0.175439, 0.859649)
|
||||||
@@ -107,7 +109,12 @@ particles_anim_loop = false
|
|||||||
[sub_resource type="QuadMesh" id="QuadMesh_8eekk"]
|
[sub_resource type="QuadMesh" id="QuadMesh_8eekk"]
|
||||||
material = SubResource("StandardMaterial3D_p40iq")
|
material = SubResource("StandardMaterial3D_p40iq")
|
||||||
|
|
||||||
[node name="Campfire" type="Node3D"]
|
[node name="Campfire" type="Node3D" node_paths=PackedStringArray("fire_particles", "smoke_particles", "audio_stream_player_3d")]
|
||||||
|
script = ExtResource("1_pgdjc")
|
||||||
|
fire_particles = NodePath("FireParticles")
|
||||||
|
smoke_particles = NodePath("SmokeParticles")
|
||||||
|
audio_stream_player_3d = NodePath("AudioStreamPlayer3D")
|
||||||
|
sfx_files = Array[AudioStreamWAV]([ExtResource("4_u2sse")])
|
||||||
|
|
||||||
[node name="campfire" parent="." instance=ExtResource("1_5k61m")]
|
[node name="campfire" parent="." instance=ExtResource("1_5k61m")]
|
||||||
|
|
||||||
@@ -130,3 +137,8 @@ randomness = 1.0
|
|||||||
draw_order = 3
|
draw_order = 3
|
||||||
process_material = SubResource("ParticleProcessMaterial_0feaq")
|
process_material = SubResource("ParticleProcessMaterial_0feaq")
|
||||||
draw_pass_1 = SubResource("QuadMesh_8eekk")
|
draw_pass_1 = SubResource("QuadMesh_8eekk")
|
||||||
|
|
||||||
|
[node name="AudioStreamPlayer3D" type="AudioStreamPlayer3D" parent="."]
|
||||||
|
stream = ExtResource("4_u2sse")
|
||||||
|
volume_db = -15.0
|
||||||
|
unit_size = 5.0
|
||||||
BIN
splunk/levels/lobby-scene/campfire/fire.wav
Normal file
24
splunk/levels/lobby-scene/campfire/fire.wav.import
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="wav"
|
||||||
|
type="AudioStreamWAV"
|
||||||
|
uid="uid://bx01sxorforuo"
|
||||||
|
path="res://.godot/imported/fire.wav-db183a1afec86c3f7b0347a0f68a8c78.sample"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://levels/lobby-scene/campfire/fire.wav"
|
||||||
|
dest_files=["res://.godot/imported/fire.wav-db183a1afec86c3f7b0347a0f68a8c78.sample"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
force/8_bit=false
|
||||||
|
force/mono=false
|
||||||
|
force/max_rate=false
|
||||||
|
force/max_rate_hz=44100
|
||||||
|
edit/trim=false
|
||||||
|
edit/normalize=false
|
||||||
|
edit/loop_mode=0
|
||||||
|
edit/loop_begin=0
|
||||||
|
edit/loop_end=-1
|
||||||
|
compress/mode=2
|
||||||
|
Before Width: | Height: | Size: 130 KiB After Width: | Height: | Size: 130 KiB |
@@ -3,7 +3,7 @@
|
|||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://bjlwlqwdnhyqa"
|
uid="uid://bjlwlqwdnhyqa"
|
||||||
path.s3tc="res://.godot/imported/ashes.png-68bd51854b6ac7814908f72d029da481.s3tc.ctex"
|
path.s3tc="res://.godot/imported/ashes.png-e3ed397e6960eee2c0384b2e7628d89b.s3tc.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"imported_formats": ["s3tc_bptc"],
|
"imported_formats": ["s3tc_bptc"],
|
||||||
"vram_texture": true
|
"vram_texture": true
|
||||||
@@ -11,8 +11,8 @@ metadata={
|
|||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://levels/lobby-scene/textures/ashes.png"
|
source_file="res://levels/lobby-scene/campfire/textures/ashes.png"
|
||||||
dest_files=["res://.godot/imported/ashes.png-68bd51854b6ac7814908f72d029da481.s3tc.ctex"]
|
dest_files=["res://.godot/imported/ashes.png-e3ed397e6960eee2c0384b2e7628d89b.s3tc.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 226 KiB After Width: | Height: | Size: 226 KiB |
@@ -3,7 +3,7 @@
|
|||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://mwhsj8t5w8u2"
|
uid="uid://mwhsj8t5w8u2"
|
||||||
path.s3tc="res://.godot/imported/log.png-d8f215f1df4e8376f24995e3581b30a1.s3tc.ctex"
|
path.s3tc="res://.godot/imported/log.png-dedb4a0d507c4374c4a0430aa0b04240.s3tc.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"imported_formats": ["s3tc_bptc"],
|
"imported_formats": ["s3tc_bptc"],
|
||||||
"vram_texture": true
|
"vram_texture": true
|
||||||
@@ -11,8 +11,8 @@ metadata={
|
|||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://levels/lobby-scene/textures/log.png"
|
source_file="res://levels/lobby-scene/campfire/textures/log.png"
|
||||||
dest_files=["res://.godot/imported/log.png-d8f215f1df4e8376f24995e3581b30a1.s3tc.ctex"]
|
dest_files=["res://.godot/imported/log.png-dedb4a0d507c4374c4a0430aa0b04240.s3tc.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 56 KiB |
@@ -3,7 +3,7 @@
|
|||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://ciegdylo5csyt"
|
uid="uid://ciegdylo5csyt"
|
||||||
path.s3tc="res://.godot/imported/smoke-particle-texture.png-a4ea0bec4b9e2e9d34ba16a5e9537d0b.s3tc.ctex"
|
path.s3tc="res://.godot/imported/smoke-particle-texture.png-a6c9ad64e49d68633ab3bfabe9f168c2.s3tc.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"imported_formats": ["s3tc_bptc"],
|
"imported_formats": ["s3tc_bptc"],
|
||||||
"vram_texture": true
|
"vram_texture": true
|
||||||
@@ -11,8 +11,8 @@ metadata={
|
|||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://levels/lobby-scene/textures/smoke-particle-texture.png"
|
source_file="res://levels/lobby-scene/campfire/textures/smoke-particle-texture.png"
|
||||||
dest_files=["res://.godot/imported/smoke-particle-texture.png-a4ea0bec4b9e2e9d34ba16a5e9537d0b.s3tc.ctex"]
|
dest_files=["res://.godot/imported/smoke-particle-texture.png-a6c9ad64e49d68633ab3bfabe9f168c2.s3tc.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 194 KiB After Width: | Height: | Size: 194 KiB |
@@ -3,7 +3,7 @@
|
|||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://cwwjn82mmy6oc"
|
uid="uid://cwwjn82mmy6oc"
|
||||||
path.s3tc="res://.godot/imported/stone.png-42fb815495c8c1b1d661e35d0a0319f0.s3tc.ctex"
|
path.s3tc="res://.godot/imported/stone.png-282edc18bd8fc87daf754e087f67344d.s3tc.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"imported_formats": ["s3tc_bptc"],
|
"imported_formats": ["s3tc_bptc"],
|
||||||
"vram_texture": true
|
"vram_texture": true
|
||||||
@@ -11,8 +11,8 @@ metadata={
|
|||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://levels/lobby-scene/textures/stone.png"
|
source_file="res://levels/lobby-scene/campfire/textures/stone.png"
|
||||||
dest_files=["res://.godot/imported/stone.png-42fb815495c8c1b1d661e35d0a0319f0.s3tc.ctex"]
|
dest_files=["res://.godot/imported/stone.png-282edc18bd8fc87daf754e087f67344d.s3tc.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
[ext_resource type="PackedScene" uid="uid://b5xb0fsfpn7r3" path="res://levels/lobby-scene/lobby-terrain.blend" id="3_f73ky"]
|
[ext_resource type="PackedScene" uid="uid://b5xb0fsfpn7r3" path="res://levels/lobby-scene/lobby-terrain.blend" id="3_f73ky"]
|
||||||
[ext_resource type="PackedScene" uid="uid://csmfxg011xisf" path="res://player/Player.tscn" id="4_0aw1h"]
|
[ext_resource type="PackedScene" uid="uid://csmfxg011xisf" path="res://player/Player.tscn" id="4_0aw1h"]
|
||||||
[ext_resource type="PackedScene" uid="uid://dgi81jdv7gs76" path="res://levels/lobby-scene/tent.blend" id="4_qjimh"]
|
[ext_resource type="PackedScene" uid="uid://dgi81jdv7gs76" path="res://levels/lobby-scene/tent.blend" id="4_qjimh"]
|
||||||
[ext_resource type="PackedScene" path="res://levels/lobby-scene/campfire.tscn" id="5_qjimh"]
|
[ext_resource type="PackedScene" uid="uid://wcsd1tb0quj3" path="res://levels/lobby-scene/campfire/campfire.tscn" id="5_qjimh"]
|
||||||
|
|
||||||
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_f73ky"]
|
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_f73ky"]
|
||||||
|
|
||||||
|
|||||||