This commit is contained in:
Andriy Yednarovych
2026-02-22 19:26:26 +01:00
parent fd1ff19c4c
commit e877c5f058
211 changed files with 9385 additions and 0 deletions

View File

@@ -0,0 +1,206 @@
[gd_scene format=3 uid="uid://bc7hmfth8je8e"]
[ext_resource type="Script" uid="uid://c7b0f1rtxh6ef" path="res://interactables/dungeon/scripts/barred_door.gd" id="1_2y4v6"]
[ext_resource type="Texture2D" uid="uid://bs2wf6avylmry" path="res://interactables/dungeon/dungeon_props.png" id="1_t1hsr"]
[ext_resource type="AudioStream" uid="uid://cqg2hh5dpvbbf" path="res://interactables/dungeon/bars_open.wav" id="2_1lmnq"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_t1hsr"]
size = Vector2(64, 66)
[sub_resource type="Animation" id="Animation_t1hsr"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [1]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("StaticBody2D/CollisionShape2D:disabled")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
[sub_resource type="Animation" id="Animation_wgpnr"]
resource_name = "close_door"
step = 0.075
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.07692307, 0.15384616, 0.23076925, 0.30769232),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1),
"update": 1,
"values": [5, 4, 3, 2, 1]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("StaticBody2D/CollisionShape2D:disabled")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
tracks/2/type = "audio"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("AudioStreamPlayer2D")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"clips": [{
"end_offset": 0.0,
"start_offset": 0.0,
"stream": ExtResource("2_1lmnq")
}],
"times": PackedFloat32Array(0)
}
tracks/2/use_blend = true
[sub_resource type="Animation" id="Animation_1lmnq"]
resource_name = "closed"
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [1]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("StaticBody2D/CollisionShape2D:disabled")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
[sub_resource type="Animation" id="Animation_7b8gh"]
resource_name = "open_door"
step = 0.075
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.07692308, 0.15384616, 0.23076925, 0.30769232),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1),
"update": 1,
"values": [1, 2, 3, 4, 5]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("StaticBody2D/CollisionShape2D:disabled")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.30769232),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [false, true]
}
tracks/2/type = "audio"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("AudioStreamPlayer2D")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"clips": [{
"end_offset": 0.0,
"start_offset": 0.0,
"stream": ExtResource("2_1lmnq")
}],
"times": PackedFloat32Array(0)
}
tracks/2/use_blend = true
[sub_resource type="Animation" id="Animation_6rn0f"]
resource_name = "opened"
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [5]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("StaticBody2D/CollisionShape2D:disabled")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_6rn0f"]
_data = {
&"RESET": SubResource("Animation_t1hsr"),
&"close_door": SubResource("Animation_wgpnr"),
&"closed": SubResource("Animation_1lmnq"),
&"open_door": SubResource("Animation_7b8gh"),
&"opened": SubResource("Animation_6rn0f")
}
[node name="BarredDoor" type="Node2D" unique_id=2031413673]
script = ExtResource("1_2y4v6")
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=403550058]
position = Vector2(32, -40)
texture = ExtResource("1_t1hsr")
hframes = 7
frame = 1
[node name="StaticBody2D" type="StaticBody2D" parent="." unique_id=1122685930]
collision_layer = 16
collision_mask = 0
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D" unique_id=957511667]
position = Vector2(32, -31)
shape = SubResource("RectangleShape2D_t1hsr")
[node name="AnimationPlayer" type="AnimationPlayer" parent="." unique_id=1329199452]
libraries/ = SubResource("AnimationLibrary_6rn0f")
[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="." unique_id=637726511]

Binary file not shown.

View File

