diff --git a/assets/models/enemies/boney/eyes.material b/assets/models/enemies/boney/eyes.material index 348b358..89d988a 100644 Binary files a/assets/models/enemies/boney/eyes.material and b/assets/models/enemies/boney/eyes.material differ diff --git a/assets/models/enemies/boney/head.material b/assets/models/enemies/boney/head.material index dfa1661..0e11aa8 100644 Binary files a/assets/models/enemies/boney/head.material and b/assets/models/enemies/boney/head.material differ diff --git a/assets/shaders/flag.gdshader b/assets/shaders/flag.gdshader index cd18e0d..e997ac9 100644 --- a/assets/shaders/flag.gdshader +++ b/assets/shaders/flag.gdshader @@ -9,6 +9,8 @@ uniform float waves = 4.0; uniform float wave_speed = 1.0; uniform float wave_scale = 0.25; +const mat3 rotation[] = {mat3(1.0)}; + void vertex() { float body = (VERTEX.x) / 2.0; diff --git a/assets/sounds/enemies/uncanny_jumpscare.ogg b/assets/sounds/enemies/uncanny_jumpscare.ogg new file mode 100644 index 0000000..65eb2e4 Binary files /dev/null and b/assets/sounds/enemies/uncanny_jumpscare.ogg differ diff --git a/assets/sounds/enemies/uncanny_jumpscare.ogg.import b/assets/sounds/enemies/uncanny_jumpscare.ogg.import new file mode 100644 index 0000000..ab1356e --- /dev/null +++ b/assets/sounds/enemies/uncanny_jumpscare.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://l6u7480xhrrl" +path="res://.godot/imported/uncanny_jumpscare.ogg-2c0e7b9b33b790e572edf7766a18479f.oggvorbisstr" + +[deps] + +source_file="res://assets/sounds/enemies/uncanny_jumpscare.ogg" +dest_files=["res://.godot/imported/uncanny_jumpscare.ogg-2c0e7b9b33b790e572edf7766a18479f.oggvorbisstr"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/assets/textures/ui/logo.png b/assets/textures/ui/logo.png new file mode 100644 index 0000000..a146a92 Binary files /dev/null and b/assets/textures/ui/logo.png differ diff --git a/assets/textures/ui/logo.png.import b/assets/textures/ui/logo.png.import new file mode 100644 index 0000000..df413a0 --- /dev/null +++ b/assets/textures/ui/logo.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bopw8k88m2g1w" +path="res://.godot/imported/logo.png-d4118e8bb5f85a30da1be236612c9656.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/textures/ui/logo.png" +dest_files=["res://.godot/imported/logo.png-d4118e8bb5f85a30da1be236612c9656.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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 diff --git a/autoloads/scene_manager.tscn b/autoloads/scene_manager.tscn index 7f3b842..0cd08de 100644 --- a/autoloads/scene_manager.tscn +++ b/autoloads/scene_manager.tscn @@ -1,6 +1,7 @@ -[gd_scene load_steps=2 format=3 uid="uid://dxrvocxjk8vs3"] +[gd_scene load_steps=3 format=3 uid="uid://dxrvocxjk8vs3"] [ext_resource type="Script" uid="uid://dno6wobc85qrw" path="res://autoloads/scene_manager.gd" id="1_d112a"] +[ext_resource type="PackedScene" uid="uid://b1yer7h40imop" path="res://ui/game_ui.tscn" id="2_b11xn"] [node name="SceneManager" type="Node" node_paths=PackedStringArray("scene_parent")] script = ExtResource("1_d112a") @@ -12,15 +13,16 @@ anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 +theme_override_constants/separation = 0 -[node name="SideBar" type="Control" parent="HBoxContainer"] +[node name="SideBar" parent="HBoxContainer" instance=ExtResource("2_b11xn")] layout_mode = 2 -size_flags_horizontal = 3 +size_flags_horizontal = 1 [node name="MainView" type="Control" parent="HBoxContainer"] custom_minimum_size = Vector2(288, 216) layout_mode = 2 -size_flags_horizontal = 10 +size_flags_horizontal = 3 [node name="SubViewportContainer" type="SubViewportContainer" parent="HBoxContainer/MainView"] layout_mode = 1 diff --git a/objects/canny_cat.tscn b/objects/canny_cat.tscn index 2140f9b..42f1fb3 100644 --- a/objects/canny_cat.tscn +++ b/objects/canny_cat.tscn @@ -150,77 +150,91 @@ initial_expression_properties = { [node name="Root" type="Node" parent="StateChart"] script = ExtResource("5_ox6hb") +initial_state = NodePath("Active") + +[node name="Active" type="Node" parent="StateChart/Root"] +script = ExtResource("5_ox6hb") initial_state = NodePath("Moving") -[node name="on GoalEntered" type="Node" parent="StateChart/Root"] +[node name="on GoalEntered" type="Node" parent="StateChart/Root/Active"] script = ExtResource("7_epv8h") -to = NodePath("../Winning") +to = NodePath("../../Inactive/Winning") event = &"goal_entered" delay_in_seconds = "0.0" -[node name="on PoleAttached" type="Node" parent="StateChart/Root"] +[node name="on Died" type="Node" parent="StateChart/Root/Active"] +script = ExtResource("7_epv8h") +to = NodePath("../../Inactive/Winning") +event = &"goal_entered" +delay_in_seconds = "0.0" + +[node name="on PoleAttached" type="Node" parent="StateChart/Root/Active"] script = ExtResource("7_epv8h") to = NodePath("../PoleSpinning") event = &"pole_attached" delay_in_seconds = "0.0" -[node name="Idle" type="Node" parent="StateChart/Root"] +[node name="Idle" type="Node" parent="StateChart/Root/Active"] script = ExtResource("6_bu01i") -[node name="on ChargePressed" type="Node" parent="StateChart/Root/Idle"] +[node name="on ChargePressed" type="Node" parent="StateChart/Root/Active/Idle"] script = ExtResource("7_epv8h") to = NodePath("../../Charging") event = &"charge_pressed" delay_in_seconds = "0.0" -[node name="when Moving" type="Node" parent="StateChart/Root/Idle"] +[node name="when Moving" type="Node" parent="StateChart/Root/Active/Idle"] script = ExtResource("7_epv8h") to = NodePath("../../Moving") guard = SubResource("Resource_ej40h") delay_in_seconds = "0.0" -[node name="Moving" type="Node" parent="StateChart/Root"] +[node name="Moving" type="Node" parent="StateChart/Root/Active"] script = ExtResource("6_bu01i") -[node name="when Stopped" type="Node" parent="StateChart/Root/Moving"] +[node name="when Stopped" type="Node" parent="StateChart/Root/Active/Moving"] script = ExtResource("7_epv8h") to = NodePath("../../Idle") guard = SubResource("Resource_637i1") delay_in_seconds = "0.0" -[node name="Charging" type="Node" parent="StateChart/Root"] +[node name="Charging" type="Node" parent="StateChart/Root/Active"] script = ExtResource("6_bu01i") -[node name="on ChargeReleased" type="Node" parent="StateChart/Root/Charging"] +[node name="on ChargeReleased" type="Node" parent="StateChart/Root/Active/Charging"] script = ExtResource("7_epv8h") to = NodePath("../../Moving") event = &"charge_released" delay_in_seconds = "0.0" -[node name="Winning" type="Node" parent="StateChart/Root"] +[node name="PoleSpinning" type="Node" parent="StateChart/Root/Active"] script = ExtResource("6_bu01i") -[node name="PoleSpinning" type="Node" parent="StateChart/Root"] -script = ExtResource("6_bu01i") - -[node name="Transition" type="Node" parent="StateChart/Root/PoleSpinning"] +[node name="Transition" type="Node" parent="StateChart/Root/Active/PoleSpinning"] script = ExtResource("7_epv8h") to = NodePath("../../Moving") event = &"charge_pressed" delay_in_seconds = "0.0" +[node name="Inactive" type="Node" parent="StateChart/Root"] +script = ExtResource("5_ox6hb") +initial_state = NodePath("Winning") + +[node name="Winning" type="Node" parent="StateChart/Root/Inactive"] +script = ExtResource("6_bu01i") + [connection signal="bounced" from="." to="Sounds/WallBounce" method="play"] [connection signal="charge_canceled" from="." to="Sounds/ChargeCancel" method="play"] [connection signal="shot" from="." to="Sounds/Shoot" method="play"] -[connection signal="state_physics_processing" from="StateChart/Root/Idle" to="." method="_apply_gravity"] -[connection signal="state_physics_processing" from="StateChart/Root/Moving" to="." method="_apply_gravity"] -[connection signal="state_physics_processing" from="StateChart/Root/Moving" to="." method="_slow_to_stop"] -[connection signal="state_physics_processing" from="StateChart/Root/Moving" to="." method="_bounce_on_walls"] -[connection signal="state_entered" from="StateChart/Root/Charging" to="." method="_start_charge"] -[connection signal="state_entered" from="StateChart/Root/Charging" to="Sounds/ChargeStart" method="play"] -[connection signal="state_exited" from="StateChart/Root/Charging" to="." method="_end_charge"] -[connection signal="state_physics_processing" from="StateChart/Root/Charging" to="." method="_update_charge"] -[connection signal="state_entered" from="StateChart/Root/Winning" to="." method="_start_winning"] -[connection signal="state_entered" from="StateChart/Root/PoleSpinning" to="." method="_start_pole_spin"] -[connection signal="state_exited" from="StateChart/Root/PoleSpinning" to="." method="_end_pole_spin"] -[connection signal="state_physics_processing" from="StateChart/Root/PoleSpinning" to="." method="_process_pole_spin"] +[connection signal="state_physics_processing" from="StateChart/Root/Active/Idle" to="." method="_apply_gravity"] +[connection signal="state_physics_processing" from="StateChart/Root/Active/Moving" to="." method="_slow_to_stop"] +[connection signal="state_physics_processing" from="StateChart/Root/Active/Moving" to="." method="_apply_gravity"] +[connection signal="state_physics_processing" from="StateChart/Root/Active/Moving" to="." method="_bounce_on_walls"] +[connection signal="state_entered" from="StateChart/Root/Active/Charging" to="." method="_start_charge"] +[connection signal="state_entered" from="StateChart/Root/Active/Charging" to="Sounds/ChargeStart" method="play"] +[connection signal="state_exited" from="StateChart/Root/Active/Charging" to="." method="_end_charge"] +[connection signal="state_physics_processing" from="StateChart/Root/Active/Charging" to="." method="_update_charge"] +[connection signal="state_entered" from="StateChart/Root/Active/PoleSpinning" to="." method="_start_pole_spin"] +[connection signal="state_exited" from="StateChart/Root/Active/PoleSpinning" to="." method="_end_pole_spin"] +[connection signal="state_physics_processing" from="StateChart/Root/Active/PoleSpinning" to="." method="_process_pole_spin"] +[connection signal="state_entered" from="StateChart/Root/Inactive/Winning" to="." method="_start_winning"] diff --git a/objects/skull.tscn b/objects/skull.tscn index 0a14a59..c7407a9 100644 --- a/objects/skull.tscn +++ b/objects/skull.tscn @@ -5,12 +5,11 @@ [ext_resource type="AudioStream" uid="uid://cgotekctoej7m" path="res://assets/sounds/enemies/skull_death.ogg" id="3_6ybas"] [sub_resource type="CylinderShape3D" id="CylinderShape3D_ictao"] -height = 1.0 -radius = 0.8 +height = 0.5 +radius = 0.4 [sub_resource type="CylinderShape3D" id="CylinderShape3D_cdksx"] -height = 1.0 -radius = 0.95 +height = 0.5 [node name="Boney" type="CharacterBody3D" node_paths=PackedStringArray("model", "death_sound")] script = ExtResource("1_ledhy") @@ -23,10 +22,10 @@ model = NodePath("Model") death_sound = NodePath("DeathSound") [node name="Model" parent="." instance=ExtResource("2_lwsb0")] -transform = Transform3D(2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 1.5, 0) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.75, 0) [node name="CollisionShape3D" type="CollisionShape3D" parent="."] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0) shape = SubResource("CylinderShape3D_ictao") [node name="PlayerDetector" type="Area3D" parent="."] @@ -35,7 +34,7 @@ collision_mask = 16 monitorable = false [node name="CollisionShape3D" type="CollisionShape3D" parent="PlayerDetector"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0) shape = SubResource("CylinderShape3D_cdksx") [node name="DeathSound" type="AudioStreamPlayer3D" parent="."] diff --git a/objects/uncanny_cat.gd b/objects/uncanny_cat.gd index baa8cff..beaf36a 100644 --- a/objects/uncanny_cat.gd +++ b/objects/uncanny_cat.gd @@ -1,9 +1,13 @@ extends CharacterBody3D +signal player_caught + + @export var acceleration: float @export var speed: float @export var vertical_speed: float +@export var jumpscare: CanvasLayer func _physics_process(delta: float) -> void: @@ -24,3 +28,8 @@ func _physics_process(delta: float) -> void: var col = move_and_collide(velocity * delta) if col: velocity = velocity.bounce(col.get_normal()) + + +func _on_player_detector_body_entered(body: Node3D) -> void: + if body is Player: + player_caught.emit() diff --git a/objects/uncanny_cat.tscn b/objects/uncanny_cat.tscn index c36c2ad..9ad6ad5 100644 --- a/objects/uncanny_cat.tscn +++ b/objects/uncanny_cat.tscn @@ -1,7 +1,8 @@ -[gd_scene load_steps=6 format=3 uid="uid://bndtsprfwrkau"] +[gd_scene load_steps=7 format=3 uid="uid://bndtsprfwrkau"] [ext_resource type="Script" uid="uid://1mhmcaluavhg" path="res://objects/uncanny_cat.gd" id="1_bsm3e"] [ext_resource type="Texture2D" uid="uid://c2a63sfnh6il" path="res://assets/textures/chaser/uncanny.png" id="2_eotxf"] +[ext_resource type="AudioStream" uid="uid://l6u7480xhrrl" path="res://assets/sounds/enemies/uncanny_jumpscare.ogg" id="3_ixuei"] [sub_resource type="SphereShape3D" id="SphereShape3D_eotxf"] radius = 0.45 @@ -19,7 +20,7 @@ billboard_mode = 1 [sub_resource type="SphereShape3D" id="SphereShape3D_ixuei"] -[node name="UncannyCat" type="CharacterBody3D"] +[node name="UncannyCat" type="CharacterBody3D" node_paths=PackedStringArray("jumpscare")] collision_layer = 32 collision_mask = 32 motion_mode = 1 @@ -27,6 +28,7 @@ script = ExtResource("1_bsm3e") acceleration = 0.6 speed = 1.5 vertical_speed = 0.5 +jumpscare = NodePath("JumpscareLayer") [node name="CollisionShape3D" type="CollisionShape3D" parent="."] shape = SubResource("SphereShape3D_eotxf") @@ -45,3 +47,25 @@ monitorable = false [node name="CollisionShape3D" type="CollisionShape3D" parent="PlayerDetector"] shape = SubResource("SphereShape3D_ixuei") + +[node name="JumpscareLayer" type="CanvasLayer" parent="."] +layer = 2 +visible = false + +[node name="Jumpscare" type="TextureRect" parent="JumpscareLayer"] +texture_filter = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +texture = ExtResource("2_eotxf") +stretch_mode = 6 + +[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."] +stream = ExtResource("3_ixuei") +bus = &"Sounds" + +[connection signal="player_caught" from="." to="JumpscareLayer" method="show"] +[connection signal="player_caught" from="." to="AudioStreamPlayer" method="play"] +[connection signal="body_entered" from="PlayerDetector" to="." method="_on_player_detector_body_entered"] diff --git a/project.godot b/project.godot index 391a0aa..39784fe 100644 --- a/project.godot +++ b/project.godot @@ -59,3 +59,5 @@ charge_shot={ textures/canvas_textures/default_texture_filter=0 renderer/rendering_method="gl_compatibility" renderer/rendering_method.mobile="gl_compatibility" +textures/decals/filter=0 +textures/light_projectors/filter=0 diff --git a/ui/game_ui.tscn b/ui/game_ui.tscn new file mode 100644 index 0000000..8fdc633 --- /dev/null +++ b/ui/game_ui.tscn @@ -0,0 +1,22 @@ +[gd_scene load_steps=2 format=3 uid="uid://b1yer7h40imop"] + +[ext_resource type="Texture2D" uid="uid://bopw8k88m2g1w" path="res://assets/textures/ui/logo.png" id="1_dcmab"] + +[node name="SideBar" type="Control"] +custom_minimum_size = Vector2(92, 216) +layout_mode = 3 +anchors_preset = 0 +size_flags_horizontal = 3 + +[node name="VBoxContainer" type="VBoxContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="TextureRect" type="TextureRect" parent="VBoxContainer"] +layout_mode = 2 +texture = ExtResource("1_dcmab") +stretch_mode = 2