diff --git a/.gitignore b/.gitignore index 257440c..4709183 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,2 @@ # Godot 4+ specific ignores .godot/ -*.csproj.old -# Binaries -bin/ -qol-builds/ diff --git a/1bit-game-jam.csproj b/1bit-game-jam.csproj index c627206..b63e5d0 100644 --- a/1bit-game-jam.csproj +++ b/1bit-game-jam.csproj @@ -1,4 +1,4 @@ - + net6.0 true diff --git a/1bit-game-jam.csproj.old.1 b/1bit-game-jam.csproj.old.1 deleted file mode 100644 index d31daf9..0000000 --- a/1bit-game-jam.csproj.old.1 +++ /dev/null @@ -1,7 +0,0 @@ - - - net6.0 - true - bitgamejam - - \ No newline at end of file diff --git a/export_presets.cfg b/export_presets.cfg index dcdae99..80a994c 100644 --- a/export_presets.cfg +++ b/export_presets.cfg @@ -37,7 +37,6 @@ progressive_web_app/icon_512x512="" progressive_web_app/background_color=Color(0, 0, 0, 1) dotnet/include_scripts_content=false dotnet/include_debug_symbols=true -dotnet/embed_build_outputs=false [preset.1] @@ -49,7 +48,7 @@ custom_features="" export_filter="all_resources" include_filter="" exclude_filter="" -export_path="bin/quest-of-light.exe" +export_path="" encryption_include_filters="" encryption_exclude_filters="" encrypt_pck=false @@ -83,7 +82,6 @@ application/product_name="" application/file_description="" application/copyright="" application/trademarks="" -application/export_angle=0 ssh_remote_deploy/enabled=false ssh_remote_deploy/host="user@host_ip" ssh_remote_deploy/port="22" @@ -103,7 +101,6 @@ Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorActi Remove-Item -Recurse -Force '{temp_dir}'" dotnet/include_scripts_content=false dotnet/include_debug_symbols=true -dotnet/embed_build_outputs=false [preset.2] @@ -115,7 +112,7 @@ custom_features="" export_filter="all_resources" include_filter="" exclude_filter="" -export_path="qol-builds/qol.x86_64" +export_path="" encryption_include_filters="" encryption_exclude_filters="" encrypt_pck=false @@ -145,5 +142,4 @@ ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash kill $(pgrep -x -f \"{temp_dir}/{exe_name} {cmd_args}\") rm -rf \"{temp_dir}\"" dotnet/include_scripts_content=false -dotnet/include_debug_symbols=false -dotnet/embed_build_outputs=false +dotnet/include_debug_symbols=true diff --git a/locales/en.mo b/locales/en.mo deleted file mode 100644 index 6b29672..0000000 Binary files a/locales/en.mo and /dev/null differ diff --git a/locales/en.po b/locales/en.po deleted file mode 100644 index c7e2ab2..0000000 --- a/locales/en.po +++ /dev/null @@ -1,36 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: \n" -"POT-Creation-Date: \n" -"PO-Revision-Date: \n" -"Last-Translator: \n" -"Language-Team: \n" -"Language: en\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Poedit 3.4.2\n" - -msgid "Press Start or Enter" -msgstr "Press Start or Enter" - -msgid "by Tea Sanctuary, 2023" -msgstr "by Tea Sanctuary, 2023" - -msgid "CONGRATULATIONS!" -msgstr "CONGRATULATIONS!" - -msgid "" -"It took you\n" -"{0} attempts\n" -"and {1}\n" -"to finish the game." -msgstr "" -"It took you\n" -"{0} attempts\n" -"and {1}\n" -"to finish the game." - -msgid "Thank you for playing! :)" -msgstr "Thank you for playing! :)" diff --git a/locales/ru.mo b/locales/ru.mo deleted file mode 100644 index cb1f675..0000000 Binary files a/locales/ru.mo and /dev/null differ diff --git a/locales/ru.po b/locales/ru.po deleted file mode 100644 index 26b37e8..0000000 --- a/locales/ru.po +++ /dev/null @@ -1,37 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: \n" -"POT-Creation-Date: \n" -"PO-Revision-Date: \n" -"Last-Translator: \n" -"Language-Team: \n" -"Language: ru\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && " -"n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);\n" -"X-Generator: Poedit 3.4.2\n" - -msgid "Press Start or Enter" -msgstr "Нажмите Start или Enter" - -msgid "by Tea Sanctuary, 2023" -msgstr "разработчик: Tea Sanctuary, 2023" - -msgid "CONGRATULATIONS!" -msgstr "ПОЗДРАВЛЯЕМ!" - -msgid "" -"It took you\n" -"{0} attempts\n" -"and {1}\n" -"to finish the game." -msgstr "" -"Вам потребовалось\n" -"{0} попыток\n" -"и {1}\n" -"чтобы пройти игру." - -msgid "Thank you for playing! :)" -msgstr "Спасибо за игру! :)" diff --git a/locales/template.pot b/locales/template.pot deleted file mode 100644 index 1208104..0000000 --- a/locales/template.pot +++ /dev/null @@ -1,17 +0,0 @@ -msgid "" -msgstr "" - -msgid "Press Start or Enter" -msgstr "" - -msgid "by Tea Sanctuary, 2023" -msgstr "" - -msgid "CONGRATULATIONS!" -msgstr "" - -msgid "It took you\n{0} attempts\nand {1}\nto finish the game." -msgstr "" - -msgid "Thank you for playing! :)" -msgstr "" \ No newline at end of file diff --git a/prefabs/enemies/boss/claw.tscn b/prefabs/enemies/boss/claw.tscn index c7782ea..2068990 100644 --- a/prefabs/enemies/boss/claw.tscn +++ b/prefabs/enemies/boss/claw.tscn @@ -27,10 +27,5 @@ shape = SubResource("CircleShape2D_v67co") position = Vector2(-2, 0) shape = SubResource("CircleShape2D_smr3g") -[node name="NavigationAgent2D" type="NavigationAgent2D" parent="."] -avoidance_enabled = true -debug_use_custom = true -debug_path_custom_color = Color(0, 0, 1, 1) - [connection signal="body_entered" from="Area2D" to="." method="_OnEntered"] [connection signal="body_exited" from="Area2D" to="." method="_OnExited"] diff --git a/prefabs/enemies/living_armor.tscn b/prefabs/enemies/living_armor.tscn index 5d9cf09..125417d 100644 --- a/prefabs/enemies/living_armor.tscn +++ b/prefabs/enemies/living_armor.tscn @@ -4,7 +4,7 @@ [ext_resource type="Script" path="res://scripts/enemies/LivingArmor.cs" id="1_ofbsx"] [ext_resource type="PackedScene" uid="uid://cf0wpahgwygxx" path="res://prefabs/light_sense.tscn" id="2_xkyos"] -[sub_resource type="RectangleShape2D" id="RectangleShape2D_8sbby"] +[sub_resource type="RectangleShape2D" id="RectangleShape2D_d1ojb"] size = Vector2(15, 15) [sub_resource type="CircleShape2D" id="CircleShape2D_ex1co"] @@ -33,7 +33,7 @@ polygon = PackedVector2Array(-7, -4, -7, 15, 8, 15, 8, -4, 5, -11, -4, -11) [node name="CollisionShape2D" type="CollisionShape2D" parent="."] position = Vector2(0.5, 7.5) -shape = SubResource("RectangleShape2D_8sbby") +shape = SubResource("RectangleShape2D_d1ojb") [node name="AreaOfSight" type="Area2D" parent="."] @@ -47,11 +47,6 @@ monitorable = false position = Vector2(1, 8) shape = SubResource("CircleShape2D_62y1x") -[node name="NavigationAgent2D" type="NavigationAgent2D" parent="."] -path_desired_distance = 0.1 -target_desired_distance = 0.1 -avoidance_enabled = true - [connection signal="area_entered" from="LightSense" to="." method="_OnLightEntered"] [connection signal="area_exited" from="LightSense" to="." method="_OnLightExited"] [connection signal="body_entered" from="AreaOfSight" to="." method="_OnBodyEntered"] diff --git a/prefabs/enemies/wretched.tscn b/prefabs/enemies/wretched.tscn index 6567d43..967a61b 100644 --- a/prefabs/enemies/wretched.tscn +++ b/prefabs/enemies/wretched.tscn @@ -1,11 +1,11 @@ [gd_scene load_steps=6 format=3 uid="uid://bmyjqerhno5vi"] -[ext_resource type="SpriteFrames" uid="uid://cisc0k30gpx1q" path="res://sprites/enemies/wretched/wretched.tres" id="1_aqrsj"] +[ext_resource type="SpriteFrames" uid="uid://blijqhtsnyq7n" path="res://sprites/enemies/wretched/wretched.tres" id="1_aqrsj"] [ext_resource type="Script" path="res://scripts/enemies/Wretched.cs" id="1_ec388"] [ext_resource type="PackedScene" uid="uid://cf0wpahgwygxx" path="res://prefabs/light_sense.tscn" id="2_16fib"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_svj4b"] -size = Vector2(15, 15) +size = Vector2(24, 16) [sub_resource type="CircleShape2D" id="CircleShape2D_nortt"] radius = 15.0 @@ -28,7 +28,7 @@ frame_progress = 0.776966 polygon = PackedVector2Array(-5, -16, -7, -3, -7, 9, -11, 14, -11, 16, 8, 16, 8, 8, 7, 4, 7, -16) [node name="CollisionShape2D" type="CollisionShape2D" parent="."] -position = Vector2(0, 8) +position = Vector2(1, 8) shape = SubResource("RectangleShape2D_svj4b") [node name="PlayerCollision" type="Area2D" parent="."] @@ -38,13 +38,5 @@ monitorable = false position = Vector2(1, 8) shape = SubResource("CircleShape2D_nortt") -[node name="NavigationAgent2D" type="NavigationAgent2D" parent="."] -path_desired_distance = 0.1 -target_desired_distance = 0.1 -avoidance_enabled = true -avoidance_mask = 2 -debug_use_custom = true -debug_path_custom_color = Color(0, 1, 0, 1) - [connection signal="area_entered" from="LightSense" to="." method="_OnLightEntered"] [connection signal="body_entered" from="PlayerCollision" to="." method="_OnPlayerCollision"] diff --git a/prefabs/entities/pressure_plate.tscn b/prefabs/entities/pressure_plate.tscn index c10c162..91933c3 100644 --- a/prefabs/entities/pressure_plate.tscn +++ b/prefabs/entities/pressure_plate.tscn @@ -1,10 +1,10 @@ [gd_scene load_steps=4 format=3 uid="uid://bj1ixwjdpnooo"] -[ext_resource type="SpriteFrames" uid="uid://8qygv4lq4pjf" path="res://sprites/tiles/floor/pressure_plate.tres" id="1_1wdq4"] +[ext_resource type="SpriteFrames" uid="uid://chfnxa71xs3ww" path="res://sprites/tiles/floor/pressure_plate.tres" id="1_1wdq4"] [ext_resource type="Script" path="res://scripts/entities/PressurePlate.cs" id="1_httlb"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_1jim7"] -size = Vector2(24, 24) +size = Vector2(32, 32) [node name="pressure_plate" type="Area2D"] z_index = -1 diff --git a/prefabs/entities/spikes.tscn b/prefabs/entities/spikes.tscn index 92c188f..6fbfe54 100644 --- a/prefabs/entities/spikes.tscn +++ b/prefabs/entities/spikes.tscn @@ -4,7 +4,7 @@ [ext_resource type="SpriteFrames" uid="uid://uith5rxps4s" path="res://sprites/tiles/floor/spikes/spikes.tres" id="2_t76h0"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_guqiy"] -size = Vector2(24, 24) +size = Vector2(32, 32) [node name="spikes" type="Area2D"] z_index = -1 @@ -12,6 +12,8 @@ script = ExtResource("1_r27mb") [node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] sprite_frames = ExtResource("2_t76h0") +frame = 2 +frame_progress = 1.0 [node name="Sprite2D" type="Sprite2D" parent="AnimatedSprite2D"] diff --git a/prefabs/furniture/door_closed.tscn b/prefabs/furniture/door_closed.tscn index ef75763..ba5c537 100644 --- a/prefabs/furniture/door_closed.tscn +++ b/prefabs/furniture/door_closed.tscn @@ -34,8 +34,6 @@ sprite_frames = SubResource("SpriteFrames_v2loo") animation = &"closed" [node name="StaticBody2D" type="StaticBody2D" parent="."] -collision_layer = 4 -collision_mask = 4 [node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D"] position = Vector2(0, 6) diff --git a/prefabs/player.tscn b/prefabs/player.tscn index eee135d..6666d8f 100644 --- a/prefabs/player.tscn +++ b/prefabs/player.tscn @@ -2,7 +2,7 @@ [ext_resource type="Script" path="res://scripts/Player.cs" id="1_1vpun"] [ext_resource type="SpriteFrames" uid="uid://cfdng3tdv65p6" path="res://sprites/player/player.tres" id="1_8jl58"] -[ext_resource type="SpriteFrames" uid="uid://dqtp1l5ecav4k" path="res://sprites/key_space.tres" id="3_h0r18"] +[ext_resource type="SpriteFrames" uid="uid://2621hqkv4w0x" path="res://sprites/key_space.tres" id="3_h0r18"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_5hhj3"] size = Vector2(15, 15) diff --git a/prefabs/virtual_cursor.tscn b/prefabs/virtual_cursor.tscn deleted file mode 100644 index 9881490..0000000 --- a/prefabs/virtual_cursor.tscn +++ /dev/null @@ -1,10 +0,0 @@ -[gd_scene load_steps=3 format=3 uid="uid://4d6fhm87mn55"] - -[ext_resource type="Script" path="res://scripts/VirtualCursor.cs" id="1_va4ba"] -[ext_resource type="Texture2D" uid="uid://up1nl3dnhadr" path="res://sprites/cursor.png" id="2_k2bth"] - -[node name="VirtualCursor" type="Node2D"] -script = ExtResource("1_va4ba") - -[node name="CursorSprite" type="Sprite2D" parent="."] -texture = ExtResource("2_k2bth") diff --git a/project.godot b/project.godot index 1bc57cd..8dd5ea9 100644 --- a/project.godot +++ b/project.godot @@ -12,7 +12,7 @@ config_version=5 config/name="1bit-game-jam" run/main_scene="res://scenes/menu.tscn" -config/features=PackedStringArray("4.2", "C#", "Mobile") +config/features=PackedStringArray("4.1", "C#", "Mobile") boot_splash/bg_color=Color(0.141176, 0.141176, 0.141176, 1) config/icon="res://icon.svg" @@ -30,7 +30,7 @@ project/assembly_name="1bit-game-jam" character_up={ "deadzone": 0.5, -"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":87,"physical_keycode":87,"key_label":87,"unicode":0,"echo":false,"script":null) +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":0,"echo":false,"script":null) , null, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":11,"pressure":0.0,"pressed":false,"script":null) , Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":-1.0,"script":null) , Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194320,"key_label":0,"unicode":0,"echo":false,"script":null) @@ -63,7 +63,6 @@ character_right={ flashlight_charge={ "deadzone": 0.5, "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":0,"echo":false,"script":null) -, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":10,"pressure":0.0,"pressed":false,"script":null) ] } ui_confirm={ @@ -72,36 +71,6 @@ ui_confirm={ , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":6,"pressure":0.0,"pressed":false,"script":null) ] } -ui_change_language={ -"deadzone": 0.5, -"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":76,"key_label":0,"unicode":108,"echo":false,"script":null) -, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":0,"pressure":0.0,"pressed":false,"script":null) -] -} -cursor_up={ -"deadzone": 0.5, -"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":3,"axis_value":-1.0,"script":null) -] -} -cursor_down={ -"deadzone": 0.5, -"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":3,"axis_value":1.0,"script":null) -] -} -cursor_left={ -"deadzone": 0.5, -"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":2,"axis_value":-1.0,"script":null) -] -} -cursor_right={ -"deadzone": 0.5, -"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":2,"axis_value":1.0,"script":null) -] -} - -[internationalization] - -locale/translations=PackedStringArray("res://locales/en.po", "res://locales/ru.po") [layer_names] diff --git a/scenes/level.tscn b/scenes/level.tscn index 6d09561..dc4f303 100644 --- a/scenes/level.tscn +++ b/scenes/level.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=28 format=3 uid="uid://cn0rwyjern2vx"] +[gd_scene load_steps=23 format=3 uid="uid://cn0rwyjern2vx"] [ext_resource type="Script" path="res://scripts/Level.cs" id="1_cxv3e"] [ext_resource type="TileSet" uid="uid://c7x8hryljgpha" path="res://sprites/tiles/QoL.tres" id="1_kp7y7"] @@ -14,8 +14,8 @@ [ext_resource type="PackedScene" uid="uid://bo5we64scaa1x" path="res://prefabs/furniture/table2.tscn" id="11_43o4k"] [ext_resource type="PackedScene" uid="uid://cvfk53tse4okx" path="res://prefabs/furniture/book.tscn" id="12_7tfnm"] [ext_resource type="PackedScene" uid="uid://ccg3n7sobsvdw" path="res://prefabs/enemies/watcher.tscn" id="13_nbkmp"] -[ext_resource type="PackedScene" uid="uid://bpusphyhhg074" path="res://prefabs/enemies/living_armor.tscn" id="14_4tmmq"] -[ext_resource type="PackedScene" uid="uid://bmyjqerhno5vi" path="res://prefabs/enemies/wretched.tscn" id="15_3rigu"] +[ext_resource type="PackedScene" path="res://prefabs/enemies/living_armor.tscn" id="14_4tmmq"] +[ext_resource type="PackedScene" path="res://prefabs/enemies/wretched.tscn" id="15_3rigu"] [ext_resource type="PackedScene" uid="uid://crulyoxqqw74r" path="res://prefabs/entities/Teleport.tscn" id="16_c6ifr"] [ext_resource type="PackedScene" uid="uid://dteeck6gict0d" path="res://prefabs/entities/teleport_dest.tscn" id="17_0di6y"] [ext_resource type="PackedScene" uid="uid://cpi5lgdlnvhlg" path="res://prefabs/enemies/boss/boss.tscn" id="18_8j1w1"] @@ -24,36 +24,6 @@ [sub_resource type="RectangleShape2D" id="RectangleShape2D_kwmx6"] -[sub_resource type="NavigationPolygon" id="NavigationPolygon_ngvpl"] -vertices = PackedVector2Array(312, -944, 192, -944, 40, -984, 96, -984, 320, -816, 200, -816, 48, -888, 56, -888, 40, -760, 56, -760, 440, -584, -120, -584, -120, -720, 312, -888, 440, -1080, 280, -984, 280, -1032, -72, -760, -120, -1080, 224, -1032, 224, -984, 144, -984, 144, -1032, 96, -1032, 192, -888, 176, -888, 176, -944, 56, -944, -8, -984, 200, -760, 176, -760, 176, -816, 56, -816, -72, -888, 440, -376, 440, -168, 168, -168, 168, -296, -232, -376, -408, -296, -408, -856, -232, -720, -120, -856, -80, -816, 320, -760, -72, -944, 40, -816, 48, -944, -8, -1032, 40, -1032) -polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3), PackedInt32Array(4, 5, 6, 7), PackedInt32Array(8, 9, 10, 11, 12), PackedInt32Array(13, 0, 14, 10, 4), PackedInt32Array(14, 0, 15, 16), PackedInt32Array(17, 8, 12), PackedInt32Array(18, 14, 16, 19), PackedInt32Array(19, 20, 21, 22), PackedInt32Array(18, 19, 22), PackedInt32Array(18, 22, 23), PackedInt32Array(1, 24, 25, 26), PackedInt32Array(2, 1, 26), PackedInt32Array(2, 26, 27, 28), PackedInt32Array(5, 29, 30, 31), PackedInt32Array(6, 5, 31), PackedInt32Array(6, 31, 32, 33), PackedInt32Array(34, 35, 36, 37), PackedInt32Array(38, 34, 37, 39), PackedInt32Array(38, 39, 40, 41), PackedInt32Array(17, 12, 41, 40, 42, 43), PackedInt32Array(29, 44, 10), PackedInt32Array(20, 15, 0), PackedInt32Array(33, 43, 42, 18, 45), PackedInt32Array(30, 29, 10), PackedInt32Array(10, 44, 4), PackedInt32Array(24, 13, 4), PackedInt32Array(9, 30, 10), PackedInt32Array(32, 9, 8, 46), PackedInt32Array(33, 32, 46), PackedInt32Array(33, 46, 43), PackedInt32Array(25, 24, 4), PackedInt32Array(7, 25, 4), PackedInt32Array(27, 7, 6, 47), PackedInt32Array(28, 27, 47), PackedInt32Array(28, 47, 45), PackedInt32Array(28, 45, 18, 48), PackedInt32Array(21, 20, 0), PackedInt32Array(49, 48, 18), PackedInt32Array(49, 18, 23), PackedInt32Array(49, 23, 3, 2), PackedInt32Array(0, 3, 21)]) -outlines = Array[PackedVector2Array]([PackedVector2Array(168, -168, 440, -168, 440, -376, -232, -376, -232, -720, -120, -720, -120, -584, 440, -584, 440, -1080, -120, -1080, -120, -856, -408, -856, -408, -296, 168, -296), PackedVector2Array(-72, -760, 40, -760, 40, -816, -80, -816), PackedVector2Array(56, -816, 56, -760, 176, -760, 176, -816), PackedVector2Array(200, -760, 320, -760, 320, -816, 200, -816), PackedVector2Array(-72, -888, 48, -888, 48, -944, -72, -944), PackedVector2Array(56, -944, 56, -888, 176, -888, 176, -944), PackedVector2Array(192, -888, 312, -888, 312, -944, 192, -944), PackedVector2Array(-8, -984, 40, -984, 40, -1032, -8, -1032), PackedVector2Array(96, -984, 144, -984, 144, -1032, 96, -1032), PackedVector2Array(224, -1032, 224, -984, 280, -984, 280, -1032)]) -source_geometry_group_name = &"navigation_polygon_source_group" - -[sub_resource type="NavigationPolygon" id="NavigationPolygon_v2a1f"] -vertices = PackedVector2Array(897, -96, 897, 129, 607, 129, 607, -96) -polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3)]) -outlines = Array[PackedVector2Array]([PackedVector2Array(607, -96, 607, 129, 897, 129, 897, -96)]) -source_geometry_group_name = &"navigation_polygon_source_group" - -[sub_resource type="NavigationPolygon" id="NavigationPolygon_2d3fn"] -vertices = PackedVector2Array(897, -512, 897, -287, 607, -287, 607, -512) -polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3)]) -outlines = Array[PackedVector2Array]([PackedVector2Array(607, -512, 607, -287, 897, -287, 897, -512)]) -source_geometry_group_name = &"navigation_polygon_source_group" - -[sub_resource type="NavigationPolygon" id="NavigationPolygon_ackae"] -vertices = PackedVector2Array(447, 832, 865, 832, 865, 1153, 447, 1153) -polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3)]) -outlines = Array[PackedVector2Array]([PackedVector2Array(447, 1153, 865, 1153, 865, 832, 447, 832)]) -source_geometry_group_name = &"navigation_polygon_source_group" - -[sub_resource type="NavigationPolygon" id="NavigationPolygon_wwnnq"] -vertices = PackedVector2Array(-48, -1870, 242, -1870, 242, -1645, -48, -1645) -polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3)]) -outlines = Array[PackedVector2Array]([PackedVector2Array(-48, -1645, 242, -1645, 242, -1870, -48, -1870)]) -source_geometry_group_name = &"navigation_polygon_source_group" - [node name="level" type="Node2D"] script = ExtResource("1_cxv3e") @@ -112,15 +82,12 @@ position = Vector2(624, -385) [node name="spikes" parent="." instance=ExtResource("10_yerk5")] position = Vector2(683, -352) -Enabled = true [node name="spikes2" parent="." instance=ExtResource("10_yerk5")] position = Vector2(683, -384) -Enabled = true [node name="spikes3" parent="." instance=ExtResource("10_yerk5")] position = Vector2(683, -415) -Enabled = true [node name="papers2" parent="." instance=ExtResource("5_th514")] position = Vector2(751, 92) @@ -139,39 +106,33 @@ position = Vector2(688, -850) [node name="spikes4" parent="." instance=ExtResource("10_yerk5")] position = Vector2(785, -847) -Enabled = true [node name="spikes5" parent="." instance=ExtResource("10_yerk5")] position = Vector2(847, -847) -Enabled = true [node name="spikes6" parent="." instance=ExtResource("10_yerk5")] position = Vector2(817, -847) -Enabled = true [node name="spikes7" parent="." instance=ExtResource("10_yerk5")] position = Vector2(848, -816) -Enabled = true [node name="spikes8" parent="." instance=ExtResource("10_yerk5")] position = Vector2(848, -783) -Enabled = true [node name="spikes9" parent="." instance=ExtResource("10_yerk5")] position = Vector2(848, -752) -Enabled = true [node name="pressure_plate_puzzle_4_bl" parent="." instance=ExtResource("9_6ydrq")] -position = Vector2(-83, -622) +position = Vector2(-113, -592) [node name="pressure_plate_puzzle_4_br" parent="." instance=ExtResource("9_6ydrq")] -position = Vector2(404, -624) +position = Vector2(432, -592) [node name="pressure_plate_puzzle_4_tl" parent="." instance=ExtResource("9_6ydrq")] -position = Vector2(-87, -1046) +position = Vector2(-110, -1072) [node name="pressure_plate_puzzle_4_tr" parent="." instance=ExtResource("9_6ydrq")] -position = Vector2(413, -1045) +position = Vector2(432, -1071) [node name="door_closed_puzzle_4" parent="." instance=ExtResource("7_kt8g1")] position = Vector2(177, -1112) @@ -295,27 +256,21 @@ position = Vector2(791, 783) [node name="spikes10" parent="." instance=ExtResource("10_yerk5")] position = Vector2(732, 980) -Enabled = true [node name="spikes11" parent="." instance=ExtResource("10_yerk5")] position = Vector2(764, 947) -Enabled = true [node name="spikes12" parent="." instance=ExtResource("10_yerk5")] position = Vector2(796, 915) -Enabled = true [node name="spikes13" parent="." instance=ExtResource("10_yerk5")] position = Vector2(576, 978) -Enabled = true [node name="spikes14" parent="." instance=ExtResource("10_yerk5")] position = Vector2(544, 946) -Enabled = true [node name="spikes15" parent="." instance=ExtResource("10_yerk5")] position = Vector2(512, 915) -Enabled = true [node name="Watcher" parent="." instance=ExtResource("13_nbkmp")] position = Vector2(1489, 566) @@ -342,7 +297,7 @@ position = Vector2(630, -730) position = Vector2(322, -381) [node name="Wretched" parent="." instance=ExtResource("15_3rigu")] -position = Vector2(216, -381) +position = Vector2(181, -383) [node name="Wretched2" parent="." instance=ExtResource("15_3rigu")] position = Vector2(-241, -457) @@ -475,22 +430,6 @@ Facing = 2 [node name="And_puzzle_4" parent="." instance=ExtResource("20_1ng7x")] CountOfButtons = 4 -[node name="NavigationRegion2D" type="NavigationRegion2D" parent="."] -navigation_polygon = SubResource("NavigationPolygon_ngvpl") - -[node name="NavigationRegion2D2" type="NavigationRegion2D" parent="."] -navigation_polygon = SubResource("NavigationPolygon_v2a1f") - -[node name="NavigationRegion2D3" type="NavigationRegion2D" parent="."] -navigation_polygon = SubResource("NavigationPolygon_2d3fn") - -[node name="NavigationRegion2D4" type="NavigationRegion2D" parent="."] -navigation_polygon = SubResource("NavigationPolygon_ackae") - -[node name="NavigationRegion2D5" type="NavigationRegion2D" parent="."] -position = Vector2(655, 942) -navigation_polygon = SubResource("NavigationPolygon_wwnnq") - [connection signal="ButtonPressed" from="pressure_plate_puzzle_1" to="door_closed_puzzle_1" method="Open"] [connection signal="ButtonUnpressed" from="pressure_plate_puzzle_1" to="door_closed_puzzle_1" method="Close"] [connection signal="ButtonPressed" from="pressure_plate_puzzle_2" to="door_closed_puzzle_2" method="Open"] diff --git a/scenes/main_scene.tscn b/scenes/main_scene.tscn index 1cb9bc6..0eb26f9 100644 --- a/scenes/main_scene.tscn +++ b/scenes/main_scene.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=24 format=3 uid="uid://dhn7yt46fyac8"] +[gd_scene load_steps=23 format=3 uid="uid://dhn7yt46fyac8"] [ext_resource type="PackedScene" uid="uid://bhulqhxesd5gc" path="res://prefabs/player.tscn" id="1_65a7v"] [ext_resource type="AudioStream" uid="uid://bsy2d0bl3lgg0" path="res://sounds/crank.ogg" id="1_cweq4"] @@ -11,7 +11,6 @@ [ext_resource type="PackedScene" uid="uid://cn0rwyjern2vx" path="res://scenes/level.tscn" id="5_skctj"] [ext_resource type="Script" path="res://scripts/GameCamera.cs" id="6_quua3"] [ext_resource type="Script" path="res://scripts/PointLight2DWorkaround.cs" id="6_slohe"] -[ext_resource type="PackedScene" uid="uid://4d6fhm87mn55" path="res://prefabs/virtual_cursor.tscn" id="11_xqdcm"] [ext_resource type="Script" path="res://scripts/WinScreen.cs" id="13_prax6"] [ext_resource type="Theme" uid="uid://daxgxg7c8v0ih" path="res://themes/zx_theme.tres" id="14_g1c0r"] [ext_resource type="Script" path="res://scripts/DeathScreen.cs" id="15_12mhe"] @@ -23,7 +22,7 @@ point_count = 2 [sub_resource type="ShaderMaterial" id="ShaderMaterial_m680d"] shader = ExtResource("5_64d71") -[sub_resource type="ViewportTexture" id="ViewportTexture_meb87"] +[sub_resource type="ViewportTexture" id="ViewportTexture_42ps6"] viewport_path = NodePath("FlashlightViewport") [sub_resource type="CircleShape2D" id="CircleShape2D_prnh4"] @@ -47,12 +46,8 @@ height = 192 [node name="Root" type="Node2D"] y_sort_enabled = true -[node name="VirtualCursor" parent="." instance=ExtResource("11_xqdcm")] -position = Vector2(169.203, 958.57) - -[node name="GameManager" type="Node" parent="." node_paths=PackedStringArray("FirstZone", "Player")] +[node name="GameManager" type="Node" parent="." node_paths=PackedStringArray("Player")] script = ExtResource("1_ij566") -FirstZone = NodePath("../Zones/PlayZone1") Player = NodePath("../Player") [node name="Sounds" type="Node" parent="."] @@ -239,16 +234,15 @@ texture = ExtResource("3_8o315") [node name="Triangle" type="Polygon2D" parent="FlashlightViewport/CanvasGroup"] polygon = PackedVector2Array(-21, -25, 31, 29, -42, 31) -[node name="PlayerCamera" type="Camera2D" parent="." node_paths=PackedStringArray("Player", "Cursor")] +[node name="PlayerCamera" type="Camera2D" parent="." node_paths=PackedStringArray("Player")] script = ExtResource("6_quua3") Player = NodePath("../Player") CameraBounds = Vector2(30, 20) -Cursor = NodePath("../VirtualCursor") [node name="PointLight2D" type="PointLight2D" parent="PlayerCamera" node_paths=PackedStringArray("LightViewport")] blend_mode = 2 range_item_cull_mask = 2 -texture = SubResource("ViewportTexture_meb87") +texture = SubResource("ViewportTexture_42ps6") script = ExtResource("6_slohe") LightViewport = NodePath("../../FlashlightViewport") @@ -308,7 +302,7 @@ layout_mode = 0 [node name="MonsterSprite" type="TextureRect" parent="CanvasLayer/DeathScreen"] layout_mode = 0 -[node name="WinScreen" type="TextureRect" parent="CanvasLayer" node_paths=PackedStringArray("Manager", "TextLabel")] +[node name="WinScreen" type="TextureRect" parent="CanvasLayer" node_paths=PackedStringArray("Manager")] visible = false z_index = 15 anchors_preset = 15 @@ -319,7 +313,6 @@ grow_vertical = 2 texture = SubResource("GradientTexture2D_2sbp3") script = ExtResource("13_prax6") Manager = NodePath("../../GameManager") -TextLabel = NodePath("Label2") [node name="Label" type="Label" parent="CanvasLayer/WinScreen"] layout_mode = 1 @@ -334,6 +327,7 @@ horizontal_alignment = 1 vertical_alignment = 1 [node name="Label2" type="Label" parent="CanvasLayer/WinScreen"] +visible = false layout_mode = 1 anchors_preset = 14 anchor_top = 0.5 @@ -366,15 +360,5 @@ horizontal_alignment = 1 vertical_alignment = 1 [connection signal="GameOver" from="GameManager" to="CanvasLayer/WinScreen" method="Open"] -[connection signal="ZoneEntered" from="Zones/PlayZone1" to="GameManager" method="SetCurrentZone"] -[connection signal="ZoneEntered" from="Zones/PlayZone2" to="GameManager" method="SetCurrentZone"] -[connection signal="ZoneEntered" from="Zones/PlayZone3" to="GameManager" method="SetCurrentZone"] -[connection signal="ZoneEntered" from="Zones/PlayZone4" to="GameManager" method="SetCurrentZone"] -[connection signal="ZoneEntered" from="Zones/PlayZone5" to="GameManager" method="SetCurrentZone"] -[connection signal="ZoneEntered" from="Zones/PlayZone6" to="GameManager" method="SetCurrentZone"] -[connection signal="ZoneEntered" from="Zones/PlayZone7" to="GameManager" method="SetCurrentZone"] -[connection signal="ZoneEntered" from="Zones/PlayZone8" to="GameManager" method="SetCurrentZone"] -[connection signal="ZoneEntered" from="Zones/PlayZone9" to="GameManager" method="SetCurrentZone"] -[connection signal="Killed" from="Player" to="GameManager" method="OnPlayerDied"] [connection signal="BossKilled" from="level" to="GameManager" method="EndGame"] [connection signal="timeout" from="CanvasLayer/DeathScreen/Timer" to="CanvasLayer/DeathScreen" method="Timeout"] diff --git a/scenes/menu.tscn b/scenes/menu.tscn index 523feac..298b9f5 100644 --- a/scenes/menu.tscn +++ b/scenes/menu.tscn @@ -281,22 +281,6 @@ text = "Press Start or Enter" horizontal_alignment = 1 vertical_alignment = 1 -[node name="Label2" type="Label" parent="CanvasLayer"] -anchors_preset = 12 -anchor_top = 1.0 -anchor_right = 1.0 -anchor_bottom = 1.0 -offset_top = -18.0 -offset_bottom = 8.00002 -grow_horizontal = 2 -grow_vertical = 0 -rotation = -0.001216 -auto_translate = false -theme = ExtResource("3_d3ur4") -text = "Press L to change language" -horizontal_alignment = 1 -vertical_alignment = 1 - [node name="Flash" type="TextureRect" parent="CanvasLayer"] clip_children = 2 material = SubResource("ShaderMaterial_eqq24") diff --git a/scripts/DeathScreen.cs b/scripts/DeathScreen.cs index 9f2071c..e8854f8 100644 --- a/scripts/DeathScreen.cs +++ b/scripts/DeathScreen.cs @@ -41,7 +41,6 @@ public partial class DeathScreen : TextureRect _playerSprite.Texture = animatedSprite2D.SpriteFrames.GetFrameTexture(animatedSprite2D.Animation, animatedSprite2D.Frame); _playerSprite.Position -= _playerSprite.Texture.GetSize() / 2; - _playerSprite.FlipH = animatedSprite2D.FlipH; } if (killer.FindChild("AnimatedSprite2D") is AnimatedSprite2D killerAnimatedSprite2D) @@ -50,7 +49,6 @@ public partial class DeathScreen : TextureRect _monsterSprite.Texture = killerAnimatedSprite2D.SpriteFrames.GetFrameTexture(killerAnimatedSprite2D.Animation, killerAnimatedSprite2D.Frame); _monsterSprite.Position -= _monsterSprite.Texture.GetSize() / 2; - _monsterSprite.FlipH = killerAnimatedSprite2D.FlipH; } Visible = true; diff --git a/scripts/Flashlight.cs b/scripts/Flashlight.cs index 6dd8fa8..c506ab2 100644 --- a/scripts/Flashlight.cs +++ b/scripts/Flashlight.cs @@ -1,5 +1,4 @@ using System; -using System.Diagnostics; using Godot; public partial class Flashlight : Node @@ -24,7 +23,7 @@ public partial class Flashlight : Node [Export] public Curve BrightnessCurve; [Export] public AudioStreamPlayer CrankSoundPlayer; - + private float FlashlightRadius = Constants.MaxFlashlightRadius; private float FlashlightEnergy = 0; private float FlashlightChargeTimeout = 1; diff --git a/scripts/GameCamera.cs b/scripts/GameCamera.cs index 8be510d..52f7e7b 100644 --- a/scripts/GameCamera.cs +++ b/scripts/GameCamera.cs @@ -1,4 +1,3 @@ -using System.Diagnostics; using Godot; public partial class GameCamera : Camera2D @@ -7,10 +6,7 @@ public partial class GameCamera : Camera2D [Export] public Vector2 CameraBounds = new(40, 30); [Export] public Vector2 CameraFollowBounds = new(20, 10); [Export] public float Speed = 0.5f; - - [Export] public VirtualCursor Cursor; - [Export] public const float CursorSpeed = 2.0f; - + /// /// World position of the flashlight /// @@ -18,12 +14,6 @@ public partial class GameCamera : Camera2D public override void _PhysicsProcess(double delta) { - Vector2 direction = Input.GetVector("cursor_left", "cursor_right", "cursor_up", "cursor_down"); - if (direction != Vector2.Zero) - { - FlashlightPosition += direction * CursorSpeed; - } - var difference = Vector2.Zero; var relativePlayerPosition = Player.Position - Position; @@ -49,8 +39,6 @@ public partial class GameCamera : Camera2D Position = (Position + difference).Round(); FlashlightPosition = (FlashlightPosition + difference).Round(); - Cursor.Position = FlashlightPosition; - } public override void _Input(InputEvent @event) @@ -60,7 +48,6 @@ public partial class GameCamera : Camera2D if (@event is InputEventMouseMotion eventMouseMotion) { FlashlightPosition = eventMouseMotion.Position - Constants.HalfScreenSize + Position; - //Cursor.Position = eventMouseMotion.Position - Constants.HalfScreenSize + Position; } } } diff --git a/scripts/GameManager.cs b/scripts/GameManager.cs index 09e069c..35a3866 100644 --- a/scripts/GameManager.cs +++ b/scripts/GameManager.cs @@ -8,17 +8,11 @@ public partial class GameManager : Node public ulong GameStart = 0; public ulong GameEnd = 0; public int Attempts = 0; - public NodePath Checkpoint = new NodePath(); + public Node2D Checkpoint; - public GameInfo(NodePath path) + public GameInfo(Node2D checkpoint) { - SetCheckpoint(path); - } - - public void SetCheckpoint(NodePath path) - { - GD.Print($"{path}"); - Checkpoint = path; + Checkpoint = checkpoint; } } @@ -36,10 +30,8 @@ public partial class GameManager : Node { if (!IsPlaying) { - GD.Print("Restart stats"); IsPlaying = true; - _gameInfo = new GameInfo(GetPathTo(FirstZone.PlayerSpawnPoint)); - _gameInfo.GameStart = Time.GetTicksMsec(); + _gameInfo = new GameInfo(FirstZone.PlayerSpawnPoint); } StartGame(); @@ -47,21 +39,19 @@ public partial class GameManager : Node public void StartGame() { - Player.GlobalPosition = GetNode(_gameInfo.Checkpoint).GlobalPosition; + _gameInfo.GameStart = Time.GetTicksMsec(); + Player.Position = _gameInfo.Checkpoint.GlobalPosition; } public void EndGame() { _gameInfo.GameEnd = Time.GetTicksMsec(); - Player.Invincible = true; - Player.SetProcess(false); - EmitSignal(SignalName.GameOver); } public string GetFormattedTimeElapsed() => - TimeSpan.FromMilliseconds(_gameInfo.GameEnd - _gameInfo.GameStart).ToString(@"hh\:mm\:ss\.fff"); + TimeSpan.FromMilliseconds(_gameInfo.GameEnd - _gameInfo.GameStart).ToString(@"hh\:mm\:ss.fff"); public void OnPlayerDied() => _gameInfo.Attempts++; @@ -70,7 +60,6 @@ public partial class GameManager : Node public void SetCurrentZone(PlayZone zone) { GD.Print($"New zone {zone}"); - var path = GetPathTo(zone.PlayerSpawnPoint); - _gameInfo.SetCheckpoint(path); + _gameInfo.Checkpoint = zone.PlayerSpawnPoint; } } diff --git a/scripts/Menu.cs b/scripts/Menu.cs index 9fc4132..ca2fb38 100644 --- a/scripts/Menu.cs +++ b/scripts/Menu.cs @@ -1,22 +1,13 @@ -using System.Collections.Generic; using Godot; -using Godot.Collections; public partial class Menu : Node2D { private Timer _timer; private AudioStreamPlayer2D _thunderclap; private AnimationPlayer _animationPlayer; - private Array _translations = new Array{"en", "ru"}; - private int _languagesCount; - private int _currentLanguage = 0; - private Resource _cursorTexture; public override void _Ready() { - TranslationServer.SetLocale("en"); - _languagesCount = _translations.Count; - _timer = (Timer)FindChild("Timer"); _thunderclap = (AudioStreamPlayer2D)FindChild("Thunderclap"); _animationPlayer = (AnimationPlayer)FindChild("AnimationPlayer"); @@ -32,14 +23,6 @@ public partial class Menu : Node2D _animationPlayer.Play("thunder"); _thunderclap.Play(); _timer.Start(); - DisplayServer.MouseSetMode(DisplayServer.MouseMode.Hidden); - } - else if (@event.IsActionPressed("ui_change_language")) - { - _currentLanguage++; - if (_currentLanguage >= _languagesCount) - _currentLanguage = 0; - TranslationServer.SetLocale(_translations[_currentLanguage]); } } diff --git a/scripts/PlayZone.cs b/scripts/PlayZone.cs index aeab63d..9fb3cd7 100644 --- a/scripts/PlayZone.cs +++ b/scripts/PlayZone.cs @@ -16,12 +16,9 @@ public partial class PlayZone : Node2D private Area2D _area2D; private CollisionShape2D _collisionShape2D; - //private GameManager _gameManager; public override void _Ready() { - //_gameManager = (GameManager)GetTree().Root.FindChild("GameManager"); - _area2D = (Area2D)FindChild("Area2D"); _collisionShape2D = (CollisionShape2D)FindChild("CollisionShape2D"); diff --git a/scripts/Player.cs b/scripts/Player.cs index 1fa02b4..aaa51a5 100644 --- a/scripts/Player.cs +++ b/scripts/Player.cs @@ -8,7 +8,6 @@ public partial class Player : CharacterBody2D public delegate void KilledEventHandler(); public bool Alive = true; - public bool Invincible = false; public static Player Instance { get; private set; } @@ -66,7 +65,7 @@ public partial class Player : CharacterBody2D public void Kill(Node2D killer) { - if (!Alive || Invincible) + if (!Alive) return; GD.Print($"Killed by {killer.Name}"); diff --git a/scripts/VirtualCursor.cs b/scripts/VirtualCursor.cs deleted file mode 100644 index 386faeb..0000000 --- a/scripts/VirtualCursor.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Godot; -using System; - -public partial class VirtualCursor : Node2D -{ - //[Export] public Node2D Cursor; - - protected Sprite2D CursorSprite; - // Called when the node enters the scene tree for the first time. - public override void _Ready() - { - CursorSprite = (Sprite2D)FindChild("CursorSprite"); - } - - // Called every frame. 'delta' is the elapsed time since the previous frame. - public override void _Process(double delta) - { - - } - - public override void _Input(InputEvent @event) - { - // base._Input(@event); - // - // if (@event is InputEventMouseMotion eventMouseMotion) - // { - // CursorSprite.Position = eventMouseMotion.Position - Constants.HalfScreenSize + Position; - // } - } -} diff --git a/scripts/WinScreen.cs b/scripts/WinScreen.cs index 2e7723e..62c1790 100644 --- a/scripts/WinScreen.cs +++ b/scripts/WinScreen.cs @@ -4,7 +4,6 @@ using System; public partial class WinScreen : TextureRect { [Export] public GameManager Manager; - [Export] public Label TextLabel; public override void _Ready() { @@ -15,10 +14,8 @@ public partial class WinScreen : TextureRect { Visible = true; - TextLabel.Text = - string.Format(Tr("It took you\n{0} attempts\nand {1}\nto finish the game."), - Manager.GetAttempts(), - Manager.GetFormattedTimeElapsed()); + ((Label)FindChild("Label2")).Text = + $"It took you\n{Manager.GetAttempts()} attempts\nand {Manager.GetFormattedTimeElapsed()}\nto finish the game."; } public override void _Input(InputEvent @event) diff --git a/scripts/enemies/Claw.cs b/scripts/enemies/Claw.cs index bd6ba5b..bcb1525 100644 --- a/scripts/enemies/Claw.cs +++ b/scripts/enemies/Claw.cs @@ -17,14 +17,11 @@ public partial class Claw : CharacterBody2D private float _stateTimeout = 0; private bool _isPlayerNearBy = false; private AnimatedSprite2D _sprite; - private NavigationAgent2D _nav; // Called when the node enters the scene tree for the first time. public override void _Ready() { _sprite = (AnimatedSprite2D)FindChild("AnimatedSprite2D"); - _nav = (NavigationAgent2D)FindChild("NavigationAgent2D"); - _nav.VelocityComputed += OnNavVelocityCompute; } // Called every frame. 'delta' is the elapsed time since the previous frame. @@ -41,11 +38,10 @@ public partial class Claw : CharacterBody2D break; case State.Moving: - _nav.TargetPosition = Player.Instance.Position; - var direction = (_nav.GetNextPathPosition() - Position).Normalized(); + var direction = (Player.Instance.Position - Position).Normalized(); + Velocity = direction * MovingSpeed; _sprite.FlipH = Velocity.X < 0.001f; _sprite.Play("default"); - _nav.Velocity = direction * MovingSpeed; MoveAndSlide(); break; case State.Prepare: @@ -91,9 +87,4 @@ public partial class Claw : CharacterBody2D GD.Print("Boss enabled"); _state = State.Moving; } - - private void OnNavVelocityCompute(Vector2 safeVelocity) - { - Velocity = safeVelocity; - } } diff --git a/scripts/enemies/LivingArmor.cs b/scripts/enemies/LivingArmor.cs index c773dc8..0f43f3d 100644 --- a/scripts/enemies/LivingArmor.cs +++ b/scripts/enemies/LivingArmor.cs @@ -48,7 +48,6 @@ public partial class LivingArmor : CharacterBody2D private State _state; private float _timeSinceState; private AnimatedSprite2D _sprite; - private NavigationAgent2D _nav; private bool _isLitUp; //private readonly List _bodiesInSight = new List(); private readonly List _bodiesInSight = new List(); @@ -59,8 +58,6 @@ public partial class LivingArmor : CharacterBody2D public override void _Ready() { _sprite = (AnimatedSprite2D)FindChild("AnimatedSprite2D"); - _nav = (NavigationAgent2D)FindChild("NavigationAgent2D"); - _nav.VelocityComputed += OnNavVelocityCompute; _respawnPosition = Position; CurrentState = State.Waiting; var animationName = "side_walk"; @@ -81,7 +78,6 @@ public partial class LivingArmor : CharacterBody2D _sprite.Play(animationName); _sprite.Stop(); - } public override void _Process(double delta) @@ -131,15 +127,13 @@ public partial class LivingArmor : CharacterBody2D } break; } - if (_target is null) { _state = State.Waiting; return; } - - _nav.TargetPosition = _target.Position; - var direction = (_nav.GetNextPathPosition() - GlobalPosition).Normalized(); + var direction = (_target.Position - Position).Normalized(); + Velocity = direction * MovingSpeed; var animationName = "side_walk"; @@ -153,8 +147,8 @@ public partial class LivingArmor : CharacterBody2D _sprite.FlipH = Velocity.X < 0.001f && animationName == "side_walk"; _sprite.Play(animationName); - _nav.Velocity = direction * MovingSpeed; MoveAndSlide(); + //MoveAndCollide(direction); break; } @@ -258,11 +252,5 @@ public partial class LivingArmor : CharacterBody2D Position = _respawnPosition; // QueueFree(); // TODO } - - private void OnNavVelocityCompute(Vector2 safeVelocity) - { - Velocity = safeVelocity; - } - } diff --git a/scripts/enemies/Wretched.cs b/scripts/enemies/Wretched.cs index da29cc0..9e959ee 100644 --- a/scripts/enemies/Wretched.cs +++ b/scripts/enemies/Wretched.cs @@ -50,14 +50,11 @@ public partial class Wretched : CharacterBody2D private State _state; private float _timeSinceState; private AnimatedSprite2D _sprite; - private NavigationAgent2D _nav; private bool _isActivated; public override void _Ready() { _sprite = (AnimatedSprite2D)FindChild("AnimatedSprite2D"); - _nav = (NavigationAgent2D)FindChild("NavigationAgent2D"); - _nav.VelocityComputed += OnNavVelocityCompute; CurrentState = State.Waiting; var animationName = "NonActivatedSide"; switch (Facing) @@ -96,8 +93,8 @@ public partial class Wretched : CharacterBody2D break; case State.Moving: - _nav.TargetPosition = Player.Instance.Position; - var direction = (_nav.GetNextPathPosition() - Position).Normalized(); + var direction = (Player.Instance.Position - Position).Normalized(); + Velocity = direction * MovingSpeed; var animationName = "ActivatedSide"; @@ -111,7 +108,6 @@ public partial class Wretched : CharacterBody2D _sprite.FlipH = Velocity.X < 0.001f && animationName == "ActivatedSide"; _sprite.Play(animationName); - _nav.Velocity = direction * MovingSpeed; MoveAndSlide(); break; } @@ -162,9 +158,4 @@ public partial class Wretched : CharacterBody2D EmitSignal(SignalName.Killed); QueueFree(); // TODO } - - private void OnNavVelocityCompute(Vector2 safeVelocity) - { - Velocity = safeVelocity; - } } diff --git a/scripts/entities/And.cs b/scripts/entities/And.cs index 83c05d9..e3a4ddc 100644 --- a/scripts/entities/And.cs +++ b/scripts/entities/And.cs @@ -15,15 +15,13 @@ public partial class And : Node public void Increment() { _buttons++; - GD.Print($"Increment {_buttons}/{CountOfButtons}"); if (_buttons == CountOfButtons) - EmitSignal(SignalName.ConditionMet); + EmitSignal(SignalName.ConditionNotMet); } public void Decrement() { _buttons--; - GD.Print($"Decrement {_buttons}/{CountOfButtons}"); if (_buttons != CountOfButtons) EmitSignal(SignalName.ConditionNotMet); } diff --git a/scripts/entities/Door.cs b/scripts/entities/Door.cs index 122c0d3..05868d3 100644 --- a/scripts/entities/Door.cs +++ b/scripts/entities/Door.cs @@ -3,18 +3,12 @@ using Godot; public partial class Door : Node2D { private AnimatedSprite2D _animatedSprite2D; - private StaticBody2D _staticBody2D; - - private uint _collisionMask; - private uint _collisionLayer; + private CollisionShape2D _collisionShape2D; public override void _Ready() { _animatedSprite2D = (AnimatedSprite2D)FindChild("AnimatedSprite2D"); - _staticBody2D = (StaticBody2D)FindChild("StaticBody2D"); - - _collisionMask = _staticBody2D.CollisionMask; - _collisionLayer = _staticBody2D.CollisionLayer; + _collisionShape2D = (CollisionShape2D)FindChild("CollisionShape2D"); Close(); } @@ -22,16 +16,12 @@ public partial class Door : Node2D public void Close() { _animatedSprite2D.Play("close"); - - _staticBody2D.CollisionMask = _collisionMask; - _staticBody2D.CollisionLayer = _collisionLayer; + _collisionShape2D.Disabled = false; } public void Open() { _animatedSprite2D.Play("open"); - - _staticBody2D.CollisionMask = 0; - _staticBody2D.CollisionLayer = 0; + _collisionShape2D.Disabled = true; } } diff --git a/scripts/entities/Spikes.cs b/scripts/entities/Spikes.cs index 08f9779..8bb0e1b 100644 --- a/scripts/entities/Spikes.cs +++ b/scripts/entities/Spikes.cs @@ -13,7 +13,7 @@ public partial class Spikes : Area2D } [Export] public bool Enabled = false; - [Export] public float SpikesTimeout = 2f; + [Export] public float SpikesTimeout = 1f; [Export] public float StartOffset = 0f; private AnimatedSprite2D _sprite; private State _state = State.Waiting; @@ -40,7 +40,7 @@ public partial class Spikes : Area2D switch (_state) { case State.Waiting: - _sprite.Play("default"); + _sprite.Stop(); _timeSinceState += (float)delta; if (_timeSinceState > SpikesTimeout) { @@ -49,12 +49,11 @@ public partial class Spikes : Area2D } break; case State.Opening: - _sprite.Play("activated"); + _sprite.Play("default"); KillBodiesOnButton(); break; case State.Closing: - _sprite.PlayBackwards("activated"); - KillBodiesOnButton(); + _sprite.PlayBackwards("default"); break; } } diff --git a/sprites/cursor.png b/sprites/cursor.png deleted file mode 100644 index f7d1aca..0000000 Binary files a/sprites/cursor.png and /dev/null differ diff --git a/sprites/cursor.png.import b/sprites/cursor.png.import deleted file mode 100644 index 3474851..0000000 --- a/sprites/cursor.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://up1nl3dnhadr" -path="res://.godot/imported/cursor.png-ab659432fe95e81e8963a978cc7193a5.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://sprites/cursor.png" -dest_files=["res://.godot/imported/cursor.png-ab659432fe95e81e8963a978cc7193a5.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/sprites/key_space.tres b/sprites/key_space.tres index a2f8c35..b517e13 100644 --- a/sprites/key_space.tres +++ b/sprites/key_space.tres @@ -1,4 +1,4 @@ -[gd_resource type="SpriteFrames" load_steps=4 format=3 uid="uid://dqtp1l5ecav4k"] +[gd_resource type="SpriteFrames" load_steps=4 format=3 uid="uid://2621hqkv4w0x"] [ext_resource type="Texture2D" uid="uid://geiagnq38try" path="res://sprites/key_space.png" id="1_xhlet"] diff --git a/sprites/tiles/floor/spikes/spikes.tres b/sprites/tiles/floor/spikes/spikes.tres index d417279..c83293e 100644 --- a/sprites/tiles/floor/spikes/spikes.tres +++ b/sprites/tiles/floor/spikes/spikes.tres @@ -2,6 +2,10 @@ [ext_resource type="Texture2D" uid="uid://l3v1hs32uxfp" path="res://sprites/tiles/floor/spikes/spikes_0001-sheet.png" id="1_xhodh"] +[sub_resource type="AtlasTexture" id="AtlasTexture_ebjk6"] +atlas = ExtResource("1_xhodh") +region = Rect2(64, 0, 32, 32) + [sub_resource type="AtlasTexture" id="AtlasTexture_my1hb"] atlas = ExtResource("1_xhodh") region = Rect2(32, 0, 32, 32) @@ -10,28 +14,19 @@ region = Rect2(32, 0, 32, 32) atlas = ExtResource("1_xhodh") region = Rect2(0, 0, 32, 32) -[sub_resource type="AtlasTexture" id="AtlasTexture_qhlyu"] -atlas = ExtResource("1_xhodh") -region = Rect2(64, 0, 32, 32) - [resource] animations = [{ "frames": [{ "duration": 1.0, +"texture": SubResource("AtlasTexture_ebjk6") +}, { +"duration": 1.0, "texture": SubResource("AtlasTexture_my1hb") }, { "duration": 1.0, "texture": SubResource("AtlasTexture_nfdn1") }], "loop": false, -"name": &"activated", -"speed": 2.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_qhlyu") -}], -"loop": true, "name": &"default", -"speed": 5.0 +"speed": 3.0 }]