basic twitch integration working well, many bugs
7
LICENSE.md
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
Copyright (c) 2023 - present Marcel Bankmann.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
9
addons/water_shader/World.gd
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
extends Node3D
|
||||
|
||||
@onready var CurrentFPS = $CurrentFPS
|
||||
|
||||
func _ready():
|
||||
Engine.max_fps = 60
|
||||
|
||||
func _process(delta):
|
||||
CurrentFPS.text = str(Engine.get_frames_per_second()) + "/" + str(Engine.max_fps)
|
||||
240
addons/water_shader/World.tscn
Normal file
|
|
@ -0,0 +1,240 @@
|
|||
[gd_scene load_steps=35 format=3 uid="uid://ck1h771dply0g"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/water_shader/scripts/Camera3D.gd" id="1_oowxb"]
|
||||
[ext_resource type="Script" path="res://addons/water_shader/World.gd" id="1_rau4y"]
|
||||
[ext_resource type="Shader" path="res://addons/water_shader/shaders/water.gdshader" id="2_6nog1"]
|
||||
[ext_resource type="Material" uid="uid://w0521xyotujb" path="res://addons/water_shader/standard_shaders/pink.tres" id="4_3d1xh"]
|
||||
[ext_resource type="Material" uid="uid://due1qpgfoidud" path="res://addons/water_shader/standard_shaders/green.tres" id="5_731fp"]
|
||||
[ext_resource type="Shader" path="res://addons/water_shader/shaders/bottom.gdshader" id="6_dtw72"]
|
||||
[ext_resource type="Material" uid="uid://khxhx4mnugb1" path="res://addons/water_shader/standard_shaders/yellow.tres" id="6_u1h6e"]
|
||||
[ext_resource type="PackedScene" uid="uid://durvbjhil7ec1" path="res://addons/water_shader/scenes/Pier.tscn" id="7_bj37i"]
|
||||
[ext_resource type="Texture2D" uid="uid://cmnmahdmhsq4h" path="res://addons/water_shader/assets/checker.png" id="8_56h6h"]
|
||||
|
||||
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_14kcx"]
|
||||
sky_top_color = Color(0.298039, 0.756863, 0.984314, 1)
|
||||
sky_horizon_color = Color(0.521569, 0.682353, 0.752941, 1)
|
||||
sky_curve = 0.261165
|
||||
ground_bottom_color = Color(0.156863, 0.356863, 0.717647, 1)
|
||||
ground_horizon_color = Color(0.109804, 0.411765, 0.556863, 1)
|
||||
sun_angle_max = 344.09
|
||||
sun_curve = 0.0137258
|
||||
|
||||
[sub_resource type="Sky" id="Sky_m3s1f"]
|
||||
sky_material = SubResource("ProceduralSkyMaterial_14kcx")
|
||||
process_mode = 1
|
||||
|
||||
[sub_resource type="Environment" id="Environment_nbsfo"]
|
||||
background_mode = 2
|
||||
sky = SubResource("Sky_m3s1f")
|
||||
ambient_light_source = 3
|
||||
ambient_light_color = Color(1, 1, 1, 1)
|
||||
fog_light_color = Color(0.0588235, 0.552941, 0.976471, 1)
|
||||
fog_light_energy = 0.51
|
||||
fog_density = 0.0
|
||||
fog_sky_affect = 0.0
|
||||
volumetric_fog_density = 0.0038
|
||||
volumetric_fog_albedo = Color(0.556863, 0.854902, 1, 1)
|
||||
volumetric_fog_anisotropy = 0.29
|
||||
volumetric_fog_length = 494.61
|
||||
|
||||
[sub_resource type="PlaneMesh" id="PlaneMesh_hnmyy"]
|
||||
size = Vector2(320, 320)
|
||||
subdivide_width = 1000
|
||||
subdivide_depth = 1000
|
||||
|
||||
[sub_resource type="FastNoiseLite" id="FastNoiseLite_8fje7"]
|
||||
|
||||
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_oh63k"]
|
||||
seamless = true
|
||||
as_normal_map = true
|
||||
noise = SubResource("FastNoiseLite_8fje7")
|
||||
|
||||
[sub_resource type="FastNoiseLite" id="FastNoiseLite_6i3b2"]
|
||||
noise_type = 0
|
||||
seed = 1
|
||||
|
||||
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_sr7nv"]
|
||||
seamless = true
|
||||
as_normal_map = true
|
||||
noise = SubResource("FastNoiseLite_6i3b2")
|
||||
|
||||
[sub_resource type="FastNoiseLite" id="FastNoiseLite_5edmb"]
|
||||
|
||||
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_dd0by"]
|
||||
seamless = true
|
||||
noise = SubResource("FastNoiseLite_5edmb")
|
||||
|
||||
[sub_resource type="FastNoiseLite" id="FastNoiseLite_vq7qh"]
|
||||
|
||||
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_xiypc"]
|
||||
seamless = true
|
||||
bump_strength = 28.3
|
||||
noise = SubResource("FastNoiseLite_vq7qh")
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_jsv1i"]
|
||||
render_priority = 0
|
||||
shader = ExtResource("2_6nog1")
|
||||
shader_parameter/albedo = Color(0.02, 0.45, 0.8, 1)
|
||||
shader_parameter/transparency = 0.4
|
||||
shader_parameter/metallic = 0.0
|
||||
shader_parameter/roughness = 0.5
|
||||
shader_parameter/surface_normals_move_direction_a = Vector2(-1, 0)
|
||||
shader_parameter/surface_normals_move_direction_b = Vector2(0, 1)
|
||||
shader_parameter/surface_texture_roughness = 0.6
|
||||
shader_parameter/surface_texture_scale = 0.3
|
||||
shader_parameter/surface_texture_time_scale = 0.06
|
||||
shader_parameter/ssr_resolution = 2.0
|
||||
shader_parameter/ssr_max_travel = 30.0
|
||||
shader_parameter/ssr_max_diff = 4.0
|
||||
shader_parameter/ssr_mix_strength = 0.7
|
||||
shader_parameter/wave_noise_scale = 15.0
|
||||
shader_parameter/wave_height_scale = 0.25
|
||||
shader_parameter/wave_time_scale = 0.025
|
||||
shader_parameter/wave_normal_flatness = 30.0
|
||||
shader_parameter/border_color = Color(1, 1, 1, 1)
|
||||
shader_parameter/border_scale = 2.0
|
||||
shader_parameter/border_near = 0.5
|
||||
shader_parameter/border_far = 300.0
|
||||
shader_parameter/refraction_intensity = 0.4
|
||||
shader_parameter/max_visible_depth = 10.0
|
||||
shader_parameter/color_deep = Color(0, 0.1, 0.4, 1)
|
||||
shader_parameter/wave_a = SubResource("NoiseTexture2D_dd0by")
|
||||
shader_parameter/wave_b = SubResource("NoiseTexture2D_xiypc")
|
||||
shader_parameter/surface_normals_a = SubResource("NoiseTexture2D_oh63k")
|
||||
shader_parameter/surface_normals_b = SubResource("NoiseTexture2D_sr7nv")
|
||||
|
||||
[sub_resource type="BoxMesh" id="BoxMesh_x3ff0"]
|
||||
size = Vector3(18, 0.1, 40)
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_rx107"]
|
||||
albedo_texture = ExtResource("8_56h6h")
|
||||
uv1_scale = Vector3(1.5, 3, 1)
|
||||
|
||||
[sub_resource type="BoxMesh" id="BoxMesh_21ju6"]
|
||||
size = Vector3(50, 1, 2)
|
||||
|
||||
[sub_resource type="SphereMesh" id="SphereMesh_0b3qk"]
|
||||
radius = 8.0
|
||||
height = 16.0
|
||||
|
||||
[sub_resource type="SphereMesh" id="SphereMesh_37lja"]
|
||||
radius = 5.0
|
||||
height = 10.0
|
||||
|
||||
[sub_resource type="SphereMesh" id="SphereMesh_un52x"]
|
||||
radius = 2.0
|
||||
height = 4.0
|
||||
|
||||
[sub_resource type="PlaneMesh" id="PlaneMesh_x888m"]
|
||||
size = Vector2(320, 320)
|
||||
subdivide_width = 200
|
||||
subdivide_depth = 200
|
||||
|
||||
[sub_resource type="FastNoiseLite" id="FastNoiseLite_8j0ft"]
|
||||
frequency = 0.0056
|
||||
|
||||
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_lawpj"]
|
||||
seamless = true
|
||||
noise = SubResource("FastNoiseLite_8j0ft")
|
||||
|
||||
[sub_resource type="FastNoiseLite" id="FastNoiseLite_65ep2"]
|
||||
noise_type = 4
|
||||
frequency = 0.5041
|
||||
|
||||
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_ko5xt"]
|
||||
width = 1024
|
||||
height = 1024
|
||||
seamless = true
|
||||
noise = SubResource("FastNoiseLite_65ep2")
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_y71r8"]
|
||||
render_priority = 0
|
||||
shader = ExtResource("6_dtw72")
|
||||
shader_parameter/height_scale = 70.0
|
||||
shader_parameter/uv_scale = 400.0
|
||||
shader_parameter/texture_scale = 20.0
|
||||
shader_parameter/stone_texture = SubResource("NoiseTexture2D_ko5xt")
|
||||
shader_parameter/bottom = SubResource("NoiseTexture2D_lawpj")
|
||||
|
||||
[node name="World" type="Node3D"]
|
||||
script = ExtResource("1_rau4y")
|
||||
|
||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
||||
environment = SubResource("Environment_nbsfo")
|
||||
|
||||
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
|
||||
transform = Transform3D(-0.864275, 0.42705, -0.265815, 0, 0.528438, 0.848972, 0.50302, 0.733745, -0.456716, -103.155, 28.088, -116.302)
|
||||
light_color = Color(1, 0.956863, 0.905882, 1)
|
||||
light_energy = 1.08
|
||||
shadow_enabled = true
|
||||
|
||||
[node name="Camera3D" type="Camera3D" parent="."]
|
||||
transform = Transform3D(-0.745476, 0.21039, -0.632457, 0, 0.948876, 0.315649, 0.666533, 0.235309, -0.707364, -129.747, 14.606, -113.29)
|
||||
script = ExtResource("1_oowxb")
|
||||
|
||||
[node name="WaterSurface" type="MeshInstance3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0266228, 0.112858, -0.0368958)
|
||||
mesh = SubResource("PlaneMesh_hnmyy")
|
||||
surface_material_override/0 = SubResource("ShaderMaterial_jsv1i")
|
||||
|
||||
[node name="scenery" type="Node3D" parent="."]
|
||||
|
||||
[node name="Chessboard" type="MeshInstance3D" parent="scenery"]
|
||||
transform = Transform3D(0.741616, -0.139773, 0.656101, -0.16291, 0.911247, 0.378272, -0.650742, -0.387418, 0.653025, -68.4752, -4.30671, -56.5773)
|
||||
mesh = SubResource("BoxMesh_x3ff0")
|
||||
skeleton = NodePath("../..")
|
||||
surface_material_override/0 = SubResource("StandardMaterial3D_rx107")
|
||||
|
||||
[node name="Pier" parent="scenery" instance=ExtResource("7_bj37i")]
|
||||
transform = Transform3D(-1.99631, 0, 0.121435, 0, 2, 0, -0.121435, 0, -1.99631, -42.0222, 4.60747, -76.6392)
|
||||
|
||||
[node name="boxes" type="Node3D" parent="scenery"]
|
||||
|
||||
[node name="Box1" type="MeshInstance3D" parent="scenery/boxes"]
|
||||
transform = Transform3D(0.57211, -0.456602, -0.681325, 0.636205, 0.771326, 0.0173053, 0.517622, -0.443363, 0.731776, -134.206, 4.05422, -77.1431)
|
||||
mesh = SubResource("BoxMesh_21ju6")
|
||||
skeleton = NodePath("../../..")
|
||||
surface_material_override/0 = ExtResource("4_3d1xh")
|
||||
|
||||
[node name="Box2" type="MeshInstance3D" parent="scenery/boxes"]
|
||||
transform = Transform3D(-0.735081, 0.599193, 0.317212, 0.636205, 0.771326, 0.0173053, -0.234305, 0.214533, -0.948197, -116.454, 4.05422, -77.1431)
|
||||
mesh = SubResource("BoxMesh_21ju6")
|
||||
skeleton = NodePath("../../..")
|
||||
surface_material_override/0 = ExtResource("5_731fp")
|
||||
|
||||
[node name="Box3" type="MeshInstance3D" parent="scenery/boxes"]
|
||||
transform = Transform3D(-0.434076, 0.376398, -0.818476, 0.636205, 0.771326, 0.0173053, 0.637825, -0.513207, -0.574281, -99.6248, 4.05422, -77.1431)
|
||||
mesh = SubResource("BoxMesh_21ju6")
|
||||
skeleton = NodePath("../../..")
|
||||
surface_material_override/0 = ExtResource("6_u1h6e")
|
||||
|
||||
[node name="spheres" type="Node3D" parent="scenery"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 14.0822, 0, 0)
|
||||
|
||||
[node name="Sphere1" type="MeshInstance3D" parent="scenery/spheres"]
|
||||
transform = Transform3D(1, -5.96046e-08, -3.57628e-07, -1.49012e-08, 1, 1.04308e-07, 1.19209e-07, -5.96046e-08, 1, -134.465, 18.4207, -48.0399)
|
||||
mesh = SubResource("SphereMesh_0b3qk")
|
||||
skeleton = NodePath("../../..")
|
||||
surface_material_override/0 = ExtResource("4_3d1xh")
|
||||
|
||||
[node name="Sphere2" type="MeshInstance3D" parent="scenery/spheres"]
|
||||
transform = Transform3D(1, -5.96046e-08, -3.57628e-07, -1.49012e-08, 1, 1.04308e-07, 1.19209e-07, -5.96046e-08, 1, -116.925, 8.32512, -48.0399)
|
||||
mesh = SubResource("SphereMesh_37lja")
|
||||
skeleton = NodePath("../../..")
|
||||
surface_material_override/0 = ExtResource("5_731fp")
|
||||
|
||||
[node name="Sphere3" type="MeshInstance3D" parent="scenery/spheres"]
|
||||
transform = Transform3D(1, -5.96046e-08, -3.57628e-07, -1.49012e-08, 1, 1.04308e-07, 1.19209e-07, -5.96046e-08, 1, -103.868, 0.811209, -48.0399)
|
||||
mesh = SubResource("SphereMesh_un52x")
|
||||
skeleton = NodePath("../../..")
|
||||
surface_material_override/0 = ExtResource("6_u1h6e")
|
||||
|
||||
[node name="Bottom" type="MeshInstance3D" parent="scenery"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 16.4921, -31.6516, 0)
|
||||
mesh = SubResource("PlaneMesh_x888m")
|
||||
skeleton = NodePath("")
|
||||
surface_material_override/0 = SubResource("ShaderMaterial_y71r8")
|
||||
|
||||
[node name="CurrentFPS" type="Label" parent="."]
|
||||
offset_right = 40.0
|
||||
offset_bottom = 23.0
|
||||
BIN
addons/water_shader/assets/checker.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
35
addons/water_shader/assets/checker.png.import
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cmnmahdmhsq4h"
|
||||
path.s3tc="res://.godot/imported/checker.png-dfadcbd934045345a664e1765c07315f.s3tc.ctex"
|
||||
metadata={
|
||||
"imported_formats": ["s3tc_bptc"],
|
||||
"vram_texture": true
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/water_shader/assets/checker.png"
|
||||
dest_files=["res://.godot/imported/checker.png-dfadcbd934045345a664e1765c07315f.s3tc.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=2
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=true
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=0
|
||||
158
addons/water_shader/scenes/Pier.tscn
Normal file
|
|
@ -0,0 +1,158 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://durvbjhil7ec1"]
|
||||
|
||||
[ext_resource type="Material" uid="uid://d4kuxhbpjjs3s" path="res://addons/water_shader/standard_shaders/simple_wood.tres" id="1_qq51a"]
|
||||
|
||||
[sub_resource type="BoxMesh" id="BoxMesh_rf2q6"]
|
||||
|
||||
[node name="Pier" type="Node3D"]
|
||||
|
||||
[node name="Board" type="MeshInstance3D" parent="."]
|
||||
transform = Transform3D(20, 0, 0, 0, 0.2, 0, 0, 0, 2, 0, 0, 0)
|
||||
mesh = SubResource("BoxMesh_rf2q6")
|
||||
surface_material_override/0 = ExtResource("1_qq51a")
|
||||
|
||||
[node name="columns" type="Node3D" parent="."]
|
||||
|
||||
[node name="Column1" type="MeshInstance3D" parent="columns"]
|
||||
transform = Transform3D(0.2, 0, 0, 0, 20, 0, 0, 0, 0.2, 2.319, -9.75468, 0.834839)
|
||||
mesh = SubResource("BoxMesh_rf2q6")
|
||||
skeleton = NodePath("../..")
|
||||
surface_material_override/0 = ExtResource("1_qq51a")
|
||||
|
||||
[node name="Column2" type="MeshInstance3D" parent="columns"]
|
||||
transform = Transform3D(0.2, 0, 0, 0, 20, 0, 0, 0, 0.2, 2.319, -9.75468, -0.797735)
|
||||
mesh = SubResource("BoxMesh_rf2q6")
|
||||
skeleton = NodePath("../..")
|
||||
surface_material_override/0 = ExtResource("1_qq51a")
|
||||
|
||||
[node name="Column3" type="MeshInstance3D" parent="columns"]
|
||||
transform = Transform3D(0.2, 0, 0, 0, 20, 0, 0, 0, 0.2, 0.0185528, -9.75468, 0.834839)
|
||||
mesh = SubResource("BoxMesh_rf2q6")
|
||||
skeleton = NodePath("../..")
|
||||
surface_material_override/0 = ExtResource("1_qq51a")
|
||||
|
||||
[node name="Column4" type="MeshInstance3D" parent="columns"]
|
||||
transform = Transform3D(0.2, 0, 0, 0, 20, 0, 0, 0, 0.2, 0.0185528, -9.75468, -0.797735)
|
||||
mesh = SubResource("BoxMesh_rf2q6")
|
||||
skeleton = NodePath("../..")
|
||||
surface_material_override/0 = ExtResource("1_qq51a")
|
||||
|
||||
[node name="Column5" type="MeshInstance3D" parent="columns"]
|
||||
transform = Transform3D(0.2, 0, 0, 0, 20, 0, 0, 0, 0.2, -1.68823, -9.75468, 0.834839)
|
||||
mesh = SubResource("BoxMesh_rf2q6")
|
||||
skeleton = NodePath("../..")
|
||||
surface_material_override/0 = ExtResource("1_qq51a")
|
||||
|
||||
[node name="Column6" type="MeshInstance3D" parent="columns"]
|
||||
transform = Transform3D(0.2, 0, 0, 0, 20, 0, 0, 0, 0.2, -1.68823, -9.75468, -0.797735)
|
||||
mesh = SubResource("BoxMesh_rf2q6")
|
||||
skeleton = NodePath("../..")
|
||||
surface_material_override/0 = ExtResource("1_qq51a")
|
||||
|
||||
[node name="Column7" type="MeshInstance3D" parent="columns"]
|
||||
transform = Transform3D(0.2, 0, 0, 0, 20, 0, 0, 0, 0.2, 9.68414, -9.75468, 0.834839)
|
||||
mesh = SubResource("BoxMesh_rf2q6")
|
||||
skeleton = NodePath("../..")
|
||||
surface_material_override/0 = ExtResource("1_qq51a")
|
||||
|
||||
[node name="Column8" type="MeshInstance3D" parent="columns"]
|
||||
transform = Transform3D(0.2, 0, 0, 0, 20, 0, 0, 0, 0.2, 9.68414, -9.75468, -0.797735)
|
||||
mesh = SubResource("BoxMesh_rf2q6")
|
||||
skeleton = NodePath("../..")
|
||||
surface_material_override/0 = ExtResource("1_qq51a")
|
||||
|
||||
[node name="Column9" type="MeshInstance3D" parent="columns"]
|
||||
transform = Transform3D(0.2, 0, 0, 0, 20, 0, 0, 0, 0.2, 7.38369, -9.75468, 0.834839)
|
||||
mesh = SubResource("BoxMesh_rf2q6")
|
||||
skeleton = NodePath("../..")
|
||||
surface_material_override/0 = ExtResource("1_qq51a")
|
||||
|
||||
[node name="Column10" type="MeshInstance3D" parent="columns"]
|
||||
transform = Transform3D(0.2, 0, 0, 0, 20, 0, 0, 0, 0.2, 7.38369, -9.75468, -0.797735)
|
||||
mesh = SubResource("BoxMesh_rf2q6")
|
||||
skeleton = NodePath("../..")
|
||||
surface_material_override/0 = ExtResource("1_qq51a")
|
||||
|
||||
[node name="Column11" type="MeshInstance3D" parent="columns"]
|
||||
transform = Transform3D(0.2, 0, 0, 0, 20, 0, 0, 0, 0.2, 5.67691, -9.75468, 0.834839)
|
||||
mesh = SubResource("BoxMesh_rf2q6")
|
||||
skeleton = NodePath("../..")
|
||||
surface_material_override/0 = ExtResource("1_qq51a")
|
||||
|
||||
[node name="Column12" type="MeshInstance3D" parent="columns"]
|
||||
transform = Transform3D(0.2, 0, 0, 0, 20, 0, 0, 0, 0.2, 5.67691, -9.75468, -0.797735)
|
||||
mesh = SubResource("BoxMesh_rf2q6")
|
||||
skeleton = NodePath("../..")
|
||||
surface_material_override/0 = ExtResource("1_qq51a")
|
||||
|
||||
[node name="Column13" type="MeshInstance3D" parent="columns"]
|
||||
transform = Transform3D(0.2, 0, 0, 0, 20, 0, 0, 0, 0.2, 5.08325, -9.75468, 0.834839)
|
||||
mesh = SubResource("BoxMesh_rf2q6")
|
||||
skeleton = NodePath("../..")
|
||||
surface_material_override/0 = ExtResource("1_qq51a")
|
||||
|
||||
[node name="Column14" type="MeshInstance3D" parent="columns"]
|
||||
transform = Transform3D(0.2, 0, 0, 0, 20, 0, 0, 0, 0.2, 5.08325, -9.75468, -0.797735)
|
||||
mesh = SubResource("BoxMesh_rf2q6")
|
||||
skeleton = NodePath("../..")
|
||||
surface_material_override/0 = ExtResource("1_qq51a")
|
||||
|
||||
[node name="Column15" type="MeshInstance3D" parent="columns"]
|
||||
transform = Transform3D(0.2, 0, 0, 0, 20, 0, 0, 0, 0.2, 2.7828, -9.75468, 0.834839)
|
||||
mesh = SubResource("BoxMesh_rf2q6")
|
||||
skeleton = NodePath("../..")
|
||||
surface_material_override/0 = ExtResource("1_qq51a")
|
||||
|
||||
[node name="Column16" type="MeshInstance3D" parent="columns"]
|
||||
transform = Transform3D(0.2, 0, 0, 0, 20, 0, 0, 0, 0.2, 2.7828, -9.75468, -0.797735)
|
||||
mesh = SubResource("BoxMesh_rf2q6")
|
||||
skeleton = NodePath("../..")
|
||||
surface_material_override/0 = ExtResource("1_qq51a")
|
||||
|
||||
[node name="Column17" type="MeshInstance3D" parent="columns"]
|
||||
transform = Transform3D(0.2, 0, 0, 0, 20, 0, 0, 0, 0.2, 1.07602, -9.75468, 0.834839)
|
||||
mesh = SubResource("BoxMesh_rf2q6")
|
||||
skeleton = NodePath("../..")
|
||||
surface_material_override/0 = ExtResource("1_qq51a")
|
||||
|
||||
[node name="Column18" type="MeshInstance3D" parent="columns"]
|
||||
transform = Transform3D(0.2, 0, 0, 0, 20, 0, 0, 0, 0.2, 1.07602, -9.75468, -0.797735)
|
||||
mesh = SubResource("BoxMesh_rf2q6")
|
||||
skeleton = NodePath("../..")
|
||||
surface_material_override/0 = ExtResource("1_qq51a")
|
||||
|
||||
[node name="Column19" type="MeshInstance3D" parent="columns"]
|
||||
transform = Transform3D(0.2, 0, 0, 0, 20, 0, 0, 0, 0.2, -1.81878, -9.75468, 0.834839)
|
||||
mesh = SubResource("BoxMesh_rf2q6")
|
||||
skeleton = NodePath("../..")
|
||||
surface_material_override/0 = ExtResource("1_qq51a")
|
||||
|
||||
[node name="Column20" type="MeshInstance3D" parent="columns"]
|
||||
transform = Transform3D(0.2, 0, 0, 0, 20, 0, 0, 0, 0.2, -1.81878, -9.75468, -0.797735)
|
||||
mesh = SubResource("BoxMesh_rf2q6")
|
||||
skeleton = NodePath("../..")
|
||||
surface_material_override/0 = ExtResource("1_qq51a")
|
||||
|
||||
[node name="Column21" type="MeshInstance3D" parent="columns"]
|
||||
transform = Transform3D(0.2, 0, 0, 0, 20, 0, 0, 0, 0.2, -4.11923, -9.75468, 0.834839)
|
||||
mesh = SubResource("BoxMesh_rf2q6")
|
||||
skeleton = NodePath("../..")
|
||||
surface_material_override/0 = ExtResource("1_qq51a")
|
||||
|
||||
[node name="Column22" type="MeshInstance3D" parent="columns"]
|
||||
transform = Transform3D(0.2, 0, 0, 0, 20, 0, 0, 0, 0.2, -4.11923, -9.75468, -0.797735)
|
||||
mesh = SubResource("BoxMesh_rf2q6")
|
||||
skeleton = NodePath("../..")
|
||||
surface_material_override/0 = ExtResource("1_qq51a")
|
||||
|
||||
[node name="Column23" type="MeshInstance3D" parent="columns"]
|
||||
transform = Transform3D(0.2, 0, 0, 0, 20, 0, 0, 0, 0.2, -5.82601, -9.75468, 0.834839)
|
||||
mesh = SubResource("BoxMesh_rf2q6")
|
||||
skeleton = NodePath("../..")
|
||||
surface_material_override/0 = ExtResource("1_qq51a")
|
||||
|
||||
[node name="Column24" type="MeshInstance3D" parent="columns"]
|
||||
transform = Transform3D(0.2, 0, 0, 0, 20, 0, 0, 0, 0.2, -5.82601, -9.75468, -0.797735)
|
||||
mesh = SubResource("BoxMesh_rf2q6")
|
||||
skeleton = NodePath("../..")
|
||||
surface_material_override/0 = ExtResource("1_qq51a")
|
||||
BIN
addons/water_shader/screenshot.png
Normal file
|
After Width: | Height: | Size: 963 KiB |
34
addons/water_shader/screenshot.png.import
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://veppxde6vbmj"
|
||||
path="res://.godot/imported/screenshot.png-eb5441e2a330131fa77d1b127416a799.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/water_shader/screenshot.png"
|
||||
dest_files=["res://.godot/imported/screenshot.png-eb5441e2a330131fa77d1b127416a799.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
56
addons/water_shader/scripts/Camera3D.gd
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
#Copyright © 2022 Marc Nahr: https://github.com/MarcPhi/godot-free-look-camera
|
||||
extends Camera3D
|
||||
|
||||
@export_range(0, 10, 0.01) var sensitivity : float = 3
|
||||
@export_range(0, 1000, 0.1) var default_velocity : float = 5
|
||||
@export_range(0, 10, 0.01) var speed_scale : float = 1.17
|
||||
@export_range(1, 100, 0.1) var boost_speed_multiplier : float = 3.0
|
||||
@export var max_speed : float = 1000
|
||||
@export var min_speed : float = 0.2
|
||||
|
||||
@onready var _velocity = default_velocity
|
||||
|
||||
func _input(event):
|
||||
if not current:
|
||||
return
|
||||
|
||||
if Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED:
|
||||
if event is InputEventMouseMotion:
|
||||
rotation.y -= event.relative.x / 1000 * sensitivity
|
||||
rotation.x -= event.relative.y / 1000 * sensitivity
|
||||
rotation.x = clamp(rotation.x, PI/-2, PI/2)
|
||||
|
||||
if event is InputEventMouseButton:
|
||||
match event.button_index:
|
||||
MOUSE_BUTTON_RIGHT:
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED if event.pressed else Input.MOUSE_MODE_VISIBLE)
|
||||
MOUSE_BUTTON_WHEEL_UP: # increase fly velocity
|
||||
_velocity = clamp(_velocity * speed_scale, min_speed, max_speed)
|
||||
MOUSE_BUTTON_WHEEL_DOWN: # decrease fly velocity
|
||||
_velocity = clamp(_velocity / speed_scale, min_speed, max_speed)
|
||||
|
||||
func _process(delta):
|
||||
if not current:
|
||||
return
|
||||
|
||||
var direction = Vector3(
|
||||
float(Input.is_action_pressed("right")) - float(Input.is_action_pressed("left")),
|
||||
float(Input.is_action_pressed("down")) - float(Input.is_action_pressed("up")),
|
||||
float(Input.is_action_pressed("backward")) - float(Input.is_action_pressed("forward"))
|
||||
).normalized()
|
||||
|
||||
if Input.is_action_pressed("boost"):
|
||||
translate(direction * _velocity * delta * boost_speed_multiplier)
|
||||
else:
|
||||
translate(direction * _velocity * delta)
|
||||
|
||||
var rotation_input = Vector2(
|
||||
float(Input.is_action_pressed("rotate_down")) - float(Input.is_action_pressed("rotate_up")),
|
||||
float(Input.is_action_pressed("rotate_right")) - float(Input.is_action_pressed("rotate_left"))
|
||||
).normalized()
|
||||
|
||||
if (rotation_input.length() > 0.0):
|
||||
rotation.y -= rotation_input.y / 300 * sensitivity
|
||||
rotation.x -= rotation_input.x / 300 * sensitivity
|
||||
rotation.x = clamp(rotation.x, PI/-2, PI/2)
|
||||
|
||||
39
addons/water_shader/shaders/bottom.gdshader
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
shader_type spatial;
|
||||
|
||||
uniform float height_scale = 50.0;
|
||||
uniform float uv_scale = 400.0;
|
||||
uniform float texture_scale = 20.0;
|
||||
|
||||
uniform sampler2D stone_texture;
|
||||
uniform sampler2D bottom;
|
||||
|
||||
varying vec2 uv;
|
||||
varying float height;
|
||||
|
||||
void vertex()
|
||||
{
|
||||
uv = VERTEX.xz / uv_scale;
|
||||
height = texture(bottom, uv).x * height_scale;
|
||||
VERTEX.y += height;
|
||||
|
||||
vec2 e = vec2(0.01, 0.0);
|
||||
vec3 normal = normalize(vec3(
|
||||
texture(bottom, uv - e).x * height_scale - texture(bottom, uv + e).x * height_scale,
|
||||
2.0 * e.x,
|
||||
texture(bottom, uv - e.yx).x * height_scale - texture(bottom, uv + e.yx).x * height_scale
|
||||
));
|
||||
NORMAL = normal;
|
||||
}
|
||||
|
||||
float normalize_float(float value, float min_v, float max_v) {
|
||||
float clamped_value = clamp(value, min_v, max_v);
|
||||
return (clamped_value - min_v) / (max_v - min_v);
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
float greens = normalize_float(height, 30.0, 60.0);
|
||||
ALBEDO.rgb = texture(stone_texture, uv * texture_scale).rgb * vec3(0.2, greens, 0.0);
|
||||
|
||||
METALLIC = .5;
|
||||
ROUGHNESS = .7;
|
||||
}
|
||||
162
addons/water_shader/shaders/water.gdshader
Normal file
|
|
@ -0,0 +1,162 @@
|
|||
shader_type spatial;
|
||||
|
||||
uniform sampler2D SCREEN_TEXTURE : hint_screen_texture, filter_nearest;
|
||||
uniform sampler2D DEPTH_TEXTURE : hint_depth_texture, filter_nearest;
|
||||
|
||||
uniform vec3 albedo : source_color = vec3(0.02, 0.45, 0.8);
|
||||
uniform float transparency : hint_range(0.0, 1.0, 0.01) = 0.4;
|
||||
uniform float metallic : hint_range(0.0, 1.0, 0.01) = 0;
|
||||
uniform float roughness : hint_range(0.0, 1.0, 0.01) = 0.5;
|
||||
|
||||
uniform vec2 surface_normals_move_direction_a = vec2(-1.0, 0.0);
|
||||
uniform vec2 surface_normals_move_direction_b = vec2(0.0, 1.0);
|
||||
uniform float surface_texture_roughness : hint_range(0.0, 1.0, 0.01) = 0.6;
|
||||
uniform float surface_texture_scale : hint_range(0.001, 2.0, 0.001) = 0.3;
|
||||
uniform float surface_texture_time_scale : hint_range(0.001, 2.0, 0.001) = 0.06;
|
||||
|
||||
uniform float ssr_resolution : hint_range(0.0, 10.0, 0.1) = 2.0;
|
||||
uniform float ssr_max_travel : hint_range(0.0, 200.0, 0.1) = 30.0;
|
||||
uniform float ssr_max_diff : hint_range(0.1, 10.0, 0.1) = 4.0;
|
||||
uniform float ssr_mix_strength : hint_range(0.0, 1.0, 0.01) = 0.7;
|
||||
|
||||
uniform float wave_noise_scale = 15.0;
|
||||
uniform float wave_height_scale = 0.25;
|
||||
uniform float wave_time_scale = 0.025;
|
||||
uniform float wave_normal_flatness : hint_range(0.1, 100.0, 0.1) = 30.0;
|
||||
|
||||
uniform vec3 border_color : source_color = vec3(1.0);
|
||||
uniform float border_scale : hint_range(0.0, 5.0, 0.01) = 2.0;
|
||||
uniform float border_near = 0.5;
|
||||
uniform float border_far = 300.0;
|
||||
|
||||
uniform float refraction_intensity : hint_range(0.0, 1.0, 0.01) = 0.4;
|
||||
|
||||
uniform float max_visible_depth : hint_range(0.0, 100.0, 0.1) = 10.0;
|
||||
uniform vec3 color_deep : source_color = vec3(0.0, 0.1, 0.4);
|
||||
|
||||
uniform sampler2D wave_a;
|
||||
uniform sampler2D wave_b;
|
||||
|
||||
uniform sampler2D surface_normals_a;
|
||||
uniform sampler2D surface_normals_b;
|
||||
|
||||
varying vec2 vertex_uv;
|
||||
|
||||
float get_wave_height(vec2 uv)
|
||||
{
|
||||
float height1 = texture(wave_a, uv).r;
|
||||
float height2 = texture(wave_b, -uv * vec2(-1.0, -1.0)).r;
|
||||
return (height1 + height2 * 2.0) / 2.0;
|
||||
}
|
||||
|
||||
void vertex()
|
||||
{
|
||||
vertex_uv = (MODEL_MATRIX * vec4(VERTEX, 1.0)).xz;
|
||||
vec2 uv = vertex_uv / wave_noise_scale + TIME * wave_time_scale;
|
||||
VERTEX.y += get_wave_height(uv) * wave_height_scale;
|
||||
|
||||
float normal_height_scale = wave_height_scale / wave_normal_flatness;
|
||||
vec2 e = vec2(0.01, 0.0);
|
||||
vec3 normal = normalize(vec3(
|
||||
get_wave_height(uv - e) * normal_height_scale - get_wave_height(uv + e) * normal_height_scale,
|
||||
2.0 * e.x,
|
||||
get_wave_height(uv - e.yx) * normal_height_scale - get_wave_height(uv + e.yx) * normal_height_scale
|
||||
));
|
||||
NORMAL = normal;
|
||||
}
|
||||
|
||||
bool is_within_screen_boundaries(vec2 position) {
|
||||
return position.x > 0.0 && position.x < 1.0 && position.y > 0.0 && position.y < 1.0;
|
||||
}
|
||||
|
||||
vec2 get_uv_from_view_position(vec3 position_view_space, mat4 proj_m)
|
||||
{
|
||||
vec4 position_clip_space = proj_m * vec4(position_view_space.xyz, 1.0);
|
||||
vec2 position_ndc = position_clip_space.xy / position_clip_space.w;
|
||||
return position_ndc.xy * 0.5 + 0.5;
|
||||
}
|
||||
|
||||
vec3 get_view_position_from_uv(vec2 uv, float depth, mat4 inv_proj_m)
|
||||
{
|
||||
vec4 position_ndc = vec4((uv * 2.0) - 1.0, depth, 1.0);
|
||||
vec4 view_position = inv_proj_m * position_ndc;
|
||||
return view_position.xyz /= view_position.w;
|
||||
}
|
||||
|
||||
vec3 get_ssr_color(vec3 surface_view_position, vec3 normal_view_space, vec3 view_view_space, mat4 proj_m, mat4 inv_proj_m)
|
||||
{
|
||||
vec3 current_position_view_space = surface_view_position;
|
||||
vec3 view_direction_view_space = view_view_space * -1.0;
|
||||
vec3 reflect_vector_view_space = normalize(reflect(view_direction_view_space.xyz, normal_view_space.xyz));
|
||||
|
||||
vec2 current_screen_position = vec2(0.0);
|
||||
|
||||
vec3 resulting_color = vec3(-1.0);
|
||||
for(float travel=0.0; resulting_color.x < 0.0 && travel < ssr_max_travel; travel = travel + ssr_resolution)
|
||||
{
|
||||
current_position_view_space += reflect_vector_view_space * ssr_resolution;
|
||||
current_screen_position = get_uv_from_view_position(current_position_view_space, proj_m);
|
||||
|
||||
float depth_texture_probe_raw = texture(DEPTH_TEXTURE, current_screen_position).x;
|
||||
vec3 depth_texture_probe_view_position = get_view_position_from_uv(current_screen_position, depth_texture_probe_raw, inv_proj_m);
|
||||
|
||||
float depth_diff = depth_texture_probe_view_position.z - current_position_view_space.z;
|
||||
|
||||
resulting_color = (is_within_screen_boundaries(current_screen_position) && depth_diff >= 0.0 && depth_diff < ssr_max_diff) ? texture(SCREEN_TEXTURE, current_screen_position.xy).rgb : vec3(-1.0);
|
||||
}
|
||||
return resulting_color;
|
||||
}
|
||||
|
||||
float border(float cur_depth)
|
||||
{
|
||||
return border_near * border_far / (border_far + (2.0 * cur_depth - 1.0) * (border_near - border_far));
|
||||
}
|
||||
|
||||
float normalize_float(float min_v, float max_v, float value) {
|
||||
float clamped_value = clamp(value, min_v, max_v);
|
||||
return (clamped_value - min_v) / (max_v - min_v);
|
||||
}
|
||||
|
||||
vec2 get_refracted_uv(vec2 raw_screen_uv, float screen_depth_raw, vec3 view, vec3 normal, mat4 proj_m, mat4 inv_proj_m)
|
||||
{
|
||||
vec3 screen_view_position_original = get_view_position_from_uv(raw_screen_uv, screen_depth_raw, inv_proj_m);
|
||||
float screen_center_distance = clamp(abs(length(raw_screen_uv - vec2(0.5, 0.5))) * 2.0, 0.0, 1.0);
|
||||
float refraction_intensity_deglitched = mix(1.0 - refraction_intensity, 1.0, screen_center_distance);
|
||||
vec3 refraction_position_view_space = screen_view_position_original + normalize(refract(view, -normal, refraction_intensity_deglitched));
|
||||
vec2 refraction_uv = get_uv_from_view_position(refraction_position_view_space, proj_m);
|
||||
return refraction_uv;
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
float screen_depth_raw = texture(DEPTH_TEXTURE, SCREEN_UV).x;
|
||||
|
||||
vec2 refraction_uv = refraction_intensity > 0.0 ? get_refracted_uv(SCREEN_UV, screen_depth_raw, VIEW, NORMAL, PROJECTION_MATRIX, INV_PROJECTION_MATRIX) : SCREEN_UV;
|
||||
|
||||
float screen_depth = texture(DEPTH_TEXTURE, refraction_uv).x;
|
||||
float surface_depth = FRAGCOORD.z;
|
||||
|
||||
float border_diff = border(screen_depth_raw) - border(surface_depth);
|
||||
|
||||
vec2 time_vector = (TIME * surface_normals_move_direction_a) * surface_texture_time_scale;
|
||||
vec2 time_vector2 = (TIME * surface_normals_move_direction_b) * surface_texture_time_scale;
|
||||
|
||||
vec3 normal_texture_blend = mix(texture(surface_normals_a, vertex_uv * surface_texture_scale + time_vector).xyz, texture(surface_normals_b, vertex_uv * surface_texture_scale + time_vector2).xyz, 0.5);
|
||||
vec3 normal_blend = mix(NORMAL, normal_texture_blend, surface_texture_roughness);
|
||||
|
||||
vec3 screen_view_position = get_view_position_from_uv(refraction_uv, screen_depth, INV_PROJECTION_MATRIX);
|
||||
vec3 surface_view_position = get_view_position_from_uv(refraction_uv, surface_depth, INV_PROJECTION_MATRIX);
|
||||
float depth_opacity = 1.0 - normalize_float(0.0, max_visible_depth, length(surface_view_position - screen_view_position));
|
||||
|
||||
vec3 screen_color = texture(SCREEN_TEXTURE, refraction_uv).rgb;
|
||||
vec3 surface_color = albedo;
|
||||
vec3 ssr_color = get_ssr_color(surface_view_position, NORMAL, VIEW, PROJECTION_MATRIX, INV_PROJECTION_MATRIX);
|
||||
vec3 color_with_transparency = mix(surface_color, screen_color, transparency);
|
||||
vec3 depth_color = mix(color_deep.rgb, color_with_transparency, depth_opacity);
|
||||
vec3 water_color = (ssr_color.x > 0.0) ? mix(depth_color, ssr_color, ssr_mix_strength) : depth_color;
|
||||
vec3 final_color = mix(border_color, water_color, step(border_scale, border_diff));
|
||||
|
||||
ALBEDO.rgb = final_color;
|
||||
METALLIC = metallic;
|
||||
ROUGHNESS = roughness;
|
||||
NORMAL_MAP = normal_blend;
|
||||
}
|
||||
4
addons/water_shader/standard_shaders/green.tres
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
[gd_resource type="StandardMaterial3D" format=3 uid="uid://due1qpgfoidud"]
|
||||
|
||||
[resource]
|
||||
albedo_color = Color(0, 0.752941, 0.196078, 1)
|
||||
4
addons/water_shader/standard_shaders/pink.tres
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
[gd_resource type="StandardMaterial3D" format=3 uid="uid://w0521xyotujb"]
|
||||
|
||||
[resource]
|
||||
albedo_color = Color(1, 0, 1, 1)
|
||||
14
addons/water_shader/standard_shaders/simple_wood.tres
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
[gd_resource type="StandardMaterial3D" load_steps=3 format=3 uid="uid://d4kuxhbpjjs3s"]
|
||||
|
||||
[sub_resource type="FastNoiseLite" id="FastNoiseLite_4rnsn"]
|
||||
|
||||
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_dv33a"]
|
||||
as_normal_map = true
|
||||
noise = SubResource("FastNoiseLite_4rnsn")
|
||||
|
||||
[resource]
|
||||
albedo_color = Color(0.25098, 0.2, 0.0431373, 1)
|
||||
metallic_specular = 0.0
|
||||
roughness = 0.0
|
||||
normal_enabled = true
|
||||
normal_texture = SubResource("NoiseTexture2D_dv33a")
|
||||
4
addons/water_shader/standard_shaders/yellow.tres
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
[gd_resource type="StandardMaterial3D" format=3 uid="uid://khxhx4mnugb1"]
|
||||
|
||||
[resource]
|
||||
albedo_color = Color(1, 1, 0, 1)
|
||||
|
|
@ -1,9 +1,178 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://bdtfounpnyaoo"]
|
||||
[gd_scene load_steps=22 format=3 uid="uid://bdtfounpnyaoo"]
|
||||
|
||||
[ext_resource type="Script" path="res://twitch/jengacommands.gd" id="1_so2ke"]
|
||||
[ext_resource type="Script" path="res://scripts/JengaManager.gd" id="1_xtpjd"]
|
||||
[ext_resource type="Shader" path="res://addons/water_shader/shaders/water.gdshader" id="2_rliwp"]
|
||||
[ext_resource type="Material" uid="uid://bwrsgjub33pd4" path="res://materials/BaseMaterial.tres" id="2_txp0l"]
|
||||
[ext_resource type="Material" uid="uid://bfl54pvxyctrd" path="res://materials/BlockMaterial.tres" id="2_wr2cl"]
|
||||
[ext_resource type="Script" path="res://scripts/PlayerHand.gd" id="4_kq4yo"]
|
||||
|
||||
[node name="Jenga" type="Node3D"]
|
||||
[sub_resource type="Environment" id="Environment_h6sx5"]
|
||||
ambient_light_color = Color(1, 1, 1, 1)
|
||||
fog_light_color = Color(1, 1, 0.972549, 1)
|
||||
volumetric_fog_enabled = true
|
||||
volumetric_fog_density = 0.0581
|
||||
volumetric_fog_emission = Color(0.65098, 1, 0.909804, 1)
|
||||
|
||||
[node name="Gift" type="Node" parent="."]
|
||||
[sub_resource type="CameraAttributesPractical" id="CameraAttributesPractical_10wpe"]
|
||||
|
||||
[sub_resource type="PlaneMesh" id="PlaneMesh_kyck2"]
|
||||
size = Vector2(320, 320)
|
||||
subdivide_width = 1000
|
||||
subdivide_depth = 1000
|
||||
|
||||
[sub_resource type="FastNoiseLite" id="FastNoiseLite_bxq8s"]
|
||||
|
||||
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_ptjyb"]
|
||||
seamless = true
|
||||
as_normal_map = true
|
||||
noise = SubResource("FastNoiseLite_bxq8s")
|
||||
|
||||
[sub_resource type="FastNoiseLite" id="FastNoiseLite_rwake"]
|
||||
noise_type = 0
|
||||
seed = 1
|
||||
|
||||
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_r4a3k"]
|
||||
seamless = true
|
||||
as_normal_map = true
|
||||
noise = SubResource("FastNoiseLite_rwake")
|
||||
|
||||
[sub_resource type="FastNoiseLite" id="FastNoiseLite_e2hq3"]
|
||||
|
||||
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_qdptp"]
|
||||
seamless = true
|
||||
noise = SubResource("FastNoiseLite_e2hq3")
|
||||
|
||||
[sub_resource type="FastNoiseLite" id="FastNoiseLite_elfch"]
|
||||
|
||||
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_2unhc"]
|
||||
seamless = true
|
||||
bump_strength = 28.3
|
||||
noise = SubResource("FastNoiseLite_elfch")
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_avbpb"]
|
||||
render_priority = 0
|
||||
shader = ExtResource("2_rliwp")
|
||||
shader_parameter/albedo = Color(0, 0.717647, 0.803922, 1)
|
||||
shader_parameter/transparency = 0.55
|
||||
shader_parameter/metallic = 0.0
|
||||
shader_parameter/roughness = 0.5
|
||||
shader_parameter/surface_normals_move_direction_a = Vector2(-1, 0)
|
||||
shader_parameter/surface_normals_move_direction_b = Vector2(0, 1)
|
||||
shader_parameter/surface_texture_roughness = 0.6
|
||||
shader_parameter/surface_texture_scale = 0.3
|
||||
shader_parameter/surface_texture_time_scale = 0.06
|
||||
shader_parameter/ssr_resolution = 2.0
|
||||
shader_parameter/ssr_max_travel = 30.0
|
||||
shader_parameter/ssr_max_diff = 4.0
|
||||
shader_parameter/ssr_mix_strength = 0.7
|
||||
shader_parameter/wave_noise_scale = 15.0
|
||||
shader_parameter/wave_height_scale = 0.25
|
||||
shader_parameter/wave_time_scale = 0.025
|
||||
shader_parameter/wave_normal_flatness = 30.0
|
||||
shader_parameter/border_color = Color(1, 1, 1, 1)
|
||||
shader_parameter/border_scale = 0.78
|
||||
shader_parameter/border_near = 0.5
|
||||
shader_parameter/border_far = 300.0
|
||||
shader_parameter/refraction_intensity = 0.4
|
||||
shader_parameter/max_visible_depth = 10.0
|
||||
shader_parameter/color_deep = Color(0, 0.709804, 0.776471, 1)
|
||||
shader_parameter/wave_a = SubResource("NoiseTexture2D_qdptp")
|
||||
shader_parameter/wave_b = SubResource("NoiseTexture2D_2unhc")
|
||||
shader_parameter/surface_normals_a = SubResource("NoiseTexture2D_ptjyb")
|
||||
shader_parameter/surface_normals_b = SubResource("NoiseTexture2D_r4a3k")
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_y33cj"]
|
||||
size = Vector3(1, 0.59, 3)
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_gmpx6"]
|
||||
size = Vector3(1, 10, 3)
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_y2xp5"]
|
||||
font_color = Color(0, 0, 0, 1)
|
||||
|
||||
[node name="Jenga" type="Node3D" node_paths=PackedStringArray("debug_ui_label")]
|
||||
script = ExtResource("1_xtpjd")
|
||||
debug_ui_label = NodePath("UserInterface/DebugStuff")
|
||||
|
||||
[node name="TwitchLink" type="Node" parent="." node_paths=PackedStringArray("jenga_manager")]
|
||||
script = ExtResource("1_so2ke")
|
||||
jenga_manager = NodePath("..")
|
||||
scopes = Array[String](["chat:edit", "chat:read", "moderator:read:followers"])
|
||||
|
||||
[node name="CameraPivot" type="Node3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3.445, 0)
|
||||
|
||||
[node name="Camera3D" type="Camera3D" parent="CameraPivot"]
|
||||
transform = Transform3D(1, 0, 0, 0, 0.819152, 0.573576, 0, -0.573576, 0.819152, 0, 0, 4.12)
|
||||
|
||||
[node name="Environment" type="Node3D" parent="."]
|
||||
|
||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="Environment"]
|
||||
environment = SubResource("Environment_h6sx5")
|
||||
camera_attributes = SubResource("CameraAttributesPractical_10wpe")
|
||||
|
||||
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="Environment"]
|
||||
transform = Transform3D(0.903567, 0.24694, -0.350124, 0, 0.817195, 0.576361, 0.428446, -0.520781, 0.738391, 0, 0, 0)
|
||||
light_energy = 1.252
|
||||
light_indirect_energy = 1.63
|
||||
light_volumetric_fog_energy = 2.512
|
||||
|
||||
[node name="WaterSurface" type="MeshInstance3D" parent="Environment"]
|
||||
mesh = SubResource("PlaneMesh_kyck2")
|
||||
skeleton = NodePath("../..")
|
||||
surface_material_override/0 = SubResource("ShaderMaterial_avbpb")
|
||||
|
||||
[node name="PlayerHand" type="Node3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.28028, 0)
|
||||
script = ExtResource("4_kq4yo")
|
||||
|
||||
[node name="RigidBody3D" type="RigidBody3D" parent="PlayerHand"]
|
||||
freeze = true
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="PlayerHand/RigidBody3D"]
|
||||
shape = SubResource("BoxShape3D_y33cj")
|
||||
|
||||
[node name="CSGBox3D" type="CSGBox3D" parent="PlayerHand/RigidBody3D"]
|
||||
size = Vector3(1, 0.59, 3)
|
||||
material = ExtResource("2_wr2cl")
|
||||
|
||||
[node name="StartingPlatform" type="Node3D" parent="."]
|
||||
|
||||
[node name="StaticBody3D" type="StaticBody3D" parent="StartingPlatform"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2, -4.25525, 0)
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="StartingPlatform/StaticBody3D"]
|
||||
shape = SubResource("BoxShape3D_gmpx6")
|
||||
|
||||
[node name="BasePlatform" type="CSGBox3D" parent="StartingPlatform/StaticBody3D"]
|
||||
material_override = ExtResource("2_txp0l")
|
||||
size = Vector3(1, 10, 3)
|
||||
|
||||
[node name="StaticBody3D3" type="StaticBody3D" parent="StartingPlatform"]
|
||||
transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, 2, -4.25525, 0)
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="StartingPlatform/StaticBody3D3"]
|
||||
shape = SubResource("BoxShape3D_gmpx6")
|
||||
|
||||
[node name="BasePlatform" type="CSGBox3D" parent="StartingPlatform/StaticBody3D3"]
|
||||
material_override = ExtResource("2_txp0l")
|
||||
size = Vector3(1, 10, 3)
|
||||
|
||||
[node name="UserInterface" type="Control" parent="."]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="DebugStuff" type="Label" parent="UserInterface"]
|
||||
layout_mode = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 23.0
|
||||
text = "meow"
|
||||
label_settings = SubResource("LabelSettings_y2xp5")
|
||||
|
||||
[connection signal="moveBlock" from="TwitchLink" to="PlayerHand" method="_on_twitch_link_move_block"]
|
||||
|
|
|
|||
7
materials/BaseMaterial.tres
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://bwrsgjub33pd4"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://bhfctierhbrj" path="res://materials/wood4.png" id="1_pdgtu"]
|
||||
|
||||
[resource]
|
||||
albedo_texture = ExtResource("1_pdgtu")
|
||||
uv1_triplanar = true
|
||||
7
materials/BlockMaterial.tres
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://bfl54pvxyctrd"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://bes07s067jb82" path="res://materials/wood5.png" id="1_5kskq"]
|
||||
|
||||
[resource]
|
||||
albedo_texture = ExtResource("1_5kskq")
|
||||
uv1_triplanar = true
|
||||
BIN
materials/wood1.png
Normal file
|
After Width: | Height: | Size: 1.3 MiB |
34
materials/wood1.png.import
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://di8v30sjpio5c"
|
||||
path="res://.godot/imported/wood1.png-5709938437a68c82437c610fe7c4a7fe.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://materials/wood1.png"
|
||||
dest_files=["res://.godot/imported/wood1.png-5709938437a68c82437c610fe7c4a7fe.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
BIN
materials/wood2.png
Normal file
|
After Width: | Height: | Size: 873 KiB |
34
materials/wood2.png.import
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dl7bdama1scut"
|
||||
path="res://.godot/imported/wood2.png-06c0a64d515d931f5b1c9ee7c665ec00.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://materials/wood2.png"
|
||||
dest_files=["res://.godot/imported/wood2.png-06c0a64d515d931f5b1c9ee7c665ec00.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
BIN
materials/wood3.png
Normal file
|
After Width: | Height: | Size: 1.3 MiB |
34
materials/wood3.png.import
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cwnk52515xe8p"
|
||||
path="res://.godot/imported/wood3.png-61502d48ad9589e674f04f607426dada.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://materials/wood3.png"
|
||||
dest_files=["res://.godot/imported/wood3.png-61502d48ad9589e674f04f607426dada.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
BIN
materials/wood4.png
Normal file
|
After Width: | Height: | Size: 1.4 MiB |
35
materials/wood4.png.import
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bhfctierhbrj"
|
||||
path.s3tc="res://.godot/imported/wood4.png-b0aa60bcd8d4c44997b8bc85f0387147.s3tc.ctex"
|
||||
metadata={
|
||||
"imported_formats": ["s3tc_bptc"],
|
||||
"vram_texture": true
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://materials/wood4.png"
|
||||
dest_files=["res://.godot/imported/wood4.png-b0aa60bcd8d4c44997b8bc85f0387147.s3tc.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=2
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=true
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=0
|
||||
BIN
materials/wood5.png
Normal file
|
After Width: | Height: | Size: 1.4 MiB |
35
materials/wood5.png.import
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bes07s067jb82"
|
||||
path.s3tc="res://.godot/imported/wood5.png-92a6a96948ed6508f6369efe0021d0bf.s3tc.ctex"
|
||||
metadata={
|
||||
"imported_formats": ["s3tc_bptc"],
|
||||
"vram_texture": true
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://materials/wood5.png"
|
||||
dest_files=["res://.godot/imported/wood5.png-92a6a96948ed6508f6369efe0021d0bf.s3tc.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=2
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=true
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=0
|
||||
57
scripts/JengaManager.gd
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
extends Node3D
|
||||
#class_name
|
||||
#Authored by Tom. Please consult for any modifications or major feature requests.
|
||||
|
||||
#region Variables
|
||||
#Signals
|
||||
|
||||
#Enums
|
||||
|
||||
#Constants
|
||||
|
||||
#Exported Variables
|
||||
#@export_group("Group")
|
||||
#@export_subgroup("Subgroup")
|
||||
@export_group("Config")
|
||||
@export var turn_time_limit : float = 60
|
||||
@export var accept_time_limit : float = 20
|
||||
@export_group("Node References")
|
||||
@export var debug_ui_label : Label
|
||||
|
||||
#Onready Variables
|
||||
|
||||
#Other Variables (please try to separate and organise!)
|
||||
var player_queue : Array[String]
|
||||
var current_player : String = ""
|
||||
var turn_timer : float
|
||||
var turn_started : bool #cant do stuff unless this is true
|
||||
var start_process : bool = false
|
||||
|
||||
#endregion
|
||||
|
||||
#region Godot methods
|
||||
func _ready():
|
||||
#Runs when all children have entered the tree
|
||||
pass
|
||||
|
||||
func _process(delta):
|
||||
turn_timer -= delta
|
||||
if(current_player == "" or turn_timer<0):
|
||||
current_player = ""
|
||||
#switch to the next players turn (if anyone is in the queue)
|
||||
if(player_queue.size()>0):
|
||||
current_player = player_queue[0]
|
||||
player_queue.erase(current_player)
|
||||
turn_started = false
|
||||
turn_timer = accept_time_limit
|
||||
debug_ui_label.text = "Current Player: " + current_player + "\nTurn Started?: " + str(turn_started) + "\nTime Left: " + str(round(turn_timer)) + "\nQueue Size: " + str(player_queue.size())
|
||||
|
||||
#endregion
|
||||
|
||||
#region Signal methods
|
||||
|
||||
#endregion
|
||||
|
||||
#region Other methods (please try to separate and organise!)
|
||||
|
||||
#endregion
|
||||
50
scripts/PlayerHand.gd
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
extends Node3D
|
||||
#class_name
|
||||
#Authored by Tom. Please consult for any modifications or major feature requests.
|
||||
|
||||
#region Variables
|
||||
#Signals
|
||||
|
||||
#Enums
|
||||
|
||||
#Constants
|
||||
|
||||
#Exported Variables
|
||||
#@export_group("Group")
|
||||
#@export_subgroup("Subgroup")
|
||||
|
||||
#Onready Variables
|
||||
|
||||
#Other Variables (please try to separate and organise!)
|
||||
|
||||
#endregion
|
||||
|
||||
#region Godot methods
|
||||
func _ready():
|
||||
#Runs when all children have entered the tree
|
||||
pass
|
||||
|
||||
func _process(delta):
|
||||
#Runs per frame
|
||||
pass
|
||||
#endregion
|
||||
|
||||
#region Signal methods
|
||||
|
||||
#endregion
|
||||
|
||||
#region Other methods (please try to separate and organise!)
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
func _on_twitch_link_move_block(direction, amount):
|
||||
var dir : Vector3
|
||||
match direction:
|
||||
"up": dir = Vector3.UP
|
||||
"down" : dir = Vector3.DOWN
|
||||
"north" : dir = Vector3.FORWARD
|
||||
"east" : dir = Vector3.RIGHT
|
||||
"south" : dir = Vector3.BACK
|
||||
"west" : dir = Vector3.LEFT
|
||||
position += dir * amount
|
||||
|
|
@ -1,5 +1,10 @@
|
|||
extends Gift
|
||||
|
||||
signal moveBlock(direction : String, amount : float)
|
||||
|
||||
@export_group("Node References")
|
||||
@export var jenga_manager : Node
|
||||
|
||||
func _ready() -> void:
|
||||
cmd_no_permission.connect(no_permission)
|
||||
##chat_message.connect(on_chat)
|
||||
|
|
@ -57,6 +62,7 @@ func _ready() -> void:
|
|||
add_command("join_queue", join_queue)
|
||||
add_command("leave_queue", leave_queue)
|
||||
add_command("start_turn", start_turn)
|
||||
add_command("pass_turn", pass_turn)
|
||||
|
||||
## Gameplay Commands
|
||||
#camera movement command - !camera left 20 (moves camera left 20 units)
|
||||
|
|
@ -66,6 +72,7 @@ func _ready() -> void:
|
|||
add_command("move", move, 2,2)
|
||||
|
||||
|
||||
|
||||
func on_event(type : String, data : Dictionary) -> void:
|
||||
match(type):
|
||||
"channel.follow":
|
||||
|
|
@ -105,18 +112,24 @@ func list(cmd_info : CommandInfo, arg_ary : PackedStringArray) -> void:
|
|||
|
||||
func join_queue(cmd_info : CommandInfo):
|
||||
#add sender to queue array
|
||||
jenga_manager.player_queue.append(cmd_info.sender_data.tags["display-name"])
|
||||
pass
|
||||
|
||||
func leave_queue(cmd_info : CommandInfo):
|
||||
#remove sender from queue array
|
||||
jenga_manager.player_queue.erase(cmd_info.sender_data.tags["display-name"])
|
||||
pass
|
||||
|
||||
func start_turn(cmd_info : CommandInfo):
|
||||
#give the player who urn is about to start 20(?) seconds to confirm their turn
|
||||
#give the player who turn is about to start 20(?) seconds to confirm their turn
|
||||
if(cmd_info.sender_data.tags["display-name"] == jenga_manager.current_player):
|
||||
jenga_manager.turn_started=true
|
||||
jenga_manager.turn_timer = jenga_manager.turn_time_limit
|
||||
pass
|
||||
|
||||
func pass_turn(cmd_info : CommandInfo):
|
||||
#allow the player to pass their turn and leave the queue if they no longer wish to play
|
||||
jenga_manager.turn_timer = 0 #might change this later depeding on how i set up penalties
|
||||
pass
|
||||
|
||||
|
||||
|
|
@ -126,4 +139,11 @@ func camera(cmd_info : CommandInfo, arg_ary : PackedStringArray) -> void:
|
|||
chat("moving camera " + arg_ary[0] + " by " + arg_ary[1] + " degrees")
|
||||
|
||||
func move(cmd_info : CommandInfo, arg_ary : PackedStringArray) -> void:
|
||||
if(cmd_info.sender_data.tags["display-name"] == jenga_manager.current_player):
|
||||
var chosenDirection = arg_ary[0].to_lower()
|
||||
var validDirections = ["up","down","north","south","east","west"]
|
||||
if(validDirections.has(chosenDirection)):
|
||||
moveBlock.emit(arg_ary[0],float(arg_ary[1]))
|
||||
chat("moving block " + arg_ary[0] + " by " + arg_ary[1] + " units")
|
||||
else:
|
||||
chat("invalid direction :(")
|
||||
|
|
|
|||