From 6d0416b8e8ae1e4cf89e42d28070a1a28d2bbddd Mon Sep 17 00:00:00 2001 From: Ruslan Ignatov Date: Fri, 16 Jan 2026 22:30:01 +0300 Subject: [PATCH] Improved control tips --- game/levels/level_1.tscn | 30 ++++----- game/levels/level_2.tscn | 16 ++--- game/levels/level_4.tscn | 13 +--- game/levels/test_level.tscn | 6 +- game/managers/input_manager.gd | 62 +++++++++++++++++++ game/managers/input_manager.gd.uid | 1 + game/managers/input_manager.tscn | 6 ++ game/menu/main_menu.tscn | 2 +- game/objects/bookstand.tscn | 2 +- game/objects/cabinet.tscn | 2 +- game/objects/candle.tscn | 12 ---- game/objects/candles.tscn | 12 ---- game/objects/chair_b.tscn | 2 +- game/objects/chair_f.tscn | 2 +- game/objects/chair_l.tscn | 2 +- game/objects/chair_r.tscn | 2 +- game/objects/flask_l.tscn | 2 +- game/objects/flask_s.tscn | 2 +- game/objects/mirror_l.tscn | 2 +- game/objects/mirror_s.tscn | 2 +- game/objects/plate.tscn | 2 +- game/objects/redort_end_l.tscn | 2 +- game/objects/retort_end_r.tscn | 2 +- game/objects/retort_l.tscn | 2 +- game/objects/retort_r.tscn | 2 +- game/objects/table_l.tscn | 2 +- game/objects/table_m.tscn | 2 +- game/objects/table_s.tscn | 2 +- game/objects/tutorial/abstract_action_tip.gd | 21 +++++++ .../tutorial/abstract_action_tip.gd.uid | 1 + .../objects/tutorial/abstract_action_tip.tscn | 10 +++ game/objects/tutorial/arrow_down.tscn | 12 ---- game/objects/tutorial/arrow_left.tscn | 12 ---- game/objects/tutorial/arrow_right.tscn | 12 ---- game/objects/tutorial/arrow_up.tscn | 12 ---- .../tutorial/interaction_action_tip.tscn | 20 ++++++ game/objects/tutorial/jump_action_tip.tscn | 20 ++++++ .../objects/tutorial/movement_action_tip.tscn | 20 ++++++ game/objects/tutorial/switch_action_tip.tscn | 20 ++++++ game/objects/wardrobe.tscn | 2 +- images/level/objects.png | 4 +- project.godot | 1 + 42 files changed, 225 insertions(+), 138 deletions(-) create mode 100644 game/managers/input_manager.gd create mode 100644 game/managers/input_manager.gd.uid create mode 100644 game/managers/input_manager.tscn delete mode 100644 game/objects/candle.tscn delete mode 100644 game/objects/candles.tscn create mode 100644 game/objects/tutorial/abstract_action_tip.gd create mode 100644 game/objects/tutorial/abstract_action_tip.gd.uid create mode 100644 game/objects/tutorial/abstract_action_tip.tscn delete mode 100644 game/objects/tutorial/arrow_down.tscn delete mode 100644 game/objects/tutorial/arrow_left.tscn delete mode 100644 game/objects/tutorial/arrow_right.tscn delete mode 100644 game/objects/tutorial/arrow_up.tscn create mode 100644 game/objects/tutorial/interaction_action_tip.tscn create mode 100644 game/objects/tutorial/jump_action_tip.tscn create mode 100644 game/objects/tutorial/movement_action_tip.tscn create mode 100644 game/objects/tutorial/switch_action_tip.tscn diff --git a/game/levels/level_1.tscn b/game/levels/level_1.tscn index 3f0122a..dc57c84 100644 --- a/game/levels/level_1.tscn +++ b/game/levels/level_1.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=28 format=4 uid="uid://dlpi1ptis3wna"] +[gd_scene load_steps=26 format=4 uid="uid://dlpi1ptis3wna"] [ext_resource type="PackedScene" uid="uid://mpsu4g2b5h3a" path="res://game/levels/abstract_level.tscn" id="1_15okj"] [ext_resource type="PackedScene" uid="uid://cojxqx5al7kyv" path="res://game/doors/locked_door.tscn" id="2_4ocoy"] @@ -7,10 +7,8 @@ [ext_resource type="PackedScene" uid="uid://b7mhdrj3b6loq" path="res://game/doors/door.tscn" id="3_crrvt"] [ext_resource type="Texture2D" uid="uid://du56n63yrot7d" path="res://images/level/tree.png" id="3_o0jti"] [ext_resource type="Texture2D" uid="uid://d3346lrt1c1oh" path="res://images/level/outdoor.png" id="3_wi6ud"] -[ext_resource type="PackedScene" uid="uid://cemhsfdru4pv6" path="res://game/objects/tutorial/movement_kbd.tscn" id="4_rifvl"] -[ext_resource type="PackedScene" uid="uid://tipop68pyrf7" path="res://game/objects/tutorial/movement_pad.tscn" id="5_l6jt4"] -[ext_resource type="PackedScene" uid="uid://pw8xqtpauy57" path="res://game/objects/tutorial/jump_kbd.tscn" id="6_g1txn"] -[ext_resource type="PackedScene" uid="uid://3372ayctb2ed" path="res://game/objects/tutorial/jump_pad.tscn" id="7_yrqjd"] +[ext_resource type="PackedScene" uid="uid://be3mqeb784shj" path="res://game/objects/tutorial/movement_action_tip.tscn" id="6_ia26y"] +[ext_resource type="PackedScene" uid="uid://cjduhfqgdmyhe" path="res://game/objects/tutorial/jump_action_tip.tscn" id="7_rt0xo"] [ext_resource type="PackedScene" uid="uid://b3kyqvuxmfn8f" path="res://game/objects/fireplace.tscn" id="8_dea75"] [ext_resource type="PackedScene" uid="uid://bt4smb361amjj" path="res://game/objects/flask_s.tscn" id="8_rt0xo"] [ext_resource type="PackedScene" uid="uid://d330w1ygg6uxy" path="res://game/objects/painting_v_l.tscn" id="9_mmf06"] @@ -97,31 +95,25 @@ position = Vector2(1776, 280) [node name="Outdoor" type="Node2D" parent="Objects" index="0"] position = Vector2(71, 0) -[node name="MovementKbd" parent="Objects/Outdoor" index="0" instance=ExtResource("4_rifvl")] -position = Vector2(-21, 2) - -[node name="MovementPad" parent="Objects/Outdoor" index="1" instance=ExtResource("5_l6jt4")] -position = Vector2(24, -4) +[node name="MovementActionTip" parent="Objects/Outdoor" index="0" instance=ExtResource("6_ia26y")] +position = Vector2(-11, 2) [node name="Entrance" type="Node2D" parent="Objects" index="1"] position = Vector2(641, 0) -[node name="JumpKbd" parent="Objects/Entrance" index="0" instance=ExtResource("6_g1txn")] -position = Vector2(173, -52) +[node name="JumpActionTip" parent="Objects/Entrance" index="0" instance=ExtResource("7_rt0xo")] +position = Vector2(131, -43) -[node name="JumpPad" parent="Objects/Entrance" index="1" instance=ExtResource("7_yrqjd")] -position = Vector2(95, -28) - -[node name="FlaskS" parent="Objects/Entrance" index="2" instance=ExtResource("8_rt0xo")] +[node name="FlaskS" parent="Objects/Entrance" index="1" instance=ExtResource("8_rt0xo")] position = Vector2(-212, -15) -[node name="Fireplace" parent="Objects/Entrance" index="3" instance=ExtResource("8_dea75")] +[node name="Fireplace" parent="Objects/Entrance" index="2" instance=ExtResource("8_dea75")] position = Vector2(-206, 0) -[node name="PaintingVL" parent="Objects/Entrance" index="4" instance=ExtResource("9_mmf06")] +[node name="PaintingVL" parent="Objects/Entrance" index="3" instance=ExtResource("9_mmf06")] position = Vector2(-259, -48) -[node name="PaintingHS" parent="Objects/Entrance" index="5" instance=ExtResource("10_yrqjd")] +[node name="PaintingHS" parent="Objects/Entrance" index="4" instance=ExtResource("10_yrqjd")] position = Vector2(-80, -38) [node name="Room1" type="Node2D" parent="Objects" index="2"] diff --git a/game/levels/level_2.tscn b/game/levels/level_2.tscn index c7f7e51..f9250c6 100644 --- a/game/levels/level_2.tscn +++ b/game/levels/level_2.tscn @@ -1,10 +1,9 @@ -[gd_scene load_steps=20 format=4 uid="uid://cc06c06hlv7ix"] +[gd_scene load_steps=19 format=4 uid="uid://cc06c06hlv7ix"] [ext_resource type="PackedScene" uid="uid://mpsu4g2b5h3a" path="res://game/levels/abstract_level.tscn" id="1_t037v"] [ext_resource type="PackedScene" uid="uid://cojxqx5al7kyv" path="res://game/doors/locked_door.tscn" id="2_iakit"] -[ext_resource type="PackedScene" uid="uid://deo60sij43ibm" path="res://game/objects/tutorial/switch_kbd.tscn" id="3_6jjde"] [ext_resource type="PackedScene" uid="uid://b7mhdrj3b6loq" path="res://game/doors/door.tscn" id="3_ylsm2"] -[ext_resource type="PackedScene" uid="uid://f70xseggdimg" path="res://game/objects/tutorial/switch_pad.tscn" id="4_bxukv"] +[ext_resource type="PackedScene" uid="uid://b0pxe00dlyx7t" path="res://game/objects/tutorial/switch_action_tip.tscn" id="4_xx77b"] [ext_resource type="PackedScene" uid="uid://xny1x7me75gc" path="res://game/objects/mirror_l.tscn" id="5_bxukv"] [ext_resource type="PackedScene" uid="uid://dopjsft0y8mw5" path="res://game/objects/cabinet.tscn" id="5_uivyf"] [ext_resource type="PackedScene" uid="uid://b8pvlnpdnfmd0" path="res://game/objects/chair_f.tscn" id="6_go8g1"] @@ -34,16 +33,13 @@ position = Vector2(963, 440) [node name="Room1" type="Node2D" parent="Objects" index="0"] position = Vector2(45, 272) -[node name="SwitchKbd" parent="Objects/Room1" index="0" instance=ExtResource("3_6jjde")] -position = Vector2(59, -11) +[node name="SwitchActionTip" parent="Objects/Room1" index="0" instance=ExtResource("4_xx77b")] +position = Vector2(57, -11) -[node name="SwitchPad" parent="Objects/Room1" index="1" instance=ExtResource("4_bxukv")] -position = Vector2(-36, -3) - -[node name="MirrorL" parent="Objects/Room1" index="2" instance=ExtResource("5_bxukv")] +[node name="MirrorL" parent="Objects/Room1" index="1" instance=ExtResource("5_bxukv")] position = Vector2(0, 20) -[node name="Cabinet" parent="Objects/Room1" index="3" instance=ExtResource("5_uivyf")] +[node name="Cabinet" parent="Objects/Room1" index="2" instance=ExtResource("5_uivyf")] position = Vector2(0, 37) [node name="Room2" type="Node2D" parent="Objects" index="1"] diff --git a/game/levels/level_4.tscn b/game/levels/level_4.tscn index 2d4ff89..8121714 100644 --- a/game/levels/level_4.tscn +++ b/game/levels/level_4.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=24 format=4 uid="uid://cmp1cog2cbfh5"] +[gd_scene load_steps=23 format=4 uid="uid://cmp1cog2cbfh5"] [ext_resource type="PackedScene" uid="uid://mpsu4g2b5h3a" path="res://game/levels/abstract_level.tscn" id="1_v1h2f"] [ext_resource type="PackedScene" uid="uid://b7mhdrj3b6loq" path="res://game/doors/door.tscn" id="2_h35x0"] @@ -14,7 +14,6 @@ [ext_resource type="PackedScene" uid="uid://d3m8kf7lqmyb8" path="res://game/objects/flask_l.tscn" id="8_pp088"] [ext_resource type="PackedScene" uid="uid://bt4smb361amjj" path="res://game/objects/flask_s.tscn" id="9_gtr04"] [ext_resource type="PackedScene" uid="uid://c0bk5sk661hi1" path="res://game/objects/painting_h_s.tscn" id="10_c6guj"] -[ext_resource type="PackedScene" uid="uid://dwnalr4rphui0" path="res://game/objects/candle.tscn" id="11_gtkf3"] [ext_resource type="PackedScene" uid="uid://b3kyqvuxmfn8f" path="res://game/objects/fireplace.tscn" id="12_s735u"] [ext_resource type="PackedScene" uid="uid://dopjsft0y8mw5" path="res://game/objects/cabinet.tscn" id="13_rnrg1"] [ext_resource type="PackedScene" uid="uid://bo7756lp68bl1" path="res://game/objects/painting_v_s.tscn" id="14_4ncxq"] @@ -77,16 +76,10 @@ position = Vector2(32, -3) [node name="Room2" type="Node2D" parent="Objects" index="1"] position = Vector2(257, 256) -[node name="Candle1" parent="Objects/Room2" index="0" instance=ExtResource("11_gtkf3")] -position = Vector2(-35, 23) - -[node name="Candle2" parent="Objects/Room2" index="1" instance=ExtResource("11_gtkf3")] -position = Vector2(-14, 21) - -[node name="FlaskS" parent="Objects/Room2" index="2" instance=ExtResource("9_gtr04")] +[node name="FlaskS" parent="Objects/Room2" index="0" instance=ExtResource("9_gtr04")] position = Vector2(-26, 20) -[node name="Fireplace" parent="Objects/Room2" index="3" instance=ExtResource("12_s735u")] +[node name="Fireplace" parent="Objects/Room2" index="1" instance=ExtResource("12_s735u")] position = Vector2(-24, 32) [node name="Room3" type="Node2D" parent="Objects" index="2"] diff --git a/game/levels/test_level.tscn b/game/levels/test_level.tscn index d1069cb..ecba58f 100644 --- a/game/levels/test_level.tscn +++ b/game/levels/test_level.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=21 format=4 uid="uid://bmn74wc2vophn"] +[gd_scene load_steps=20 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="PackedScene" uid="uid://b3kyqvuxmfn8f" path="res://game/objects/fireplace.tscn" id="3_tuvkr"] @@ -16,7 +16,6 @@ [ext_resource type="PackedScene" uid="uid://dqgmfpv2mhdpn" path="res://game/pickups/triangle_key_pickup.tscn" id="10_dea75"] [ext_resource type="PackedScene" uid="uid://b7mhdrj3b6loq" path="res://game/doors/door.tscn" id="11_g1txn"] [ext_resource type="PackedScene" uid="uid://dx1yasi8wlaye" path="res://game/objects/bookstand.tscn" id="13_g3b4m"] -[ext_resource type="PackedScene" uid="uid://b6qvcio6bnaoi" path="res://game/objects/tutorial/arrow_down.tscn" id="14_r01v2"] [ext_resource type="PackedScene" uid="uid://cb0w6mt8g4mer" path="res://game/characters/gray_enemy.tscn" id="18_blgb8"] [ext_resource type="PackedScene" uid="uid://cutjutvd8dqqc" path="res://game/characters/black_enemy.tscn" id="19_ohfy3"] [ext_resource type="PackedScene" uid="uid://bv2gahb4wxgb1" path="res://game/characters/white_enemy.tscn" id="20_rt0xo"] @@ -62,9 +61,6 @@ position = Vector2(692, -72) [node name="Bookstand" parent="Objects" index="4" instance=ExtResource("13_g3b4m")] position = Vector2(1216, 102) -[node name="ArrowDown" parent="Objects" index="5" instance=ExtResource("14_r01v2")] -position = Vector2(1376, 79) - [node name="BookPickup" parent="Pickups" index="0" instance=ExtResource("7_fq0h3")] position = Vector2(1216, 86) diff --git a/game/managers/input_manager.gd b/game/managers/input_manager.gd new file mode 100644 index 0000000..3aca126 --- /dev/null +++ b/game/managers/input_manager.gd @@ -0,0 +1,62 @@ +class_name CInputManager +extends Node2D + + +signal type_changed(type: Type) + + +enum Type { + Keyboard, + Gamepad, +} + + +@export_range(0.0, 1.0, 0.01) var dead_zone := 0.2 + + +@onready var _type : Type: + set(value): + _type = value + type_changed.emit(_type) + + +func _ready() -> void: + if Input.get_connected_joypads().size() > 0: + _type = Type.Gamepad + else: + _type = Type.Keyboard + + +func _input(event: InputEvent) -> void: + if _is_keyboard_event(event): + _type = Type.Keyboard + elif _is_gamepad_event(event): + _type = Type.Gamepad + + +func _is_keyboard_event(event: InputEvent) -> bool: + if event is InputEventKey: + return true + if event is InputEventMouse: + return true + return false + + +func _is_gamepad_event(event: InputEvent) -> bool: + if event is InputEventJoypadButton: + return true + if event is InputEventJoypadMotion and not _is_deadzone(event): + return true + return false + + +func _is_deadzone(event: InputEventJoypadMotion) -> bool: + if event.axis_value < -dead_zone: + return false + if event.axis_value > dead_zone: + return false + return true + + +func get_type() -> Type: + return _type diff --git a/game/managers/input_manager.gd.uid b/game/managers/input_manager.gd.uid new file mode 100644 index 0000000..8ac43e3 --- /dev/null +++ b/game/managers/input_manager.gd.uid @@ -0,0 +1 @@ +uid://cm5bo10nhhv22 diff --git a/game/managers/input_manager.tscn b/game/managers/input_manager.tscn new file mode 100644 index 0000000..2df8ae6 --- /dev/null +++ b/game/managers/input_manager.tscn @@ -0,0 +1,6 @@ +[gd_scene load_steps=2 format=3 uid="uid://dns14jkftmq7n"] + +[ext_resource type="Script" uid="uid://cm5bo10nhhv22" path="res://game/managers/input_manager.gd" id="1_tiryt"] + +[node name="InputManager" type="Node2D"] +script = ExtResource("1_tiryt") diff --git a/game/menu/main_menu.tscn b/game/menu/main_menu.tscn index 939d2de..02272d9 100644 --- a/game/menu/main_menu.tscn +++ b/game/menu/main_menu.tscn @@ -48,7 +48,7 @@ text = "Quit" layout_mode = 2 size_flags_vertical = 1 theme = ExtResource("3_i4f54") -text = "v 1.0.1 +text = "v 1.0.2 (c) Ruslan Ignatov 2026 Powered by Godot Engine" horizontal_alignment = 2 diff --git a/game/objects/bookstand.tscn b/game/objects/bookstand.tscn index 42fa877..0a43904 100644 --- a/game/objects/bookstand.tscn +++ b/game/objects/bookstand.tscn @@ -4,7 +4,7 @@ [sub_resource type="AtlasTexture" id="AtlasTexture_opqiy"] atlas = ExtResource("1_nvgb0") -region = Rect2(144, 0, 16, 32) +region = Rect2(144, 32, 16, 32) [node name="Bookstand" type="Node2D"] diff --git a/game/objects/cabinet.tscn b/game/objects/cabinet.tscn index f711591..2ccfcca 100644 --- a/game/objects/cabinet.tscn +++ b/game/objects/cabinet.tscn @@ -4,7 +4,7 @@ [sub_resource type="AtlasTexture" id="AtlasTexture_sqimt"] atlas = ExtResource("1_57t4w") -region = Rect2(160, 0, 32, 32) +region = Rect2(160, 64, 32, 32) [node name="Cabinet" type="Node2D"] diff --git a/game/objects/candle.tscn b/game/objects/candle.tscn deleted file mode 100644 index 9888b98..0000000 --- a/game/objects/candle.tscn +++ /dev/null @@ -1,12 +0,0 @@ -[gd_scene load_steps=3 format=3 uid="uid://dwnalr4rphui0"] - -[ext_resource type="Texture2D" uid="uid://ddm4gc2g3aj2i" path="res://images/level/objects.png" id="1_3rimp"] - -[sub_resource type="AtlasTexture" id="AtlasTexture_ajme5"] -atlas = ExtResource("1_3rimp") -region = Rect2(48, 128, 16, 16) - -[node name="Candle" type="Node2D"] - -[node name="Sprite2D" type="Sprite2D" parent="."] -texture = SubResource("AtlasTexture_ajme5") diff --git a/game/objects/candles.tscn b/game/objects/candles.tscn deleted file mode 100644 index 45d5802..0000000 --- a/game/objects/candles.tscn +++ /dev/null @@ -1,12 +0,0 @@ -[gd_scene load_steps=3 format=3 uid="uid://dbj2f8kpwb8uh"] - -[ext_resource type="Texture2D" uid="uid://ddm4gc2g3aj2i" path="res://images/level/objects.png" id="1_epbkb"] - -[sub_resource type="AtlasTexture" id="AtlasTexture_w5fvp"] -atlas = ExtResource("1_epbkb") -region = Rect2(64, 128, 16, 16) - -[node name="Candles" type="Node2D"] - -[node name="Sprite2D" type="Sprite2D" parent="."] -texture = SubResource("AtlasTexture_w5fvp") diff --git a/game/objects/chair_b.tscn b/game/objects/chair_b.tscn index 8163f9b..ebe4d8d 100644 --- a/game/objects/chair_b.tscn +++ b/game/objects/chair_b.tscn @@ -4,7 +4,7 @@ [sub_resource type="AtlasTexture" id="AtlasTexture_ea7rc"] atlas = ExtResource("1_e7ewy") -region = Rect2(112, 32, 16, 32) +region = Rect2(160, 32, 16, 32) [node name="ChairB" type="Node2D"] diff --git a/game/objects/chair_f.tscn b/game/objects/chair_f.tscn index 9e861fc..60204c0 100644 --- a/game/objects/chair_f.tscn +++ b/game/objects/chair_f.tscn @@ -4,7 +4,7 @@ [sub_resource type="AtlasTexture" id="AtlasTexture_1kw05"] atlas = ExtResource("1_rse2u") -region = Rect2(112, 0, 16, 32) +region = Rect2(160, 0, 16, 32) [node name="ChairF" type="Node2D"] diff --git a/game/objects/chair_l.tscn b/game/objects/chair_l.tscn index c4103b8..7b15bd5 100644 --- a/game/objects/chair_l.tscn +++ b/game/objects/chair_l.tscn @@ -4,7 +4,7 @@ [sub_resource type="AtlasTexture" id="AtlasTexture_cktuf"] atlas = ExtResource("1_xguce") -region = Rect2(128, 0, 16, 32) +region = Rect2(176, 0, 16, 32) [node name="ChairL" type="Node2D"] diff --git a/game/objects/chair_r.tscn b/game/objects/chair_r.tscn index ceccaec..cf22b32 100644 --- a/game/objects/chair_r.tscn +++ b/game/objects/chair_r.tscn @@ -4,7 +4,7 @@ [sub_resource type="AtlasTexture" id="AtlasTexture_e7ewy"] atlas = ExtResource("1_e7ewy") -region = Rect2(128, 32, 16, 32) +region = Rect2(176, 32, 16, 32) [node name="ChairR" type="Node2D"] diff --git a/game/objects/flask_l.tscn b/game/objects/flask_l.tscn index a388673..0a88adb 100644 --- a/game/objects/flask_l.tscn +++ b/game/objects/flask_l.tscn @@ -4,7 +4,7 @@ [sub_resource type="AtlasTexture" id="AtlasTexture_i1pbn"] atlas = ExtResource("1_x6vix") -region = Rect2(64, 64, 16, 16) +region = Rect2(128, 48, 16, 16) [node name="FlaskL" type="Node2D"] diff --git a/game/objects/flask_s.tscn b/game/objects/flask_s.tscn index 9122454..f1e8413 100644 --- a/game/objects/flask_s.tscn +++ b/game/objects/flask_s.tscn @@ -4,7 +4,7 @@ [sub_resource type="AtlasTexture" id="AtlasTexture_wg65s"] atlas = ExtResource("1_05y3q") -region = Rect2(48, 64, 16, 16) +region = Rect2(128, 32, 16, 16) [node name="FlaskS" type="Node2D"] diff --git a/game/objects/mirror_l.tscn b/game/objects/mirror_l.tscn index 351ca2d..1cc1eaa 100644 --- a/game/objects/mirror_l.tscn +++ b/game/objects/mirror_l.tscn @@ -4,7 +4,7 @@ [sub_resource type="AtlasTexture" id="AtlasTexture_nypty"] atlas = ExtResource("1_xsvl5") -region = Rect2(144, 64, 32, 16) +region = Rect2(80, 48, 32, 16) [node name="MirrorL" type="Node2D"] diff --git a/game/objects/mirror_s.tscn b/game/objects/mirror_s.tscn index c367d40..f2e761d 100644 --- a/game/objects/mirror_s.tscn +++ b/game/objects/mirror_s.tscn @@ -4,7 +4,7 @@ [sub_resource type="AtlasTexture" id="AtlasTexture_7fxax"] atlas = ExtResource("1_vvvt3") -region = Rect2(144, 48, 16, 16) +region = Rect2(112, 48, 16, 16) [node name="MirrorS" type="Node2D"] diff --git a/game/objects/plate.tscn b/game/objects/plate.tscn index e0e10b1..801fc5c 100644 --- a/game/objects/plate.tscn +++ b/game/objects/plate.tscn @@ -4,7 +4,7 @@ [sub_resource type="AtlasTexture" id="AtlasTexture_q70ul"] atlas = ExtResource("1_wkk58") -region = Rect2(144, 32, 16, 16) +region = Rect2(112, 32, 16, 16) [node name="Plate" type="Node2D"] diff --git a/game/objects/redort_end_l.tscn b/game/objects/redort_end_l.tscn index 740d2ba..8a02ca0 100644 --- a/game/objects/redort_end_l.tscn +++ b/game/objects/redort_end_l.tscn @@ -4,7 +4,7 @@ [sub_resource type="AtlasTexture" id="AtlasTexture_hbatg"] atlas = ExtResource("1_xsq2h") -region = Rect2(64, 80, 16, 16) +region = Rect2(144, 0, 16, 16) [node name="RedortEndL" type="Node2D"] diff --git a/game/objects/retort_end_r.tscn b/game/objects/retort_end_r.tscn index 4e30935..b06ac4f 100644 --- a/game/objects/retort_end_r.tscn +++ b/game/objects/retort_end_r.tscn @@ -4,7 +4,7 @@ [sub_resource type="AtlasTexture" id="AtlasTexture_2d2yp"] atlas = ExtResource("1_ibloa") -region = Rect2(48, 80, 16, 16) +region = Rect2(112, 16, 16, 16) [node name="RetortEndR" type="Node2D"] diff --git a/game/objects/retort_l.tscn b/game/objects/retort_l.tscn index d763ae0..f4a1da3 100644 --- a/game/objects/retort_l.tscn +++ b/game/objects/retort_l.tscn @@ -4,7 +4,7 @@ [sub_resource type="AtlasTexture" id="AtlasTexture_8epgq"] atlas = ExtResource("1_u1d6f") -region = Rect2(160, 176, 32, 16) +region = Rect2(128, 16, 32, 16) [node name="RetortL" type="Node2D"] diff --git a/game/objects/retort_r.tscn b/game/objects/retort_r.tscn index 0613f4d..946f71b 100644 --- a/game/objects/retort_r.tscn +++ b/game/objects/retort_r.tscn @@ -4,7 +4,7 @@ [sub_resource type="AtlasTexture" id="AtlasTexture_f54r7"] atlas = ExtResource("1_gohft") -region = Rect2(160, 160, 32, 16) +region = Rect2(112, 0, 32, 16) [node name="RetortR" type="Node2D"] diff --git a/game/objects/table_l.tscn b/game/objects/table_l.tscn index b15f22d..9dcbb33 100644 --- a/game/objects/table_l.tscn +++ b/game/objects/table_l.tscn @@ -4,7 +4,7 @@ [sub_resource type="AtlasTexture" id="AtlasTexture_l7gad"] atlas = ExtResource("1_ftoqg") -region = Rect2(80, 160, 80, 32) +region = Rect2(80, 64, 80, 32) [node name="TableL" type="Node2D"] diff --git a/game/objects/table_m.tscn b/game/objects/table_m.tscn index 4662ed2..45bba32 100644 --- a/game/objects/table_m.tscn +++ b/game/objects/table_m.tscn @@ -4,7 +4,7 @@ [sub_resource type="AtlasTexture" id="AtlasTexture_runce"] atlas = ExtResource("1_qacj7") -region = Rect2(112, 128, 48, 32) +region = Rect2(32, 64, 48, 32) [node name="TableM" type="Node2D"] diff --git a/game/objects/table_s.tscn b/game/objects/table_s.tscn index 8f6ee0c..2c25a0c 100644 --- a/game/objects/table_s.tscn +++ b/game/objects/table_s.tscn @@ -4,7 +4,7 @@ [sub_resource type="AtlasTexture" id="AtlasTexture_n2itf"] atlas = ExtResource("1_qacj7") -region = Rect2(80, 128, 32, 32) +region = Rect2(0, 64, 32, 32) [node name="TableS" type="Node2D"] diff --git a/game/objects/tutorial/abstract_action_tip.gd b/game/objects/tutorial/abstract_action_tip.gd new file mode 100644 index 0000000..199a712 --- /dev/null +++ b/game/objects/tutorial/abstract_action_tip.gd @@ -0,0 +1,21 @@ +class_name AbstractActionTip +extends Node2D + + +@onready var sprite_keyboard : Sprite2D = $SpriteKbd +@onready var sprite_gamepad : Sprite2D = $SpritePad + + +func _ready() -> void: + _updated_by_input_type(InputManager.get_type()) + InputManager.type_changed.connect(_updated_by_input_type) + + +func _updated_by_input_type(type: InputManager.Type) -> void: + match type: + InputManager.Type.Keyboard: + sprite_keyboard.show() + sprite_gamepad.hide() + InputManager.Type.Gamepad: + sprite_keyboard.hide() + sprite_gamepad.show() diff --git a/game/objects/tutorial/abstract_action_tip.gd.uid b/game/objects/tutorial/abstract_action_tip.gd.uid new file mode 100644 index 0000000..e91a84b --- /dev/null +++ b/game/objects/tutorial/abstract_action_tip.gd.uid @@ -0,0 +1 @@ +uid://byjums4jdva4x diff --git a/game/objects/tutorial/abstract_action_tip.tscn b/game/objects/tutorial/abstract_action_tip.tscn new file mode 100644 index 0000000..83b93a3 --- /dev/null +++ b/game/objects/tutorial/abstract_action_tip.tscn @@ -0,0 +1,10 @@ +[gd_scene load_steps=2 format=3 uid="uid://b24pn1q6u3u5v"] + +[ext_resource type="Script" uid="uid://byjums4jdva4x" path="res://game/objects/tutorial/abstract_action_tip.gd" id="1_erg4q"] + +[node name="AbstractActionTip" type="Node2D"] +script = ExtResource("1_erg4q") + +[node name="SpriteKbd" type="Sprite2D" parent="."] + +[node name="SpritePad" type="Sprite2D" parent="."] diff --git a/game/objects/tutorial/arrow_down.tscn b/game/objects/tutorial/arrow_down.tscn deleted file mode 100644 index 9e7dc0a..0000000 --- a/game/objects/tutorial/arrow_down.tscn +++ /dev/null @@ -1,12 +0,0 @@ -[gd_scene load_steps=3 format=3 uid="uid://b6qvcio6bnaoi"] - -[ext_resource type="Texture2D" uid="uid://ddm4gc2g3aj2i" path="res://images/level/objects.png" id="1_r10g3"] - -[sub_resource type="AtlasTexture" id="AtlasTexture_6qcrt"] -atlas = ExtResource("1_r10g3") -region = Rect2(176, 64, 16, 32) - -[node name="ArrowDown" type="Node2D"] - -[node name="Sprite2D" type="Sprite2D" parent="."] -texture = SubResource("AtlasTexture_6qcrt") diff --git a/game/objects/tutorial/arrow_left.tscn b/game/objects/tutorial/arrow_left.tscn deleted file mode 100644 index 119ed24..0000000 --- a/game/objects/tutorial/arrow_left.tscn +++ /dev/null @@ -1,12 +0,0 @@ -[gd_scene load_steps=3 format=3 uid="uid://dindl67sbr8wc"] - -[ext_resource type="Texture2D" uid="uid://ddm4gc2g3aj2i" path="res://images/level/objects.png" id="1_ct7ib"] - -[sub_resource type="AtlasTexture" id="AtlasTexture_n5v8r"] -atlas = ExtResource("1_ct7ib") -region = Rect2(160, 128, 32, 16) - -[node name="ArrowLeft" type="Node2D"] - -[node name="Sprite2D" type="Sprite2D" parent="."] -texture = SubResource("AtlasTexture_n5v8r") diff --git a/game/objects/tutorial/arrow_right.tscn b/game/objects/tutorial/arrow_right.tscn deleted file mode 100644 index f18d741..0000000 --- a/game/objects/tutorial/arrow_right.tscn +++ /dev/null @@ -1,12 +0,0 @@ -[gd_scene load_steps=3 format=3 uid="uid://c653affkseeh3"] - -[ext_resource type="Texture2D" uid="uid://ddm4gc2g3aj2i" path="res://images/level/objects.png" id="1_gvebv"] - -[sub_resource type="AtlasTexture" id="AtlasTexture_r0fup"] -atlas = ExtResource("1_gvebv") -region = Rect2(160, 144, 32, 16) - -[node name="ArrowRight" type="Node2D"] - -[node name="Sprite2D" type="Sprite2D" parent="."] -texture = SubResource("AtlasTexture_r0fup") diff --git a/game/objects/tutorial/arrow_up.tscn b/game/objects/tutorial/arrow_up.tscn deleted file mode 100644 index 8c4b7af..0000000 --- a/game/objects/tutorial/arrow_up.tscn +++ /dev/null @@ -1,12 +0,0 @@ -[gd_scene load_steps=3 format=3 uid="uid://crxhuuyyu7v24"] - -[ext_resource type="Texture2D" uid="uid://ddm4gc2g3aj2i" path="res://images/level/objects.png" id="1_85c6u"] - -[sub_resource type="AtlasTexture" id="AtlasTexture_0lvas"] -atlas = ExtResource("1_85c6u") -region = Rect2(176, 96, 16, 32) - -[node name="ArrowUp" type="Node2D"] - -[node name="Sprite2D" type="Sprite2D" parent="."] -texture = SubResource("AtlasTexture_0lvas") diff --git a/game/objects/tutorial/interaction_action_tip.tscn b/game/objects/tutorial/interaction_action_tip.tscn new file mode 100644 index 0000000..ce638d8 --- /dev/null +++ b/game/objects/tutorial/interaction_action_tip.tscn @@ -0,0 +1,20 @@ +[gd_scene load_steps=5 format=3 uid="uid://g7wjnlsbden8"] + +[ext_resource type="PackedScene" uid="uid://b24pn1q6u3u5v" path="res://game/objects/tutorial/abstract_action_tip.tscn" id="1_jsfj2"] +[ext_resource type="Texture2D" uid="uid://ddm4gc2g3aj2i" path="res://images/level/objects.png" id="2_xbyc1"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_71ogr"] +atlas = ExtResource("2_xbyc1") +region = Rect2(128, 96, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_jsfj2"] +atlas = ExtResource("2_xbyc1") +region = Rect2(128, 128, 32, 32) + +[node name="InteractionActionTip" instance=ExtResource("1_jsfj2")] + +[node name="SpriteKbd" parent="." index="0"] +texture = SubResource("AtlasTexture_71ogr") + +[node name="SpritePad" parent="." index="1"] +texture = SubResource("AtlasTexture_jsfj2") diff --git a/game/objects/tutorial/jump_action_tip.tscn b/game/objects/tutorial/jump_action_tip.tscn new file mode 100644 index 0000000..d659e03 --- /dev/null +++ b/game/objects/tutorial/jump_action_tip.tscn @@ -0,0 +1,20 @@ +[gd_scene load_steps=5 format=3 uid="uid://cjduhfqgdmyhe"] + +[ext_resource type="PackedScene" uid="uid://b24pn1q6u3u5v" path="res://game/objects/tutorial/abstract_action_tip.tscn" id="1_ffrc6"] +[ext_resource type="Texture2D" uid="uid://ddm4gc2g3aj2i" path="res://images/level/objects.png" id="2_nd0mf"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_sre3d"] +atlas = ExtResource("2_nd0mf") +region = Rect2(32, 96, 48, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_nd0mf"] +atlas = ExtResource("2_nd0mf") +region = Rect2(32, 128, 48, 32) + +[node name="JumpActionTip" instance=ExtResource("1_ffrc6")] + +[node name="SpriteKbd" parent="." index="0"] +texture = SubResource("AtlasTexture_sre3d") + +[node name="SpritePad" parent="." index="1"] +texture = SubResource("AtlasTexture_nd0mf") diff --git a/game/objects/tutorial/movement_action_tip.tscn b/game/objects/tutorial/movement_action_tip.tscn new file mode 100644 index 0000000..59be73d --- /dev/null +++ b/game/objects/tutorial/movement_action_tip.tscn @@ -0,0 +1,20 @@ +[gd_scene load_steps=5 format=3 uid="uid://be3mqeb784shj"] + +[ext_resource type="PackedScene" uid="uid://b24pn1q6u3u5v" path="res://game/objects/tutorial/abstract_action_tip.tscn" id="1_6vlve"] +[ext_resource type="Texture2D" uid="uid://ddm4gc2g3aj2i" path="res://images/level/objects.png" id="2_aui55"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_qoa1y"] +atlas = ExtResource("2_aui55") +region = Rect2(0, 96, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_aui55"] +atlas = ExtResource("2_aui55") +region = Rect2(0, 128, 32, 32) + +[node name="MovementActionTip" instance=ExtResource("1_6vlve")] + +[node name="SpriteKbd" parent="." index="0"] +texture = SubResource("AtlasTexture_qoa1y") + +[node name="SpritePad" parent="." index="1"] +texture = SubResource("AtlasTexture_aui55") diff --git a/game/objects/tutorial/switch_action_tip.tscn b/game/objects/tutorial/switch_action_tip.tscn new file mode 100644 index 0000000..de6e14f --- /dev/null +++ b/game/objects/tutorial/switch_action_tip.tscn @@ -0,0 +1,20 @@ +[gd_scene load_steps=5 format=3 uid="uid://b0pxe00dlyx7t"] + +[ext_resource type="PackedScene" uid="uid://b24pn1q6u3u5v" path="res://game/objects/tutorial/abstract_action_tip.tscn" id="1_sol75"] +[ext_resource type="Texture2D" uid="uid://ddm4gc2g3aj2i" path="res://images/level/objects.png" id="2_278pw"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_2aait"] +atlas = ExtResource("2_278pw") +region = Rect2(80, 96, 48, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_278pw"] +atlas = ExtResource("2_278pw") +region = Rect2(80, 128, 48, 32) + +[node name="SwitchActionTip" instance=ExtResource("1_sol75")] + +[node name="SpriteKbd" parent="." index="0"] +texture = SubResource("AtlasTexture_2aait") + +[node name="SpritePad" parent="." index="1"] +texture = SubResource("AtlasTexture_278pw") diff --git a/game/objects/wardrobe.tscn b/game/objects/wardrobe.tscn index 6d90330..c236ff1 100644 --- a/game/objects/wardrobe.tscn +++ b/game/objects/wardrobe.tscn @@ -4,7 +4,7 @@ [sub_resource type="AtlasTexture" id="AtlasTexture_wbqlk"] atlas = ExtResource("1_610bq") -region = Rect2(144, 80, 32, 48) +region = Rect2(160, 96, 32, 48) [node name="Wardrobe" type="Node2D"] diff --git a/images/level/objects.png b/images/level/objects.png index 382c219..8914840 100644 --- a/images/level/objects.png +++ b/images/level/objects.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:83b663f4895a278b924d28f6c234c550ad9f4c63d4697af3fc3c510be271ddbc -size 2103 +oid sha256:d74ed2680639cdd3cd5bb7ff58600b147a01c9556a17fe468177c80bd95bd704 +size 1690 diff --git a/project.godot b/project.godot index e3cf030..c04e128 100644 --- a/project.godot +++ b/project.godot @@ -23,6 +23,7 @@ SettingsManager="*res://game/managers/settings_manager.tscn" SoundManager="*res://game/managers/sound_manager.tscn" SaveManager="*res://game/managers/save_manager.tscn" LevelManager="*res://game/managers/level_manager.tscn" +InputManager="*res://game/managers/input_manager.tscn" [debug]