Added lever door. Added lever sound
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
extends Door
|
||||
|
||||
|
||||
func toggle() -> void:
|
||||
if _is_closed():
|
||||
_open()
|
||||
else:
|
||||
_close()
|
||||
|
||||
|
||||
func _on_area_entered(_body: Node2D) -> void:
|
||||
if _is_closed():
|
||||
SoundManager.play_sfx_stream(SoundManager.sfx_stream_door_locked, global_position)
|
||||
|
||||
|
||||
func _on_area_exited(_body: Node2D) -> void:
|
||||
pass
|
||||
@@ -0,0 +1 @@
|
||||
uid://dbkeh7pcgqi57
|
||||
@@ -0,0 +1,90 @@
|
||||
[gd_scene format=3 uid="uid://ct6n0u0iegynv"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://b7mhdrj3b6loq" path="res://game/doors/door.tscn" id="1_jgfnv"]
|
||||
[ext_resource type="Script" uid="uid://dbkeh7pcgqi57" path="res://game/doors/lever_door.gd" id="2_fk4ax"]
|
||||
[ext_resource type="Texture2D" uid="uid://sfjjweantpja" path="res://images/level/doors.png" id="3_x1nwx"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_h66js"]
|
||||
atlas = ExtResource("3_x1nwx")
|
||||
region = Rect2(0, 288, 32, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_bylla"]
|
||||
atlas = ExtResource("3_x1nwx")
|
||||
region = Rect2(64, 288, 32, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_xebht"]
|
||||
atlas = ExtResource("3_x1nwx")
|
||||
region = Rect2(32, 288, 32, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_nru66"]
|
||||
atlas = ExtResource("3_x1nwx")
|
||||
region = Rect2(0, 288, 32, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_qwy8m"]
|
||||
atlas = ExtResource("3_x1nwx")
|
||||
region = Rect2(64, 288, 32, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_s3afl"]
|
||||
atlas = ExtResource("3_x1nwx")
|
||||
region = Rect2(0, 288, 32, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_tyoor"]
|
||||
atlas = ExtResource("3_x1nwx")
|
||||
region = Rect2(32, 288, 32, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_0spri"]
|
||||
atlas = ExtResource("3_x1nwx")
|
||||
region = Rect2(64, 288, 32, 48)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_iecf3"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_h66js")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"closed",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_bylla")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_xebht")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_nru66")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"closing",
|
||||
"speed": 10.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_qwy8m")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"open",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_s3afl")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_tyoor")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_0spri")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"opening",
|
||||
"speed": 10.0
|
||||
}]
|
||||
|
||||
[node name="LeverDoor" unique_id=1575363350 instance=ExtResource("1_jgfnv")]
|
||||
script = ExtResource("2_fk4ax")
|
||||
|
||||
[node name="AnimatedSprite2D" parent="." index="2"]
|
||||
sprite_frames = SubResource("SpriteFrames_iecf3")
|
||||
@@ -0,0 +1,6 @@
|
||||
extends AbstractLevel
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
super._ready()
|
||||
$Objects/Lever.switching.connect($Doors/LeverDoor.toggle)
|
||||
@@ -0,0 +1 @@
|
||||
uid://bc114fx0hcb6s
|
||||
@@ -1,6 +1,8 @@
|
||||
[gd_scene format=4 uid="uid://bmn74wc2vophn"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://mpsu4g2b5h3a" path="res://game/levels/abstract_level.tscn" id="1_15okj"]
|
||||
[ext_resource type="Script" uid="uid://bc114fx0hcb6s" path="res://game/levels/test_level.gd" id="2_a2sw7"]
|
||||
[ext_resource type="PackedScene" uid="uid://ct6n0u0iegynv" path="res://game/doors/lever_door.tscn" id="2_r01v2"]
|
||||
[ext_resource type="PackedScene" uid="uid://b3kyqvuxmfn8f" path="res://game/objects/decorative/fireplace.tscn" id="3_tuvkr"]
|
||||
[ext_resource type="PackedScene" uid="uid://g0n5npbt3hb2" path="res://game/doors/circle_door.tscn" id="4_yrqjd"]
|
||||
[ext_resource type="PackedScene" uid="uid://cojxqx5al7kyv" path="res://game/doors/locked_door.tscn" id="5_1skah"]
|
||||
@@ -22,11 +24,12 @@
|
||||
[ext_resource type="PackedScene" uid="uid://bv2gahb4wxgb1" path="res://game/characters/enemies/white_cultist.tscn" id="20_rt0xo"]
|
||||
|
||||
[node name="TestLevel" unique_id=600627332 instance=ExtResource("1_15okj")]
|
||||
script = ExtResource("2_a2sw7")
|
||||
|
||||
[node name="Door" parent="Doors" parent_id_path=PackedInt32Array(1468144392) index="0" unique_id=609778620 instance=ExtResource("11_g1txn")]
|
||||
[node name="LeverDoor" parent="Doors" parent_id_path=PackedInt32Array(1468144392) index="0" unique_id=1575363350 instance=ExtResource("2_r01v2")]
|
||||
position = Vector2(416, -56)
|
||||
|
||||
[node name="Door2" parent="Doors" parent_id_path=PackedInt32Array(1468144392) index="1" unique_id=1324343186 instance=ExtResource("11_g1txn")]
|
||||
[node name="Door" parent="Doors" parent_id_path=PackedInt32Array(1468144392) index="1" unique_id=1324343186 instance=ExtResource("11_g1txn")]
|
||||
position = Vector2(1488, 88)
|
||||
|
||||
[node name="CircleDoor" parent="Doors" parent_id_path=PackedInt32Array(1468144392) index="2" unique_id=2030956679 instance=ExtResource("4_yrqjd")]
|
||||
|
||||
@@ -34,6 +34,7 @@ const MUSIC_BUS = "Music"
|
||||
@export var sfx_stream_jump : AudioStream
|
||||
@export var sfx_stream_key_picked_up : AudioStream
|
||||
@export var sfx_stream_level_completed : AudioStream
|
||||
@export var sfx_stream_lever : AudioStream
|
||||
@export var sfx_stream_player_lost : AudioStream
|
||||
@export var sfx_stream_player_spoted : AudioStream
|
||||
@export var sfx_stream_switch : AudioStream
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
[ext_resource type="AudioStream" uid="uid://dy7qnen5k20mo" path="res://sound/sfx/player_spoted.wav" id="9_q7cyi"]
|
||||
[ext_resource type="AudioStream" uid="uid://dg0t7fwu8u3m2" path="res://sound/sfx/door_unlocking.wav" id="10_lqyhh"]
|
||||
[ext_resource type="AudioStream" uid="uid://capj5pjbrdpw5" path="res://sound/sfx/haze.wav" id="11_13qx5"]
|
||||
[ext_resource type="AudioStream" uid="uid://buv55jfj7qhix" path="res://sound/sfx/lever.wav" id="15_3d1ws"]
|
||||
[ext_resource type="AudioStream" uid="uid://ckmpft46wjgqs" path="res://sound/music/main_menu.wav" id="17_g6nb7"]
|
||||
[ext_resource type="AudioStream" uid="uid://ttemdy7avyh7" path="res://sound/music/gameplay.wav" id="17_l5yxe"]
|
||||
|
||||
@@ -42,6 +43,7 @@ sfx_stream_haze = ExtResource("11_13qx5")
|
||||
sfx_stream_jump = ExtResource("6_22ptj")
|
||||
sfx_stream_key_picked_up = ExtResource("8_wyfta")
|
||||
sfx_stream_level_completed = ExtResource("7_22ptj")
|
||||
sfx_stream_lever = ExtResource("15_3d1ws")
|
||||
sfx_stream_player_lost = ExtResource("8_6ll5c")
|
||||
sfx_stream_player_spoted = ExtResource("9_q7cyi")
|
||||
sfx_stream_switch = ExtResource("7_ab171")
|
||||
|
||||
@@ -41,6 +41,7 @@ func _activate() -> void:
|
||||
_update_animation()
|
||||
hint_sprite.hide()
|
||||
switching.emit()
|
||||
SoundManager.play_sfx_stream(SoundManager.sfx_stream_lever, global_position)
|
||||
|
||||
match _current_state:
|
||||
State.TurnedLeft:
|
||||
|
||||
BIN
Binary file not shown.
@@ -0,0 +1,24 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://buv55jfj7qhix"
|
||||
path="res://.godot/imported/lever.wav-d2af19b03b0cc019ad3ff0c43ed715f5.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://sound/sfx/lever.wav"
|
||||
dest_files=["res://.godot/imported/lever.wav-d2af19b03b0cc019ad3ff0c43ed715f5.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
|
||||
Reference in New Issue
Block a user