diff --git a/builds/DauphinCraft-Server-v0.2.tar.gz b/builds/DauphinCraft-Server-v0.2.tar.gz new file mode 100644 index 0000000..bc7d464 Binary files /dev/null and b/builds/DauphinCraft-Server-v0.2.tar.gz differ diff --git a/builds/DauphinCraft.pck b/builds/DauphinCraft.pck index 78e5c01..aa44814 100644 Binary files a/builds/DauphinCraft.pck and b/builds/DauphinCraft.pck differ diff --git a/builds/DauphinCraftServer.x86_64 b/builds/DauphinCraftServer.x86_64 index ffec6d4..bb66cbe 100644 Binary files a/builds/DauphinCraftServer.x86_64 and b/builds/DauphinCraftServer.x86_64 differ diff --git a/scenes/Dolphin.tscn b/scenes/Dolphin.tscn index afeee3d..8e9a852 100644 --- a/scenes/Dolphin.tscn +++ b/scenes/Dolphin.tscn @@ -1,10 +1,11 @@ -[gd_scene load_steps=7 format=3 uid="uid://dolphin_main"] +[gd_scene load_steps=8 format=3 uid="uid://dolphin_main"] [ext_resource type="Script" path="res://scripts/dolphin/DolphinController.gd" id="1_controller"] [ext_resource type="Script" path="res://scripts/dolphin/HUD.gd" id="2_hud"] [ext_resource type="Script" path="res://scripts/dolphin/EcholocationPulse.gd" id="3_echo"] [ext_resource type="Script" path="res://scripts/dolphin/BubbleTrail.gd" id="4_bubble_trail"] [ext_resource type="Script" path="res://scripts/dolphin/DolphinMeshBuilder.gd" id="5_builder"] +[ext_resource type="Script" uid="uid://dyym376d03yto" path="res://scripts/ambience/GodraysOverlay.gd" id="6_godrays"] [sub_resource type="CapsuleShape3D" id="1_colshape"] radius = 0.35 @@ -36,6 +37,10 @@ rotation = Vector3(0, 3.14159, 0) [node name="Camera" type="Camera3D" parent="CameraPivot/SpringArm"] +[node name="GodraysOverlay" type="MeshInstance3D" parent="CameraPivot/SpringArm/Camera"] +position = Vector3(0, 0, -5) +script = ExtResource("6_godrays") + [node name="BubbleEmitterPoint" type="Node3D" parent="."] position = Vector3(0, 0, 1.2) diff --git a/scenes/Main.tscn b/scenes/Main.tscn index 7f81f11..04283e6 100644 --- a/scenes/Main.tscn +++ b/scenes/Main.tscn @@ -1,10 +1,13 @@ -[gd_scene load_steps=6 format=3 uid="uid://dauphincraft_main"] +[gd_scene load_steps=11 format=3 uid="uid://dauphincraft_main"] [ext_resource type="Script" path="res://scripts/Main.gd" id="1_mainscript"] [ext_resource type="Script" path="res://scripts/ambience/UnderwaterEnvironment.gd" id="2_uwenv"] [ext_resource type="PackedScene" path="res://scenes/World.tscn" id="3_world"] [ext_resource type="PackedScene" path="res://scenes/Dolphin.tscn" id="4_dolphin"] [ext_resource type="Script" path="res://scripts/ambience/PlanktonParticles.gd" id="5_plankton"] +[ext_resource type="PackedScene" uid="uid://dauphincraft_watersurface" path="res://scenes/WaterSurface.tscn" id="6_watersurface"] +[ext_resource type="Script" uid="uid://d1v40uwv1k73a" path="res://scripts/ambience/CausticsLayer.gd" id="7_caustics"] +[ext_resource type="Script" uid="uid://p4wxq06qavu4" path="res://scripts/ambience/BioluminescentParticles.gd" id="8_biolum"] [node name="Main" type="Node3D"] script = ExtResource("1_mainscript") @@ -23,7 +26,16 @@ shadow_enabled = true [node name="Dolphin" parent="." instance=ExtResource("4_dolphin")] position = Vector3(0, 55, 0) +[node name="WaterSurface" parent="." instance=ExtResource("6_watersurface")] +position = Vector3(0, 0, 0) + [node name="PlanktonFollower" type="Node3D" parent="."] [node name="PlanktonParticles" type="GPUParticles3D" parent="PlanktonFollower"] script = ExtResource("5_plankton") + +[node name="CausticsLayer" type="Node3D" parent="PlanktonFollower"] +script = ExtResource("7_caustics") + +[node name="BioluminescentParticles" type="GPUParticles3D" parent="PlanktonFollower"] +script = ExtResource("8_biolum") diff --git a/scripts/Main.gd b/scripts/Main.gd index f4b99f3..fb80c6a 100644 --- a/scripts/Main.gd +++ b/scripts/Main.gd @@ -203,8 +203,9 @@ func _unhandled_input(event: InputEvent) -> void: func _on_block_break(hit_position: Vector3, _normal: Vector3) -> void: + var broken_id: int = 0 if NetworkManager.is_solo(): - var broken_id: int = world.break_block(hit_position) + broken_id = world.break_block(hit_position) if broken_id > 0: inventory.add_item(broken_id, 1) AudioManager.play_bubble_sfx(hit_position) @@ -212,6 +213,16 @@ func _on_block_break(hit_position: Vector3, _normal: Vector3) -> void: _world_sync.server_break_block(hit_position) AudioManager.play_bubble_sfx(hit_position) + # Block break particle burst + var bbp_script := load("res://scripts/dolphin/BlockBreakParticles.gd") + var burst := GPUParticles3D.new() + burst.set_script(bbp_script) + add_child(burst) + var broken_color: Color = Color(0.8, 0.6, 0.3) # default sand + if broken_id > 0: + broken_color = BlockDatabase.get_color(broken_id) + burst.emit_burst(hit_position, broken_color) + func _on_block_place(hit_position: Vector3, normal: Vector3) -> void: var selected: Variant = inventory.get_selected_item()