Fixed bugs logan found

This commit is contained in:
Thomas Muller 2024-12-22 17:01:59 -05:00
parent f0c6e52795
commit ad4a828f04
6 changed files with 58 additions and 11 deletions

2
assets

@ -1 +1 @@
Subproject commit d98c81e159c1c0ec2d794e7afb2607a709f27120 Subproject commit 9d4470d31a7429d21a8e7ae35c7378eb3ec012a5

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=22 format=4 uid="uid://bbqug1s083mdi"] [gd_scene load_steps=25 format=4 uid="uid://bbqug1s083mdi"]
[ext_resource type="PackedScene" uid="uid://ci2uamlnv8swy" path="res://assets/maps/levelpool.blend" id="1_cpckw"] [ext_resource type="PackedScene" uid="uid://ci2uamlnv8swy" path="res://assets/maps/levelpool.blend" id="1_cpckw"]
[ext_resource type="PackedScene" uid="uid://cy86jyiy6skvk" path="res://scenes/player.tscn" id="2_eggmh"] [ext_resource type="PackedScene" uid="uid://cy86jyiy6skvk" path="res://scenes/player.tscn" id="2_eggmh"]
@ -7,9 +7,11 @@
[ext_resource type="AudioStream" uid="uid://cieprqff0h2nm" path="res://assets/sounds/door.wav" id="5_yad6d"] [ext_resource type="AudioStream" uid="uid://cieprqff0h2nm" path="res://assets/sounds/door.wav" id="5_yad6d"]
[ext_resource type="PackedScene" uid="uid://dnq81gfo5y4oy" path="res://components/group_trigger_component.tscn" id="6_f2del"] [ext_resource type="PackedScene" uid="uid://dnq81gfo5y4oy" path="res://components/group_trigger_component.tscn" id="6_f2del"]
[ext_resource type="PackedScene" uid="uid://bfv04lp2tbxtd" path="res://scenes/monitor.tscn" id="6_qd2wd"] [ext_resource type="PackedScene" uid="uid://bfv04lp2tbxtd" path="res://scenes/monitor.tscn" id="6_qd2wd"]
[ext_resource type="Script" path="res://scenes/win_box.gd" id="7_oxf41"] [ext_resource type="Script" path="res://scripts/win_box.gd" id="7_oxf41"]
[ext_resource type="AudioStream" uid="uid://d20ver6nfndbt" path="res://assets/sounds/dialog/start_dialog.wav" id="7_r1xli"] [ext_resource type="AudioStream" uid="uid://d20ver6nfndbt" path="res://assets/sounds/dialog/start_dialog.wav" id="7_r1xli"]
[ext_resource type="Script" path="res://scripts/failure.gd" id="8_pee3c"]
[ext_resource type="AudioStream" uid="uid://dbw14jkekqjrb" path="res://assets/sounds/dialog/win_dialog.wav" id="8_u6ajb"] [ext_resource type="AudioStream" uid="uid://dbw14jkekqjrb" path="res://assets/sounds/dialog/win_dialog.wav" id="8_u6ajb"]
[ext_resource type="AudioStream" uid="uid://w7jbmkwjvtvx" path="res://assets/sounds/disappoint.wav" id="11_yx3n7"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_soh1s"] [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_soh1s"]
resource_name = "tiles01_black" resource_name = "tiles01_black"
@ -82,8 +84,11 @@ size = Vector3(0.3, 0.5, 2.3)
[sub_resource type="BoxShape3D" id="BoxShape3D_dsbsn"] [sub_resource type="BoxShape3D" id="BoxShape3D_dsbsn"]
size = Vector3(2, 2, 2) size = Vector3(2, 2, 2)
[sub_resource type="BoxShape3D" id="BoxShape3D_0a1av"]
size = Vector3(2, 0.147827, 2)
[sub_resource type="BoxShape3D" id="BoxShape3D_vryv4"] [sub_resource type="BoxShape3D" id="BoxShape3D_vryv4"]
size = Vector3(4, 4, 1) size = Vector3(2, 1, 2)
[node name="LevelPool" type="Node3D"] [node name="LevelPool" type="Node3D"]
@ -159,7 +164,7 @@ libraries = {
} }
[node name="Monitor" parent="." instance=ExtResource("6_qd2wd")] [node name="Monitor" parent="." instance=ExtResource("6_qd2wd")]
transform = Transform3D(-0.877007, 0, -0.480477, 0, 1, 0, 0.480477, 0, -0.877007, -4.23016, 0.344398, -2.70049) transform = Transform3D(-0.877007, 0, -0.480477, 0, 1, 0, 0.480477, 0, -0.877007, -4.23, 0.375, -2.7)
[node name="HoleRim" type="StaticBody3D" parent="."] [node name="HoleRim" type="StaticBody3D" parent="."]
@ -189,9 +194,19 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
[node name="CollisionShape3D" type="CollisionShape3D" parent="WinBox"] [node name="CollisionShape3D" type="CollisionShape3D" parent="WinBox"]
shape = SubResource("BoxShape3D_dsbsn") shape = SubResource("BoxShape3D_dsbsn")
[node name="Failure" type="Area3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 5, -1, -5)
script = ExtResource("8_pee3c")
[node name="Dest" type="Node3D" parent="Failure"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.6415, 2.84072, 0)
[node name="CollisionShape3D" type="CollisionShape3D" parent="Failure"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.926086, 0)
shape = SubResource("BoxShape3D_0a1av")
[node name="DialogTrigger" parent="." instance=ExtResource("6_f2del")] [node name="DialogTrigger" parent="." instance=ExtResource("6_f2del")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.05, 10.5) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.05, 10.5)
group = "players"
[node name="CollisionShape3D" type="CollisionShape3D" parent="DialogTrigger"] [node name="CollisionShape3D" type="CollisionShape3D" parent="DialogTrigger"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0022583, -0.0446777, 0) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0022583, -0.0446777, 0)
@ -206,7 +221,12 @@ stream = ExtResource("7_r1xli")
[node name="WinDialog" type="AudioStreamPlayer3D" parent="Kreb"] [node name="WinDialog" type="AudioStreamPlayer3D" parent="Kreb"]
stream = ExtResource("8_u6ajb") stream = ExtResource("8_u6ajb")
[node name="Disappoint" type="AudioStreamPlayer3D" parent="Kreb"]
stream = ExtResource("11_yx3n7")
max_db = 6.0
[connection signal="body_entered" from="WinBox" to="WinBox" method="_on_body_entered"] [connection signal="body_entered" from="WinBox" to="WinBox" method="_on_body_entered"]
[connection signal="body_entered" from="Failure" to="Failure" method="_on_body_entered"]
[connection signal="activated_once" from="DialogTrigger" to="Kreb/StartDialog" method="play" binds= [0]] [connection signal="activated_once" from="DialogTrigger" to="Kreb/StartDialog" method="play" binds= [0]]
[connection signal="finished" from="Kreb/WinDialog" to="ExitDoor" method="open"] [connection signal="finished" from="Kreb/WinDialog" to="ExitDoor" method="open"]

