tiger-cleanup #1
|
|
@ -0,0 +1,25 @@
|
||||||
|
extends AnimatableBody3D
|
||||||
|
|
||||||
|
var start_position:Vector3 = position
|
||||||
|
var risen:bool = false
|
||||||
|
var raiser : Tween
|
||||||
|
|
||||||
|
func raise(body) -> void:
|
||||||
|
if body is not PlayerController:
|
||||||
|
push_warning("Unexpected body in raiser trigger", body)
|
||||||
|
return
|
||||||
|
|
||||||
|
if risen:
|
||||||
|
position = start_position
|
||||||
|
|
||||||
|
if raiser and raiser.is_valid():
|
||||||
|
raiser.kill()
|
||||||
|
|
||||||
|
raiser = create_tween()
|
||||||
|
raiser.tween_property(self, "position", position + Vector3(0,1.1,0), 1)
|
||||||
|
risen = true
|
||||||
|
|
||||||
|
|
||||||
|
func reset(_discard) -> void:
|
||||||
|
risen = false
|
||||||
|
position = start_position
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
uid://hji6r2e8mcqo
|
||||||
|
|
@ -1,15 +1 @@
|
||||||
class_name CrouchVolume extends Area3D
|
class_name CrouchVolume extends Area3D
|
||||||
|
|
||||||
func ready():
|
|
||||||
body_entered.connect(notify_player_entry)
|
|
||||||
body_exited.connect(notify_player_exit)
|
|
||||||
|
|
||||||
func notify_player_entry(body: RigidBody3D):
|
|
||||||
print_debug("Player entered Crouch area.")
|
|
||||||
if body is PlayerController:
|
|
||||||
body.inside_crouch_volume.append(self)
|
|
||||||
|
|
||||||
func notify_player_exit(body: RigidBody3D):
|
|
||||||
if body is PlayerController:
|
|
||||||
body.inside_crouch_volume.erase(self)
|
|
||||||
body.crouched = false
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
[ext_resource type="PackedScene" uid="uid://mkccbig41bqb" path="res://logic-scenes/player_controller/player_controller.tscn" id="3_foj4y"]
|
[ext_resource type="PackedScene" uid="uid://mkccbig41bqb" path="res://logic-scenes/player_controller/player_controller.tscn" id="3_foj4y"]
|
||||||
[ext_resource type="AudioStream" uid="uid://bbpo1hu35yer8" path="res://base-environments/youth_room/import/sounds/thunder.mp3" id="3_wcypa"]
|
[ext_resource type="AudioStream" uid="uid://bbpo1hu35yer8" path="res://base-environments/youth_room/import/sounds/thunder.mp3" id="3_wcypa"]
|
||||||
[ext_resource type="Script" uid="uid://c281w7earok6w" path="res://base-environments/youth_room/crouch_volume.gd" id="3_x3dlb"]
|
[ext_resource type="Script" uid="uid://c281w7earok6w" path="res://base-environments/youth_room/crouch_volume.gd" id="3_x3dlb"]
|
||||||
|
[ext_resource type="Script" uid="uid://hji6r2e8mcqo" path="res://base-environments/youth_room/climb_volume.gd" id="4_dqyng"]
|
||||||
[ext_resource type="PackedScene" uid="uid://bnskiyx1sksww" path="res://logic-scenes/board/physics-board.tscn" id="4_gyjxx"]
|
[ext_resource type="PackedScene" uid="uid://bnskiyx1sksww" path="res://logic-scenes/board/physics-board.tscn" id="4_gyjxx"]
|
||||||
[ext_resource type="AudioStream" uid="uid://1tvopjmo6dp2" path="res://base-environments/youth_room/audio/Azure Studios - mgd-723687677.mp3" id="5_fe1yj"]
|
[ext_resource type="AudioStream" uid="uid://1tvopjmo6dp2" path="res://base-environments/youth_room/audio/Azure Studios - mgd-723687677.mp3" id="5_fe1yj"]
|
||||||
[ext_resource type="PackedScene" uid="uid://citwb7f4dl3l1" path="res://thank-you.tscn" id="5_kts6y"]
|
[ext_resource type="PackedScene" uid="uid://citwb7f4dl3l1" path="res://thank-you.tscn" id="5_kts6y"]
|
||||||
|
|
@ -110,25 +111,6 @@ height = 3.78697
|
||||||
radius = 1.73984
|
radius = 1.73984
|
||||||
height = 5.43669
|
height = 5.43669
|
||||||
|
|
||||||
[sub_resource type="GDScript" id="GDScript_uyt24"]
|
|
||||||
script/source = "extends StaticBody3D
|
|
||||||
var risen:bool = false
|
|
||||||
var start_position:Vector3 = position
|
|
||||||
|
|
||||||
func raise(entering_player):
|
|
||||||
if not entering_player.on_crouch_cooldown:
|
|
||||||
if risen:
|
|
||||||
position = start_position
|
|
||||||
var raiser = create_tween()
|
|
||||||
raiser.tween_property(self, \"position\", position + Vector3(0,1.1,0), 1)
|
|
||||||
risen = true
|
|
||||||
|
|
||||||
|
|
||||||
func reset(_discard):
|
|
||||||
risen = false
|
|
||||||
position = start_position
|
|
||||||
"
|
|
||||||
|
|
||||||
[sub_resource type="BoxShape3D" id="BoxShape3D_gim5a"]
|
[sub_resource type="BoxShape3D" id="BoxShape3D_gim5a"]
|
||||||
size = Vector3(1.63347, 0.305693, 0.775269)
|
size = Vector3(1.63347, 0.305693, 0.775269)
|
||||||
|
|
||||||
|
|
@ -1683,9 +1665,9 @@ collision_mask = 2
|
||||||
transform = Transform3D(0.995341, 0.096419, 0, 4.21461e-09, -4.35077e-08, -1, -0.096419, 0.995341, -4.37114e-08, 0, 0, 0)
|
transform = Transform3D(0.995341, 0.096419, 0, 4.21461e-09, -4.35077e-08, -1, -0.096419, 0.995341, -4.37114e-08, 0, 0, 0)
|
||||||
shape = SubResource("CapsuleShape3D_n20ff")
|
shape = SubResource("CapsuleShape3D_n20ff")
|
||||||
|
|
||||||
[node name="ladder" type="StaticBody3D" parent="logic/Bed and Ladders"]
|
[node name="ladder" type="AnimatableBody3D" parent="logic/Bed and Ladders"]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0699199, 0, -0.082733)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0699199, 0, -0.082733)
|
||||||
script = SubResource("GDScript_uyt24")
|
script = ExtResource("4_dqyng")
|
||||||
|
|
||||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="logic/Bed and Ladders/ladder"]
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="logic/Bed and Ladders/ladder"]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.336261, -0.199846, 0.0549462)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.336261, -0.199846, 0.0549462)
|
||||||
|
|
|
||||||
|
|
@ -79,8 +79,7 @@ var crouched:bool = false:
|
||||||
else:
|
else:
|
||||||
$PlayerAnimationPlayer.play("fast_stand_up")
|
$PlayerAnimationPlayer.play("fast_stand_up")
|
||||||
crouched = set_crouching
|
crouched = set_crouching
|
||||||
var on_crouch_cooldown:bool = false
|
|
||||||
|
|
||||||
@onready var yaw: Node3D = $Yaw
|
@onready var yaw: Node3D = $Yaw
|
||||||
@onready var pitch: Node3D = $Yaw/Pitch
|
@onready var pitch: Node3D = $Yaw/Pitch
|
||||||
@onready var mount: Node3D = $Yaw/Pitch/Mount
|
@onready var mount: Node3D = $Yaw/Pitch/Mount
|
||||||
|
|
@ -104,10 +103,14 @@ signal ui_exited
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
_handle_jitter(0)
|
_handle_jitter(0)
|
||||||
|
|
||||||
|
pitch.rotation_degrees.x = initial_pitch
|
||||||
|
|
||||||
ui_prober.area_entered.connect(_on_ray_entered)
|
ui_prober.area_entered.connect(_on_ray_entered)
|
||||||
ui_prober.area_exited.connect(_on_ray_exited)
|
ui_prober.area_exited.connect(_on_ray_exited)
|
||||||
|
|
||||||
|
$CrouchDetector.area_entered.connect(enter_crouch)
|
||||||
$CrouchDetector.area_exited.connect(exit_crouch)
|
$CrouchDetector.area_exited.connect(exit_crouch)
|
||||||
pitch.rotation_degrees.x = initial_pitch
|
|
||||||
|
|
||||||
# Connect to central player enable signal.
|
# Connect to central player enable signal.
|
||||||
# Guard for standalone test scenes without autoloads.
|
# Guard for standalone test scenes without autoloads.
|
||||||
|
|
@ -274,18 +277,14 @@ func _input(event: InputEvent) -> void:
|
||||||
crouch_toggled = true
|
crouch_toggled = true
|
||||||
|
|
||||||
func _on_bed_enter(_body):
|
func _on_bed_enter(_body):
|
||||||
if not (crouched or on_crouch_cooldown):
|
if not crouched:
|
||||||
trigger_slow_crouch = true
|
trigger_slow_crouch = true
|
||||||
crouched = true
|
crouched = true
|
||||||
|
|
||||||
func _on_bed_exit(_body):
|
func _on_bed_exit(_body):
|
||||||
if crouched and not crouch_held:
|
if crouched and not crouch_held:
|
||||||
trigger_slow_crouch = true
|
trigger_slow_crouch = true
|
||||||
crouched = false
|
crouched = false
|
||||||
|
|
||||||
on_crouch_cooldown = true
|
|
||||||
await get_tree().create_timer(1.0).timeout
|
|
||||||
on_crouch_cooldown = false
|
|
||||||
|
|
||||||
var inside_crouch_volume: Array[CrouchVolume] = []
|
var inside_crouch_volume: Array[CrouchVolume] = []
|
||||||
|
|
||||||
|
|
@ -296,6 +295,11 @@ func can_stand_up() -> bool:
|
||||||
return false
|
return false
|
||||||
return true
|
return true
|
||||||
|
|
||||||
|
func enter_crouch(body):
|
||||||
|
if body is CrouchVolume:
|
||||||
|
crouched = true
|
||||||
|
|
||||||
func exit_crouch(body):
|
func exit_crouch(body):
|
||||||
if body is Area3D:
|
if body is CrouchVolume:
|
||||||
crouched = false
|
crouched = false
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
[gd_scene load_steps=9 format=3 uid="uid://bystjfm61jw7t"]
|
[gd_scene load_steps=17 format=3 uid="uid://bystjfm61jw7t"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://c281w7earok6w" path="res://base-environments/youth_room/crouch_volume.gd" id="1_ki2be"]
|
[ext_resource type="Script" uid="uid://c281w7earok6w" path="res://base-environments/youth_room/crouch_volume.gd" id="1_ki2be"]
|
||||||
[ext_resource type="PackedScene" uid="uid://mkccbig41bqb" path="res://logic-scenes/player_controller/player_controller.tscn" id="2_rmwd0"]
|
[ext_resource type="PackedScene" uid="uid://mkccbig41bqb" path="res://logic-scenes/player_controller/player_controller.tscn" id="2_rmwd0"]
|
||||||
|
[ext_resource type="Script" uid="uid://hji6r2e8mcqo" path="res://base-environments/youth_room/climb_volume.gd" id="3_rmwd0"]
|
||||||
|
|
||||||
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_ki2be"]
|
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_ki2be"]
|
||||||
radius = 1.14469
|
radius = 1.14469
|
||||||
|
|
@ -26,6 +27,32 @@ height = 10.0
|
||||||
|
|
||||||
[sub_resource type="WorldBoundaryShape3D" id="WorldBoundaryShape3D_ki2be"]
|
[sub_resource type="WorldBoundaryShape3D" id="WorldBoundaryShape3D_ki2be"]
|
||||||
|
|
||||||
|
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_8344t"]
|
||||||
|
radius = 0.156739
|
||||||
|
height = 1.0
|
||||||
|
|
||||||
|
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_wlply"]
|
||||||
|
radius = 0.787239
|
||||||
|
height = 4.07459
|
||||||
|
|
||||||
|
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_55bee"]
|
||||||
|
radius = 1.0352
|
||||||
|
height = 2.3319
|
||||||
|
|
||||||
|
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_317jd"]
|
||||||
|
radius = 1.14469
|
||||||
|
height = 3.78697
|
||||||
|
|
||||||
|
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_coixd"]
|
||||||
|
radius = 1.73984
|
||||||
|
height = 5.43669
|
||||||
|
|
||||||
|
[sub_resource type="BoxShape3D" id="BoxShape3D_j8gbq"]
|
||||||
|
size = Vector3(1.63347, 0.305693, 0.775269)
|
||||||
|
|
||||||
|
[sub_resource type="BoxShape3D" id="BoxShape3D_akpqw"]
|
||||||
|
size = Vector3(0.244565, 1, 0.245859)
|
||||||
|
|
||||||
[node name="CharacterTests" type="Node3D"]
|
[node name="CharacterTests" type="Node3D"]
|
||||||
|
|
||||||
[node name="bed_crouch" type="Area3D" parent="."]
|
[node name="bed_crouch" type="Area3D" parent="."]
|
||||||
|
|
@ -52,7 +79,7 @@ transform = Transform3D(0.686123, 0, 0.727485, 0, 1, 0, -0.727485, 0, 0.686123,
|
||||||
enabled = true
|
enabled = true
|
||||||
|
|
||||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
|
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0049040318, -0.008946419, 0.003689289)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0049040318, -0.36189413, 0.003689289)
|
||||||
mesh = SubResource("PlaneMesh_ki2be")
|
mesh = SubResource("PlaneMesh_ki2be")
|
||||||
|
|
||||||
[node name="OmniLight3D" type="OmniLight3D" parent="."]
|
[node name="OmniLight3D" type="OmniLight3D" parent="."]
|
||||||
|
|
@ -67,3 +94,71 @@ mesh = SubResource("SphereMesh_ki2be")
|
||||||
|
|
||||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="StaticBody3D"]
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="StaticBody3D"]
|
||||||
shape = SubResource("WorldBoundaryShape3D_ki2be")
|
shape = SubResource("WorldBoundaryShape3D_ki2be")
|
||||||
|
|
||||||
|
[node name="Bed and Ladders" type="Node3D" parent="."]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.1783472, 4.7683716e-07, 5.135357)
|
||||||
|
|
||||||
|
[node name="ladder_trigger" type="Area3D" parent="Bed and Ladders"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.19478047, 0, 0)
|
||||||
|
collision_layer = 2
|
||||||
|
collision_mask = 2
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="Bed and Ladders/ladder_trigger"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.170028, 0.244833, -0.0455775)
|
||||||
|
shape = SubResource("CapsuleShape3D_8344t")
|
||||||
|
|
||||||
|
[node name="bed_duck" type="Area3D" parent="Bed and Ladders"]
|
||||||
|
collision_layer = 2
|
||||||
|
collision_mask = 2
|
||||||
|
script = ExtResource("1_ki2be")
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="Bed and Ladders/bed_duck"]
|
||||||
|
transform = Transform3D(0.995341, 0.096419, 0, 4.21461e-09, -4.35077e-08, -1, -0.096419, 0.995341, -4.37114e-08, 0.916567, 1.64525, -1.14479)
|
||||||
|
shape = SubResource("CapsuleShape3D_wlply")
|
||||||
|
|
||||||
|
[node name="bed_enter" type="Area3D" parent="Bed and Ladders"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.35717, 0, -0.255744)
|
||||||
|
collision_layer = 2
|
||||||
|
collision_mask = 2
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="Bed and Ladders/bed_enter"]
|
||||||
|
transform = Transform3D(0.995341, 0.096419, 0, 4.21461e-09, -4.35077e-08, -1, -0.096419, 0.995341, -4.37114e-08, 0, 0, 0)
|
||||||
|
shape = SubResource("CapsuleShape3D_55bee")
|
||||||
|
|
||||||
|
[node name="bed_crouch" type="Area3D" parent="Bed and Ladders"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.24356, 0, -0.796765)
|
||||||
|
collision_layer = 2
|
||||||
|
collision_mask = 2
|
||||||
|
script = ExtResource("1_ki2be")
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="Bed and Ladders/bed_crouch"]
|
||||||
|
transform = Transform3D(0.995341, 0.096419, 0, 4.21461e-09, -4.35077e-08, -1, -0.096419, 0.995341, -4.37114e-08, 0.107988, 1.56575e-08, -0.358201)
|
||||||
|
shape = SubResource("CapsuleShape3D_317jd")
|
||||||
|
|
||||||
|
[node name="reset_failover" type="Area3D" parent="Bed and Ladders"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.24356, 0, -0.531366)
|
||||||
|
collision_layer = 2
|
||||||
|
collision_mask = 2
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="Bed and Ladders/reset_failover"]
|
||||||
|
transform = Transform3D(0.995341, 0.096419, 0, 4.21461e-09, -4.35077e-08, -1, -0.096419, 0.995341, -4.37114e-08, 0, 0, 0)
|
||||||
|
shape = SubResource("CapsuleShape3D_coixd")
|
||||||
|
|
||||||
|
[node name="ladder" type="AnimatableBody3D" parent="Bed and Ladders"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0699199, 0, -0.082733)
|
||||||
|
script = ExtResource("3_rmwd0")
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="Bed and Ladders/ladder"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.336261, -0.199846, 0.0549462)
|
||||||
|
shape = SubResource("BoxShape3D_j8gbq")
|
||||||
|
|
||||||
|
[node name="CollisionShape3D2" type="CollisionShape3D" parent="Bed and Ladders/ladder"]
|
||||||
|
transform = Transform3D(0.833085, 0, -0.553144, 0, 1, 0, 0.553144, 0, 0.833085, 0.0114179, 0, -0.412249)
|
||||||
|
shape = SubResource("BoxShape3D_akpqw")
|
||||||
|
|
||||||
|
[node name="CollisionShape3D3" type="CollisionShape3D" parent="Bed and Ladders/ladder"]
|
||||||
|
transform = Transform3D(0.707304, 0, 0.706909, 0, 1, 0, -0.706909, 0, 0.707304, 0.240986, 0, 0.539403)
|
||||||
|
shape = SubResource("BoxShape3D_akpqw")
|
||||||
|
|
||||||
|
[connection signal="body_entered" from="Bed and Ladders/ladder_trigger" to="Bed and Ladders/ladder" method="raise"]
|
||||||
|
[connection signal="body_exited" from="Bed and Ladders/bed_duck" to="Bed and Ladders/ladder" method="reset"]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue