diff --git a/Game/Assets/Characters/Player.tscn b/Game/Assets/Characters/Player.tscn index 500c47e..6ce062c 100644 --- a/Game/Assets/Characters/Player.tscn +++ b/Game/Assets/Characters/Player.tscn @@ -2,7 +2,7 @@ [ext_resource type="Script" path="res://Assets/Characters/Player.gd" id="1"] [ext_resource type="PackedScene" uid="uid://bemrov0tiy08n" path="res://Assets/Weapons/Weapon.tscn" id="3"] -[ext_resource type="Texture2D" uid="uid://cguy76rs8e220" path="res://Assets/Effects/Flame.png" id="3_jw7jd"] +[ext_resource type="Texture2D" uid="uid://pnh872qjk0oy" path="res://Assets/Effects/Flame.png" id="3_jw7jd"] [ext_resource type="AudioStream" uid="uid://bmjh522fpxeee" path="res://Assets/SFX/Player_Jetpack.wav" id="4_k24if"] [ext_resource type="AudioStream" uid="uid://3kb1cqt6lcaq" path="res://Assets/SFX/Player_Spawn.wav" id="5_bmajs"] [ext_resource type="PackedScene" uid="uid://c5cwnfuw4go1b" path="res://Assets/Audio/SoundPlayer.tscn" id="5_yiom2"] @@ -66,7 +66,7 @@ _data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0] offsets = PackedFloat32Array(0, 0.0888031, 0.227799, 0.393822, 1) colors = PackedColorArray(0, 0, 0, 1, 0.671875, 0.946167, 1, 1, 0.996185, 1, 0.511719, 1, 1, 0.732788, 0.222656, 1, 0, 0, 0, 1) -[sub_resource type="GradientTexture" id="GradientTexture_nta0d"] +[sub_resource type="GradientTexture1D" id="GradientTexture_nta0d"] gradient = SubResource( "Gradient_fu53v" ) width = 128 @@ -86,7 +86,7 @@ collision_friction = 1.0 offsets = PackedFloat32Array(0, 0.186757, 1) colors = PackedColorArray(0, 0, 0, 1, 4, 4, 4, 1, 0, 0, 0, 1) -[sub_resource type="GradientTexture" id="GradientTexture_h65ov"] +[sub_resource type="GradientTexture1D" id="GradientTexture_h65ov"] gradient = SubResource( "Gradient_niqb5" ) [sub_resource type="ParticlesMaterial" id="ParticlesMaterial_lo734"] @@ -144,11 +144,11 @@ curve = SubResource( "Curve_gq708" ) resource_name = "01" length = 0.5 tracks/0/type = "audio" +tracks/0/imported = false +tracks/0/enabled = true tracks/0/path = NodePath("PainSFX") tracks/0/interp = 1 tracks/0/loop_wrap = true -tracks/0/imported = false -tracks/0/enabled = true tracks/0/keys = { "clips": [{ "end_offset": 0.0, @@ -162,11 +162,11 @@ tracks/0/keys = { resource_name = "02" length = 0.5 tracks/0/type = "audio" +tracks/0/imported = false +tracks/0/enabled = true tracks/0/path = NodePath("PainSFX") tracks/0/interp = 1 tracks/0/loop_wrap = true -tracks/0/imported = false -tracks/0/enabled = true tracks/0/keys = { "clips": [{ "end_offset": 0.271473, @@ -180,11 +180,11 @@ tracks/0/keys = { resource_name = "03" length = 0.5 tracks/0/type = "audio" +tracks/0/imported = false +tracks/0/enabled = true tracks/0/path = NodePath("PainSFX") tracks/0/interp = 1 tracks/0/loop_wrap = true -tracks/0/imported = false -tracks/0/enabled = true tracks/0/keys = { "clips": [{ "end_offset": 0.216568, @@ -198,11 +198,11 @@ tracks/0/keys = { resource_name = "04" length = 0.5 tracks/0/type = "audio" +tracks/0/imported = false +tracks/0/enabled = true tracks/0/path = NodePath("PainSFX") tracks/0/interp = 1 tracks/0/loop_wrap = true -tracks/0/imported = false -tracks/0/enabled = true tracks/0/keys = { "clips": [{ "end_offset": 0.0, @@ -234,72 +234,57 @@ script = ExtResource( "1" ) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.852763, 0) layers = 2 mesh = SubResource( "1" ) -surface_material_override/0 = null -script = null [node name="Head" type="Node3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.45276, 0) -script = null [node name="Camera" type="Camera3D" parent="Head"] fov = 90.0 -script = null [node name="Hand" type="Node3D" parent="Head/Camera"] transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 0.3, -0.4, -0.6) -script = null [node name="Weapon" parent="Head/Camera/Hand" instance=ExtResource( "3" )] [node name="Tween" type="Node" parent="Head/Camera"] -script = null [node name="RayCast3D" type="RayCast3D" parent="Head/Camera"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.77099e-07, 0, -0.742805) target_position = Vector3(0, 0, -1000) collision_mask = 2 -script = null [node name="GPUParticlesCollisionSphere" type="GPUParticlesCollisionSphere" parent="."] transform = Transform3D(1, 0, 0, 0, 2.16632, 0, 0, 0, 1, 0.00910211, 0.760577, 0.00278068) layers = 7 radius = 0.549216 -script = null [node name="Body" type="CollisionShape3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.852763, 0) shape = SubResource( "2" ) -script = null [node name="Feet" type="CollisionShape3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.252763, 0) shape = SubResource( "3" ) disabled = true -script = null [node name="GroundCheck" type="RayCast3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.952763, 0) target_position = Vector3(0, -1.1, 0) debug_shape_thickness = 5.0 -script = null [node name="ClimbCheck" type="RayCast3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.60905, -0.5) visible = false enabled = false target_position = Vector3(0, -1.35, 0) -script = null [node name="ClimbTween" type="Node" parent="."] -script = null [node name="Jetpack" type="MeshInstance3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.93832, 0.5022) layers = 2 material_override = SubResource( "StandardMaterial3D_y4s21" ) mesh = SubResource( "CylinderMesh_8yana" ) -surface_material_override/0 = null -script = null [node name="OmniLight3D" type="OmniLight3D" parent="Jetpack"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.68079, 0) @@ -310,7 +295,6 @@ light_size = 0.46 light_specular = 0.27 shadow_enabled = true shadow_blur = 0.85 -script = null [node name="GPUParticles3D" type="CPUParticles3D" parent="Jetpack"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.45039, 0.00259888) @@ -333,7 +317,6 @@ scale_amount_curve = SubResource( "Curve_elwjc" ) color_ramp = SubResource( "Gradient_fu53v" ) anim_offset_min = -100.0 anim_offset_max = 100.0 -script = null [node name="GPUParticles3D2" type="GPUParticles3D" parent="Jetpack"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.45039, 0.00259888) @@ -343,7 +326,6 @@ lifetime = 3.0 local_coords = false process_material = SubResource( "ParticlesMaterial_px65a" ) draw_pass_1 = SubResource( "QuadMesh_355ks" ) -script = null [node name="JetpackSound" type="AudioStreamPlayer3D" parent="Jetpack"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.444909, 0) @@ -353,12 +335,10 @@ unit_size = 4.0 max_db = -12.0 pitch_scale = 3.0 doppler_tracking = 2 -script = null [node name="SpawnSFX" type="AudioStreamPlayer3D" parent="."] stream = ExtResource( "5_bmajs" ) autoplay = true -script = null [node name="SpawnVFX" type="GPUParticles3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.918712, 0) @@ -375,7 +355,6 @@ trail_enabled = true trail_length_secs = 0.35 process_material = SubResource( "ParticlesMaterial_lo734" ) draw_pass_1 = SubResource( "RibbonTrailMesh_34621" ) -script = null [node name="Pain" type="AnimationPlayer" parent="."] root_node = NodePath(".") @@ -383,8 +362,6 @@ anims/01 = SubResource( "Animation_r1ffi" ) anims/02 = SubResource( "Animation_dc3si" ) anims/03 = SubResource( "Animation_uiuci" ) anims/04 = SubResource( "Animation_66hai" ) -blend_times = [] -script = null [node name="PainSFX" type="AudioStreamPlayer3D" parent="Pain"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.29486, 0) @@ -392,7 +369,6 @@ stream = ExtResource( "9_bobut" ) max_db = 0.0 attenuation_filter_cutoff_hz = 10000.0 attenuation_filter_db = -8.0 -script = null [node name="JumpSFX" parent="." instance=ExtResource( "5_yiom2" )] @@ -404,7 +380,5 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0) layers = 4 cast_shadow = 0 mesh = SubResource( "QuadMesh_nhjmb" ) -surface_material_override/0 = null -script = null [editable path="JumpSFX"] diff --git a/Game/Assets/UI/GUI.gd b/Game/Assets/UI/GUI.gd index 3c9f0f3..3ee3da6 100644 --- a/Game/Assets/UI/GUI.gd +++ b/Game/Assets/UI/GUI.gd @@ -102,9 +102,9 @@ func set_fullscreen(is_fullscreen): func set_lighting(is_enabled): var map = get_tree().get_root().get_node("Main").get_node("Map") - map.get_node("Lights").visible = is_enabled - map.get_node("Decals").visible = is_enabled - map.get_node("ReflectionProbes").visible = is_enabled + #map.get_node("Lights").visible = is_enabled + #map.get_node("Decals").visible = is_enabled + #map.get_node("ReflectionProbes").visible = is_enabled func set_ambient_occlusion(is_enabled): # TODO diff --git a/Game/Assets/UI/PlayMenu.gd b/Game/Assets/UI/PlayMenu.gd index b05a674..737de05 100644 --- a/Game/Assets/UI/PlayMenu.gd +++ b/Game/Assets/UI/PlayMenu.gd @@ -1,4 +1,11 @@ extends "res://Assets/UI/Menu.gd" +func on_visibility_changed(): + if visible: + $SuicideButton.visible = (Main.role != Main.MultiplayerRole.NONE) + +func commit_suicide(): + Main.commit_suicide() + func host_button_pressed(): Main.host_server() diff --git a/Game/Assets/UI/PlayMenu.tscn b/Game/Assets/UI/PlayMenu.tscn index 79f855b..32c8230 100644 --- a/Game/Assets/UI/PlayMenu.tscn +++ b/Game/Assets/UI/PlayMenu.tscn @@ -10,7 +10,7 @@ script = ExtResource( "2_pgqlf" ) [node name="HostButton" parent="." index="0" instance=ExtResource( "2_oo0fl" )] anchor_right = 0.0 anchor_bottom = 0.0 -offset_right = 73.0 +offset_right = 250.0 offset_bottom = 29.0 text = "host" label = "host" @@ -19,7 +19,7 @@ label = "host" anchor_right = 0.0 anchor_bottom = 0.0 offset_top = 33.0 -offset_right = 73.0 +offset_right = 250.0 offset_bottom = 62.0 text = "connect" label = "connect" @@ -28,15 +28,27 @@ label = "connect" anchor_right = 0.0 anchor_bottom = 0.0 offset_top = 66.0 -offset_right = 73.0 +offset_right = 250.0 offset_bottom = 95.0 text = "profile" label = "profile" -[node name="Back" parent="." index="3"] +[node name="SuicideButton" parent="." index="3" instance=ExtResource( "2_oo0fl" )] +anchor_right = 0.0 +anchor_bottom = 0.0 offset_top = 99.0 +offset_right = 250.0 offset_bottom = 128.0 +theme_override_font_sizes/font_size = 16 +text = "commit suicide" +label = "commit suicide" +[node name="Back" parent="." index="4"] +offset_top = 132.0 +offset_bottom = 161.0 + +[connection signal="visibility_changed" from="." to="." method="on_visibility_changed"] [connection signal="pressed" from="HostButton" to="." method="host_button_pressed"] [connection signal="pressed" from="ConnectButton" to="." method="open_menu" binds= ["res://Assets/UI/ConnectMenu.tscn"]] [connection signal="pressed" from="ProfileButton" to="." method="open_menu" binds= ["res://Assets/UI/ProfileMenu.tscn"]] +[connection signal="pressed" from="SuicideButton" to="." method="commit_suicide"] diff --git a/Game/Main.gd b/Game/Main.gd index b3e3dc0..835e352 100644 --- a/Game/Main.gd +++ b/Game/Main.gd @@ -418,6 +418,10 @@ func start_dedicated_server(): # start server without creating a local player func host_server(): _on_Host_pressed() +func commit_suicide(): + local_player.rpc(&"die", local_player.get_multiplayer_authority()) + focus = GameFocus.GAME + func connect_to_server(ip): $NetworkTesting/Host.disabled = true $NetworkTesting/Connect.disabled = true