View file

@ -11,6 +11,7 @@ size = Vector3(0.6, 0.75, 0.6)
[node name="Monitor" type="RigidBody3D" groups=["can_hold", "monitors"]] [node name="Monitor" type="RigidBody3D" groups=["can_hold", "monitors"]]
[node name="monitor012" parent="." instance=ExtResource("1_6l6n4")] [node name="monitor012" parent="." instance=ExtResource("1_6l6n4")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.375, 0)
[node name="@StaticBody3D@17265" parent="monitor012" index="1"] [node name="@StaticBody3D@17265" parent="monitor012" index="1"]
visible = false visible = false
@ -20,7 +21,6 @@ shape = SubResource("ConvexPolygonShape3D_tfpjr")
disabled = true disabled = true
[node name="CollisionShape3D" type="CollisionShape3D" parent="." groups=["can_hold"]] [node name="CollisionShape3D" type="CollisionShape3D" parent="." groups=["can_hold"]]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.374, 0)
shape = SubResource("BoxShape3D_wfrja") shape = SubResource("BoxShape3D_wfrja")
[editable path="monitor012"] [editable path="monitor012"]

26
scripts/failure.gd Normal file
View file

@ -0,0 +1,26 @@
extends Area3D
@onready
var _dialog = $"../Kreb/Disappoint"
@onready
var _dest = $Dest
var stupid_count = 0
func _on_body_entered(body: Node3D) -> void:
if not body.is_in_group('players'):
return
_dialog.play()
_dialog.volume_db = stupid_count * 2.0
body.global_position = _dest.global_position
stupid_count += 1
if stupid_count > 3:
_dialog.reparent(body, false)
_dialog.max_db = 20.0
_dialog.volume_db = 20.0
body.velocity += Vector3.UP * 100.0

View file

@ -36,8 +36,8 @@ var _flashlight: SpotLight3D = $Flashlight
var _paused = false var _paused = false
var _noclip = false var _noclip = false
var _held_object: Object var _held_object: RigidBody3D
var _held_object_distance: float #var _held_object_distance: float
func _ready(): func _ready():
@ -165,7 +165,7 @@ func _apply_air_accel(vel: Vector3, wishvel: Vector3, wishspeed: float, delta: f
func _apply_holding_force(delta): func _apply_holding_force(delta):
var hold_point = _camera.global_position - _camera.global_transform.basis.z * _held_object_distance var hold_point = _camera.global_position - _camera.global_transform.basis.z * 3.0
var delta_position = hold_point - _held_object.global_position var delta_position = hold_point - _held_object.global_position
var move_speed = min(delta_position.length() * hold_force, max_hold_velocity) var move_speed = min(delta_position.length() * hold_force, max_hold_velocity)
_held_object.linear_velocity = delta_position.normalized() * move_speed * delta _held_object.linear_velocity = delta_position.normalized() * move_speed * delta
@ -181,6 +181,7 @@ func _input(event):
if _paused: return if _paused: return
if event.is_action_pressed('noclip'): if event.is_action_pressed('noclip'):
_noclip = not _noclip _noclip = not _noclip
if _noclip: if _noclip:
@ -220,7 +221,7 @@ func _input(event):
other.interact(self) other.interact(self)
if other.is_in_group('can_hold'): if other.is_in_group('can_hold'):
_held_object = other _held_object = other
_held_object_distance = (Vector3(result.position) - _camera.global_position).length() #_held_object_distance = (Vector3(result.position) - _camera.global_position).length()
func force_drop(): func force_drop():