@@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://cqg2hh5dpvbbf"
path="res://.godot/imported/bars_open.wav-e0c7e41fce1e0698d8f47757944327a0.sample"
[deps]
source_file="res://interactables/dungeon/bars_open.wav"
dest_files=["res://.godot/imported/bars_open.wav-e0c7e41fce1e0698d8f47757944327a0.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=2

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bs2wf6avylmry"
path="res://.godot/imported/dungeon_props.png-420811059f32bd32994907959c16b76b.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://interactables/dungeon/dungeon_props.png"
dest_files=["res://.godot/imported/dungeon_props.png-420811059f32bd32994907959c16b76b.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
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/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
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

Binary file not shown.

View File

@@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://d8gubxeubi5s"
path="res://.godot/imported/lever-01.wav-765aef4f552fd0351cf314055bf3f5aa.sample"
[deps]
source_file="res://interactables/dungeon/lever-01.wav"
dest_files=["res://.godot/imported/lever-01.wav-765aef4f552fd0351cf314055bf3f5aa.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=2

Binary file not shown.

View File

@@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://b2dpcmsho44l6"
path="res://.godot/imported/lever-02.wav-0c029282812bbbce3da6359abd9623ea.sample"
[deps]
source_file="res://interactables/dungeon/lever-02.wav"
dest_files=["res://.godot/imported/lever-02.wav-0c029282812bbbce3da6359abd9623ea.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=2

View File

@@ -0,0 +1,195 @@
[gd_scene format=3 uid="uid://c5nlta1d2wt5g"]
[ext_resource type="Texture2D" uid="uid://bs2wf6avylmry" path="res://interactables/dungeon/dungeon_props.png" id="1_onbon"]
[ext_resource type="Script" uid="uid://oyjsrhwdd54n" path="res://interactables/dungeon/scripts/locked_door.gd" id="1_xbbsa"]
[ext_resource type="Resource" uid="uid://q18yuwmxakt8" path="res://items/key_dungeon.tres" id="2_fy1mf"]
[ext_resource type="PackedScene" uid="uid://dqwuowiyehr7d" path="res://general/persistent_data/persistent_data_handler.tscn" id="2_n53nc"]
[ext_resource type="AudioStream" uid="uid://bydopokqnfehy" path="res://interactables/dungeon/locked_door.wav" id="3_y44bh"]
[ext_resource type="AudioStream" uid="uid://b2yrs5ko1vq8k" path="res://interactables/dungeon/unlock_door.wav" id="4_3j3fx"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_onbon"]
size = Vector2(66, 66)
[sub_resource type="Animation" id="Animation_fy1mf"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:visible")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("StaticBody2D/CollisionShape2D:disabled")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
[sub_resource type="Animation" id="Animation_u0hpk"]
resource_name = "close_door"
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:visible")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.20000002),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [false, true]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("StaticBody2D/CollisionShape2D:disabled")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.20000002),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [true, false]
}
[sub_resource type="Animation" id="Animation_y44bh"]
resource_name = "closed"
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:visible")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("StaticBody2D/CollisionShape2D:disabled")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
[sub_resource type="Animation" id="Animation_sugh4"]
resource_name = "open_door"
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:visible")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.20000002),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [true, false]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("StaticBody2D/CollisionShape2D:disabled")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.20000002),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [false, true]
}
[sub_resource type="Animation" id="Animation_3j3fx"]
resource_name = "opened"
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:visible")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("StaticBody2D/CollisionShape2D:disabled")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_u0hpk"]
_data = {
&"RESET": SubResource("Animation_fy1mf"),
&"close_door": SubResource("Animation_u0hpk"),
&"closed": SubResource("Animation_y44bh"),
&"open_door": SubResource("Animation_sugh4"),
&"opened": SubResource("Animation_3j3fx")
}
[sub_resource type="RectangleShape2D" id="RectangleShape2D_xbbsa"]
size = Vector2(32, 20)
[node name="LockedDoor" type="Node2D" unique_id=1609694242]
process_mode = 3
script = ExtResource("1_xbbsa")
key_item = ExtResource("2_fy1mf")
locked_audio = ExtResource("3_y44bh")
open_audio = ExtResource("4_3j3fx")
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=176392408]
position = Vector2(32, -40)
texture = ExtResource("1_onbon")
hframes = 7
[node name="StaticBody2D" type="StaticBody2D" parent="." unique_id=1272712363]
collision_layer = 16
collision_mask = 0
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D" unique_id=891832315]
position = Vector2(31, -31)
shape = SubResource("RectangleShape2D_onbon")
[node name="AnimationPlayer" type="AnimationPlayer" parent="." unique_id=2014387433]
libraries/ = SubResource("AnimationLibrary_u0hpk")
[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="." unique_id=281736276]
[node name="PersistentDataHandler" parent="." unique_id=843808896 instance=ExtResource("2_n53nc")]
[node name="InteractArea" type="Area2D" parent="." unique_id=1674837604]
position = Vector2(31, 0)
collision_layer = 0
collision_mask = 4
monitorable = false
[node name="CollisionShape2D" type="CollisionShape2D" parent="InteractArea" unique_id=799601258]
shape = SubResource("RectangleShape2D_xbbsa")
debug_color = Color(0.64349115, 0.51821285, 0.21126384, 0.41960785)

Binary file not shown.

View File

@@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://bydopokqnfehy"
path="res://.godot/imported/locked_door.wav-caf3adab393867e780403542b5740880.sample"
[deps]
source_file="res://interactables/dungeon/locked_door.wav"
dest_files=["res://.godot/imported/locked_door.wav-caf3adab393867e780403542b5740880.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=2

View File

@@ -0,0 +1,26 @@
[gd_scene format=3 uid="uid://c1a61ng23qg3v"]
[ext_resource type="Script" uid="uid://67xa7gwbduma" path="res://interactables/dungeon/scripts/pressure_plate.gd" id="1_kb1d5"]
[ext_resource type="Texture2D" uid="uid://bs2wf6avylmry" path="res://interactables/dungeon/dungeon_props.png" id="2_upfbp"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_7ay0y"]
size = Vector2(12.75, 13.25)
[node name="PressurePlate" type="Node2D" unique_id=65868926]
z_index = -1
script = ExtResource("1_kb1d5")
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=332345441]
texture = ExtResource("2_upfbp")
region_enabled = true
region_rect = Rect2(416, 64, 32, 32)
[node name="Area2D" type="Area2D" parent="." unique_id=1246654924]
collision_layer = 0
collision_mask = 273
monitorable = false
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D" unique_id=1032513013]
shape = SubResource("RectangleShape2D_7ay0y")
[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="." unique_id=612531040]

Binary file not shown.

View File

@@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://co51e506fkwwr"
path="res://.godot/imported/push_stone.wav-3428979241dd81a4495981a4a02fdaaa.sample"
[deps]
source_file="res://interactables/dungeon/push_stone.wav"
dest_files=["res://.godot/imported/push_stone.wav-3428979241dd81a4495981a4a02fdaaa.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=2
edit/loop_begin=0
edit/loop_end=-1
compress/mode=2

View File

@@ -0,0 +1,28 @@
[gd_scene format=3 uid="uid://c6u7f6xj7pw73"]
[ext_resource type="Script" uid="uid://cg71or2vgu0u8" path="res://interactables/dungeon/scripts/pushable_statue.gd" id="1_1ukbf"]
[ext_resource type="Texture2D" uid="uid://bs2wf6avylmry" path="res://interactables/dungeon/dungeon_props.png" id="2_ddxrk"]
[ext_resource type="AudioStream" uid="uid://co51e506fkwwr" path="res://interactables/dungeon/push_stone.wav" id="3_3imyd"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ddxrk"]
size = Vector2(32, 13)
[node name="PushableStatue" type="RigidBody2D" unique_id=796294784]
collision_layer = 16
collision_mask = 273
gravity_scale = 0.0
lock_rotation = true
script = ExtResource("1_1ukbf")
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1230728072]
position = Vector2(0, 1.5)
shape = SubResource("RectangleShape2D_ddxrk")
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=930532294]
position = Vector2(0, -16)
texture = ExtResource("2_ddxrk")
region_enabled = true
region_rect = Rect2(384, 0, 32, 48)
[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="." unique_id=2057404877]
stream = ExtResource("3_3imyd")

View File

@@ -0,0 +1,14 @@
class_name BarredDoor extends Node2D
@onready var animation_player: AnimationPlayer = $AnimationPlayer
func _ready() -> void:
pass
func open_door() -> void:
animation_player.play("open_door")
pass
func close_door() -> void:
animation_player.play("close_door")

View File

@@ -0,0 +1 @@
uid://c7b0f1rtxh6ef

View File

@@ -0,0 +1,49 @@
class_name LockedDoor extends Node2D
var open := false
@export var key_item: ItemData
@export var locked_audio: AudioStream
@export var open_audio: AudioStream
@onready var animation_player: AnimationPlayer = $AnimationPlayer
@onready var audio: AudioStreamPlayer2D = $AudioStreamPlayer2D
@onready var open_data: PersistentDataHandler = $PersistentDataHandler
@onready var interact_area: Area2D = $InteractArea
func _ready() -> void:
interact_area.area_entered.connect(on_area_entered)
interact_area.area_exited.connect(on_area_exited)
open_data.data_loaded.connect(set_state)
set_state()
func on_open_door() -> void:
if !key_item:
return
var door_unlocked = PlayerManager.INVENTORY_DATA.use_item(key_item)
if door_unlocked:
animation_player.play("open_door")
audio.stream = open_audio
open_data.set_value()
else:
audio.stream = locked_audio
audio.play()
func on_area_entered(_area: Area2D) -> void:
PlayerManager.interact_pressed.connect(on_open_door)
func on_area_exited(_area: Area2D) -> void:
PlayerManager.interact_pressed.disconnect(on_open_door)
func close_door() -> void:
animation_player.play("close_door")
func set_state() -> void:
open = open_data.value
if open:
animation_player.play("opened")
else:
animation_player.play("closed")

View File

@@ -0,0 +1 @@
uid://oyjsrhwdd54n

View File

@@ -0,0 +1,43 @@
class_name PressurePlate extends Node2D
signal activated
signal deactivated
var bodies := 0
var is_active := false
var offset_rectangle: Rect2
@onready var area: Area2D = $Area2D
@onready var audio: AudioStreamPlayer2D = $AudioStreamPlayer2D
@onready var audio_activate: AudioStream = preload("res://interactables/dungeon/lever-01.wav")
@onready var audio_deactivate: AudioStream = preload("res://interactables/dungeon/lever-02.wav")
@onready var sprite: Sprite2D = $Sprite2D
func _ready() -> void:
area.body_entered.connect(on_body_entered)
area.body_exited.connect(on_body_exited)
offset_rectangle = sprite.region_rect
func on_body_entered(_body: Node2D) -> void:
bodies += 1
calc_state_activated()
func on_body_exited(_body: Node2D) -> void:
bodies -= 1
calc_state_activated()
func calc_state_activated() -> void:
if bodies > 0 and !is_active:
is_active = true
sprite.region_rect.position.x = offset_rectangle.position.x - 32
activated.emit()
play_audio(audio_activate)
elif bodies <= 0 and is_active:
is_active = false
sprite.region_rect.position.x = offset_rectangle.position.x
deactivated.emit()
play_audio(audio_deactivate)
func play_audio(stream: AudioStream) -> void:
audio.stream = stream
audio.play()

View File

@@ -0,0 +1 @@
uid://67xa7gwbduma

View File

@@ -0,0 +1,18 @@
class_name PushableStatute extends RigidBody2D
@onready var audio: AudioStreamPlayer2D = $AudioStreamPlayer2D
@export var push_speed := 30.0
var push_direction := Vector2.ZERO :
set = set_push
func _physics_process(_delta: float) -> void:
linear_velocity = push_direction * push_speed
func set_push(new_push_direction: Vector2) -> void:
push_direction = new_push_direction
if push_direction == Vector2.ZERO:
audio.stop()
else:
audio.play()

View File

@@ -0,0 +1 @@
uid://cg71or2vgu0u8

Binary file not shown.

View File

@@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://b2yrs5ko1vq8k"
path="res://.godot/imported/unlock_door.wav-55eae0655d5743384b4e829ad7c7612f.sample"
[deps]
source_file="res://interactables/dungeon/unlock_door.wav"
dest_files=["res://.godot/imported/unlock_door.wav-55eae0655d5743384b4e829ad7c7612f.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=2