From 3f465a708c8b22bd7c13b02f597a1d2e36c3f5f1 Mon Sep 17 00:00:00 2001 From: Layla Manley Date: Sun, 21 Jan 2024 18:18:15 +0100 Subject: [PATCH] Improvements --- nodes/equipment/saber.tscn | 47 ++++++++++--------- nodes/v2/creatures/enemies/basic_enemy.tscn | 14 +++++- .../generator_instances/standard_gen.tres | 8 ++-- .../roomsets/standard/large_walkway.tscn | 13 +++++ .../roomsets/standard/medium_hallway.tscn | 12 +++++ .../standard/medium_hallway_down.tscn | 13 +++++ scripts/equipment/saber.gd | 2 +- scripts/v2/creature.gd | 3 ++ scripts/v2/enemy.gd | 19 +++++++- 9 files changed, 101 insertions(+), 30 deletions(-) create mode 100644 scenes/v2/worldgen/roomsets/standard/large_walkway.tscn create mode 100644 scenes/v2/worldgen/roomsets/standard/medium_hallway.tscn create mode 100644 scenes/v2/worldgen/roomsets/standard/medium_hallway_down.tscn diff --git a/nodes/equipment/saber.tscn b/nodes/equipment/saber.tscn index 95d1033..4b9c463 100644 --- a/nodes/equipment/saber.tscn +++ b/nodes/equipment/saber.tscn @@ -34,42 +34,31 @@ tracks/1/keys = { "times": PackedFloat32Array(0), "transitions": PackedFloat32Array(1), "update": 1, -"values": [true] +"values": [false] } [sub_resource type="Animation" id="Animation_s6hcs"] resource_name = "attack" length = 0.5 -tracks/0/type = "bezier" +tracks/0/type = "value" tracks/0/imported = false tracks/0/enabled = true -tracks/0/path = NodePath("Sprite2D:frame") +tracks/0/path = NodePath("Sprite2D/Area2D:monitoring") tracks/0/interp = 1 tracks/0/loop_wrap = true tracks/0/keys = { -"handle_modes": PackedInt32Array(0, 0, 0, 0, 0, 0), -"points": PackedFloat32Array(1, -0.25, 0, 0.25, 0, 2, -0.25, 0, 0.25, 0, 3, -0.25, 0, 0.25, 0, 4, -0.25, 0, 0.25, 0, 5, -0.25, 0, 0.25, 0, 0, -0.25, 0, 0.25, 0), -"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5) -} -tracks/1/type = "value" -tracks/1/imported = false -tracks/1/enabled = true -tracks/1/path = NodePath("Sprite2D/Area2D:monitoring") -tracks/1/interp = 1 -tracks/1/loop_wrap = true -tracks/1/keys = { "times": PackedFloat32Array(0, 0.4, 0.5), "transitions": PackedFloat32Array(1, 1, 1), "update": 1, "values": [false, true, false] } -tracks/2/type = "audio" -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/path = NodePath("AudioStreamPlayer2D") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/keys = { +tracks/1/type = "audio" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("AudioStreamPlayer2D") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { "clips": [{ "end_offset": 0.0, "start_offset": 0.0, @@ -77,7 +66,19 @@ tracks/2/keys = { }], "times": PackedFloat32Array(0.3) } -tracks/2/use_blend = true +tracks/1/use_blend = true +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath("Sprite2D:frame") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/keys = { +"times": PackedFloat32Array(0, 0.1, 0.2, 0.4, 0.5), +"transitions": PackedFloat32Array(1, 1, 1, 1, 1), +"update": 1, +"values": [0, 1, 2, 3, 5] +} [sub_resource type="Animation" id="Animation_dbnl7"] resource_name = "idle" @@ -155,6 +156,7 @@ targetPath = NodePath("..") trailLength = 8 [node name="Area2D" type="Area2D" parent="Sprite2D"] +monitoring = false [node name="CollisionShape2D" type="CollisionShape2D" parent="Sprite2D/Area2D"] position = Vector2(24, -8) @@ -168,6 +170,5 @@ libraries = { } [node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."] -stream = ExtResource("5_1dip1") volume_db = -16.0 bus = &"Sound Effects" diff --git a/nodes/v2/creatures/enemies/basic_enemy.tscn b/nodes/v2/creatures/enemies/basic_enemy.tscn index c5f4be0..4585f8c 100644 --- a/nodes/v2/creatures/enemies/basic_enemy.tscn +++ b/nodes/v2/creatures/enemies/basic_enemy.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=5 format=3 uid="uid://bgdkduh2uevft"] +[gd_scene load_steps=6 format=3 uid="uid://bgdkduh2uevft"] [ext_resource type="Script" path="res://scripts/v2/enemy.gd" id="1_jfeur"] [ext_resource type="Texture2D" uid="uid://iewpb4eaydo1" path="res://assets/art/Enemies/basic_enemy1.png" id="2_g0kyc"] @@ -8,8 +8,13 @@ radius = 3.0 height = 16.0 -[node name="BasicEnemy" type="CharacterBody2D"] +[sub_resource type="CircleShape2D" id="CircleShape2D_4efxi"] +radius = 64.0 + +[node name="BasicEnemy" type="CharacterBody2D" node_paths=PackedStringArray("sprite", "detection_area")] script = ExtResource("1_jfeur") +sprite = NodePath("Sprite2D") +detection_area = NodePath("Area2D") max_hp = 3 death_sound = ExtResource("2_pspk3") @@ -19,3 +24,8 @@ texture = ExtResource("2_g0kyc") [node name="CollisionShape2D" type="CollisionShape2D" parent="."] shape = SubResource("CapsuleShape2D_htsfi") + +[node name="Area2D" type="Area2D" parent="."] + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"] +shape = SubResource("CircleShape2D_4efxi") diff --git a/scenes/v2/worldgen/generator_instances/standard_gen.tres b/scenes/v2/worldgen/generator_instances/standard_gen.tres index 6bfae1e..3b4ca51 100644 --- a/scenes/v2/worldgen/generator_instances/standard_gen.tres +++ b/scenes/v2/worldgen/generator_instances/standard_gen.tres @@ -1,4 +1,4 @@ -[gd_resource type="Resource" script_class="StandardWorldGenerator" load_steps=9 format=3 uid="uid://din7qhqccs2nr"] +[gd_resource type="Resource" script_class="StandardWorldGenerator" load_steps=11 format=3 uid="uid://din7qhqccs2nr"] [ext_resource type="Script" path="res://scripts/v2/worldgen/standard_generator.gd" id="1_dw1bv"] [ext_resource type="PackedScene" uid="uid://csuo1u5ickjbt" path="res://scenes/v2/worldgen/roomsets/standard/blocking.tscn" id="1_oci60"] @@ -8,9 +8,11 @@ [ext_resource type="PackedScene" uid="uid://bc5n3rb5t8ua7" path="res://scenes/v2/worldgen/roomsets/standard/small_room_down_right.tscn" id="5_ft2s4"] [ext_resource type="PackedScene" uid="uid://t511rr478gom" path="res://scenes/v2/worldgen/roomsets/standard/small_fork.tscn" id="6_ttx05"] [ext_resource type="PackedScene" uid="uid://3vfg1g7uhjp2" path="res://scenes/v2/worldgen/roomsets/standard/spawn_room.tscn" id="7_pb65x"] +[ext_resource type="PackedScene" uid="uid://c1071lricsfey" path="res://scenes/v2/worldgen/roomsets/standard/medium_hallway.tscn" id="8_wru8x"] +[ext_resource type="PackedScene" uid="uid://6g13ayie0xqg" path="res://scenes/v2/worldgen/roomsets/standard/medium_hallway_down.tscn" id="9_3wmjo"] [resource] script = ExtResource("1_dw1bv") -rooms = Array[PackedScene]([ExtResource("1_oci60"), ExtResource("2_t3otv"), ExtResource("3_xlr3c"), ExtResource("4_tc4ie"), ExtResource("5_ft2s4"), ExtResource("6_ttx05")]) -max_room_path_length = 10 +rooms = Array[PackedScene]([ExtResource("1_oci60"), ExtResource("2_t3otv"), ExtResource("3_xlr3c"), ExtResource("4_tc4ie"), ExtResource("5_ft2s4"), ExtResource("6_ttx05"), ExtResource("8_wru8x"), ExtResource("9_3wmjo")]) +max_room_path_length = 5 spawn_room = ExtResource("7_pb65x") diff --git a/scenes/v2/worldgen/roomsets/standard/large_walkway.tscn b/scenes/v2/worldgen/roomsets/standard/large_walkway.tscn new file mode 100644 index 0000000..b9e58d0 --- /dev/null +++ b/scenes/v2/worldgen/roomsets/standard/large_walkway.tscn @@ -0,0 +1,13 @@ +[gd_scene load_steps=3 format=3 uid="uid://76kx4fxa27xt"] + +[ext_resource type="TileSet" uid="uid://cluemfplimly4" path="res://assets/tiles.tres" id="1_lgcsk"] +[ext_resource type="Script" path="res://scripts/v2/worldgen/standard/room.gd" id="2_xxxn0"] + +[node name="LargeWalkway" type="TileMap"] +tile_set = ExtResource("1_lgcsk") +format = 2 +layer_0/tile_data = PackedInt32Array(0, 0, 0, 65536, 0, 0, 131072, 0, 0, 196608, 0, 0, 262144, 0, 0, 327680, 0, 0, 393216, 0, 0, 458752, 0, 0, 524288, 0, 0, 589824, 0, 0, 851968, 0, 0, 917504, 0, 0, 983040, 0, 0, 1048576, 0, 0, 1114112, 0, 0, 1179648, 0, 0, 1245184, 0, 0, 1310720, 0, 0, 1376256, 0, 0, 1441792, 0, 0, 1441793, 0, 0, 1441794, 0, 0, 1441795, 0, 0, 1441796, 0, 0, 1441797, 0, 0, 1441798, 0, 0, 1441799, 0, 0, 1441800, 0, 0, 1441801, 0, 0, 1441802, 0, 0, 1441803, 0, 0, 1441804, 0, 0, 1441805, 0, 0, 1441806, 0, 0, 1441807, 0, 0, 1441808, 0, 0, 1441809, 0, 0, 851969, 0, 0, 851970, 0, 0, 851971, 0, 0, 851972, 0, 0, 851973, 0, 0, 851974, 0, 0, 851975, 0, 0, 851976, 0, 0, 851977, 0, 0, 851978, 0, 0, 851979, 0, 0, 851980, 0, 0, 851981, 0, 0, 851982, 0, 0, 851983, 0, 0, 851984, 0, 0, 851985, 0, 0, 851986, 0, 0, 851987, 0, 0, 851988, 0, 0, 851989, 0, 0, 917525, 0, 0, 983061, 0, 0, 1048597, 0, 0, 1114133, 0, 0, 1179669, 0, 0, 1245205, 0, 0, 1310741, 0, 0, 1376277, 0, 0, 1441813, 0, 0, 1441812, 0, 0, 1441811, 0, 0, 1441810, 0, 0, 1441814, 0, 0, 1441815, 0, 0, 1441816, 0, 0, 1441817, 0, 0, 1441818, 0, 0, 1441819, 0, 0, 1441820, 0, 0, 1441821, 0, 0, 1441822, 0, 0, 1441823, 0, 0, 1441824, 0, 0, 1441825, 0, 0, 1441826, 0, 0, 1441827, 0, 0, 1441828, 0, 0, 1441829, 0, 0, 852005, 0, 0, 852004, 0, 0, 852003, 0, 0, 852002, 0, 0, 852001, 0, 0, 852000, 0, 0, 851999, 0, 0, 851998, 0, 0, 851997, 0, 0, 851996, 0, 0, 851995, 0, 0, 851994, 0, 0, 851993, 0, 0, 851992, 0, 0, 851991, 0, 0, 851990, 0, 0, 1, 0, 0, 2, 0, 0, 3, 0, 0, 4, 0, 0, 5, 0, 0, 6, 0, 0, 7, 0, 0, 8, 0, 0, 9, 0, 0, 10, 0, 0, 11, 0, 0, 12, 0, 0, 13, 0, 0, 14, 0, 0, 15, 0, 0, 16, 0, 0, 17, 0, 0, 21, 0, 0, 22, 0, 0, 26, 0, 0, 27, 0, 0, 28, 0, 0, 29, 0, 0, 30, 0, 0, 31, 0, 0, 32, 0, 0, 33, 0, 0, 34, 0, 0, 35, 0, 0, 36, 0, 0, 37, 0, 0, 38, 0, 0, 65574, 0, 0, 131110, 0, 0, 196646, 0, 0, 262182, 0, 0, 327718, 0, 0, 393254, 0, 0, 458790, 0, 0, 524326, 0, 0, 589862, 0, 0, 852006, 0, 0, 917542, 0, 0, 983078, 0, 0, 1048614, 0, 0, 1114150, 0, 0, 1179686, 0, 0, 1245222, 0, 0, 1310758, 0, 0, 1376294, 0, 0, 1441830, 0, 0, 23, 0, 0, 24, 0, 0, 25, 0, 0, 1114122, 0, 0, 1048586, 0, 0, 983050, 0, 0, 917514, 0, 0, 917513, 0, 0, 917512, 0, 0, 917511, 0, 0, 917510, 0, 0, 917509, 0, 0, 917508, 0, 0, 917507, 0, 0, 917506, 0, 0, 917505, 0, 0, 983041, 0, 0, 1048577, 0, 0, 1114113, 0, 0, 1179649, 0, 0, 1245185, 0, 0, 1310721, 0, 0, 1376257, 0, 0, 1376258, 0, 0, 1310722, 0, 0, 1245186, 0, 0, 1179650, 0, 0, 1114114, 0, 0, 1048578, 0, 0, 983042, 0, 0, 983043, 0, 0, 1048579, 0, 0, 1114115, 0, 0, 1179651, 0, 0, 1245187, 0, 0, 1310723, 0, 0, 1376259, 0, 0, 1376260, 0, 0, 1310724, 0, 0, 1245188, 0, 0, 1179652, 0, 0, 1114116, 0, 0, 1048580, 0, 0, 983044, 0, 0, 983045, 0, 0, 1048581, 0, 0, 1114117, 0, 0, 1179653, 0, 0, 1245189, 0, 0, 1310725, 0, 0, 1376261, 0, 0, 1376262, 0, 0, 1310726, 0, 0, 1245190, 0, 0, 1179654, 0, 0, 1114118, 0, 0, 1048582, 0, 0, 983046, 0, 0, 983047, 0, 0, 1048583, 0, 0, 1114119, 0, 0, 1179655, 0, 0, 1245191, 0, 0, 1310727, 0, 0, 1376263, 0, 0, 1376264, 0, 0, 1310728, 0, 0, 1245192, 0, 0, 1179656, 0, 0, 1114120, 0, 0, 1048584, 0, 0, 983048, 0, 0, 983049, 0, 0, 1048585, 0, 0, 1114121, 0, 0, 1179657, 0, 0, 1245193, 0, 0, 1310729, 0, 0, 1376265, 0, 0, 1376266, 0, 0, 1310730, 0, 0, 1245194, 0, 0, 1179658, 0, 0, 1179659, 0, 0, 1114123, 0, 0, 1048587, 0, 0, 983051, 0, 0, 917515, 0, 0, 917516, 0, 0, 983052, 0, 0, 1048588, 0, 0, 1114124, 0, 0, 1179660, 0, 0, 1245196, 0, 0, 1245195, 0, 0, 1310731, 0, 0, 1376267, 0, 0, 1376268, 0, 0, 1310732, 0, 0, 1310733, 0, 0, 1245197, 0, 0, 1179661, 0, 0, 1114125, 0, 0, 1048589, 0, 0, 983053, 0, 0, 917517, 0, 0, 917518, 0, 0, 983054, 0, 0, 1048590, 0, 0, 1114126, 0, 0, 1179662, 0, 0, 1245198, 0, 0, 1310734, 0, 0, 1376270, 0, 0, 1376269, 0, 0, 1376271, 0, 0, 1310735, 0, 0, 1245199, 0, 0, 1179663, 0, 0, 1114127, 0, 0, 1048591, 0, 0, 983055, 0, 0, 917519, 0, 0, 917520, 0, 0, 983056, 0, 0, 1048592, 0, 0, 1114128, 0, 0, 1179664, 0, 0, 1245200, 0, 0, 1310736, 0, 0, 1376272, 0, 0, 1376273, 0, 0, 1310737, 0, 0, 1245201, 0, 0, 1179665, 0, 0, 1114129, 0, 0, 1048593, 0, 0, 983057, 0, 0, 917521, 0, 0, 917522, 0, 0, 983058, 0, 0, 1048594, 0, 0, 1114130, 0, 0, 1179666, 0, 0, 1245202, 0, 0, 1310738, 0, 0, 1376274, 0, 0, 1376275, 0, 0, 1310739, 0, 0, 1245203, 0, 0, 1179667, 0, 0, 1114131, 0, 0, 1048595, 0, 0, 983059, 0, 0, 917523, 0, 0, 917524, 0, 0, 983060, 0, 0, 1048596, 0, 0, 1114132, 0, 0, 1179668, 0, 0, 1245204, 0, 0, 1310740, 0, 0, 1376276, 0, 0, 1179674, 0, 0, 1114138, 0, 0, 1048602, 0, 0, 983066, 0, 0, 917530, 0, 0, 917529, 0, 0, 917528, 0, 0, 917527, 0, 0, 917526, 0, 0, 983062, 0, 0, 1048598, 0, 0, 1114134, 0, 0, 1179670, 0, 0, 1245206, 0, 0, 1310742, 0, 0, 1376278, 0, 0, 1376279, 0, 0, 1310743, 0, 0, 1245207, 0, 0, 1179671, 0, 0, 1114135, 0, 0, 1048599, 0, 0, 983063, 0, 0, 983064, 0, 0, 1048600, 0, 0, 1114136, 0, 0, 1179672, 0, 0, 1245208, 0, 0, 1310744, 0, 0, 1376280, 0, 0, 1376281, 0, 0, 1310745, 0, 0, 1245209, 0, 0, 1179673, 0, 0, 1114137, 0, 0, 1048601, 0, 0, 983065, 0, 0, 1245210, 0, 0, 1310746, 0, 0, 1376282, 0, 0, 1376283, 0, 0, 1310747, 0, 0, 1245211, 0, 0, 1179675, 0, 0, 1114139, 0, 0, 1048603, 0, 0, 983067, 0, 0, 917531, 0, 0, 917532, 0, 0, 983068, 0, 0, 1048604, 0, 0, 1114140, 0, 0, 1179676, 0, 0, 1245212, 0, 0, 1310748, 0, 0, 1376284, 0, 0, 1376285, 0, 0, 1310749, 0, 0, 1245213, 0, 0, 1179677, 0, 0, 1114141, 0, 0, 1048605, 0, 0, 983069, 0, 0, 917533, 0, 0, 917534, 0, 0, 983070, 0, 0, 1048606, 0, 0, 1114142, 0, 0, 1179678, 0, 0, 1245214, 0, 0, 1310750, 0, 0, 1376286, 0, 0, 1376287, 0, 0, 1310751, 0, 0, 1245215, 0, 0, 1179679, 0, 0, 1114143, 0, 0, 1048607, 0, 0, 983071, 0, 0, 917535, 0, 0, 917536, 0, 0, 983072, 0, 0, 1048608, 0, 0, 1114144, 0, 0, 1179680, 0, 0, 1245216, 0, 0, 1310752, 0, 0, 1376288, 0, 0, 1376289, 0, 0, 1310753, 0, 0, 1245217, 0, 0, 1179681, 0, 0, 1114145, 0, 0, 1048609, 0, 0, 983073, 0, 0, 917537, 0, 0, 917538, 0, 0, 983074, 0, 0, 1048610, 0, 0, 1114146, 0, 0, 1179682, 0, 0, 1245218, 0, 0, 1310754, 0, 0, 1376290, 0, 0, 1376291, 0, 0, 1310755, 0, 0, 1245219, 0, 0, 1179683, 0, 0, 1114147, 0, 0, 1048611, 0, 0, 983075, 0, 0, 917539, 0, 0, 917540, 0, 0, 983076, 0, 0, 1048612, 0, 0, 1114148, 0, 0, 1179684, 0, 0, 1245220, 0, 0, 1310756, 0, 0, 1376292, 0, 0, 1376293, 0, 0, 1310757, 0, 0, 1245221, 0, 0, 1179685, 0, 0, 1114149, 0, 0, 1048613, 0, 0, 983077, 0, 0, 917541, 0, 0, 458759, 1, 0, 458760, 1, 0, 458761, 1, 0, 458762, 1, 0, 458763, 1, 0, 458771, 0, 0, 458772, 0, 0, 458764, 0, 0, 458765, 0, 0, 458766, 0, 0, 524302, 0, 0, 524301, 0, 0, 524300, 0, 0, 524307, 0, 0, 524308, 0, 0, 458770, 0, 0, 524306, 0, 0, 458769, 0, 0, 524305, 0, 0, 458773, 0, 0, 524309, 0, 0, 458776, 0, 0, 458777, 0, 0, 458778, 0, 0, 524314, 0, 0, 524313, 0, 0, 524312, 0, 0, 458779, 1, 0, 458780, 1, 0, 458781, 1, 0, 458782, 1, 0, 458783, 1, 0, 327699, 1, 0, 196627, 1, 0, 65555, 1, 0, 458768, 1, 0, 458767, 1, 0, 589840, 1, 0, 589846, 1, 0, 458774, 1, 0, 458775, 1, 0, 720918, 1, 0, 720912, 1, 0, 393241, 3, 65536, 393229, 3, 65536, 393224, 3, 196608, 393227, 3, 196608, 393234, 3, 196608, 393236, 3, 196608, 393243, 3, 196608, 393246, 3, 196608, 786465, 3, 196608, 786461, 3, 196608, 786437, 3, 196608, 786441, 3, 196608, 786449, 3, 196608, 786453, 3, 196608) +script = ExtResource("2_xxxn0") +left = true +right = true +top = true diff --git a/scenes/v2/worldgen/roomsets/standard/medium_hallway.tscn b/scenes/v2/worldgen/roomsets/standard/medium_hallway.tscn new file mode 100644 index 0000000..a90fef5 --- /dev/null +++ b/scenes/v2/worldgen/roomsets/standard/medium_hallway.tscn @@ -0,0 +1,12 @@ +[gd_scene load_steps=3 format=3 uid="uid://c1071lricsfey"] + +[ext_resource type="TileSet" uid="uid://cluemfplimly4" path="res://assets/tiles.tres" id="1_wfj1n"] +[ext_resource type="Script" path="res://scripts/v2/worldgen/standard/room.gd" id="2_vqcoc"] + +[node name="MediumHallway" type="TileMap"] +tile_set = ExtResource("1_wfj1n") +format = 2 +layer_0/tile_data = PackedInt32Array(0, 0, 0, 65536, 0, 0, 131072, 0, 0, 196608, 0, 0, 262144, 0, 0, 524288, 0, 0, 589824, 0, 0, 655360, 0, 0, 720896, 0, 0, 1, 0, 0, 720897, 0, 0, 2, 0, 0, 655362, 0, 0, 720898, 0, 0, 3, 0, 0, 720899, 0, 0, 4, 0, 0, 720900, 0, 0, 5, 0, 0, 655365, 0, 0, 720901, 0, 0, 6, 0, 0, 720902, 0, 0, 720903, 0, 0, 720904, 0, 0, 655369, 0, 0, 720905, 0, 0, 10, 0, 0, 720906, 0, 0, 11, 0, 0, 720907, 0, 0, 12, 0, 0, 720908, 0, 0, 13, 0, 0, 589837, 0, 0, 720909, 0, 0, 14, 0, 0, 524302, 0, 0, 655374, 0, 0, 720910, 0, 0, 15, 0, 0, 589839, 0, 0, 720911, 0, 0, 16, 0, 0, 65552, 0, 0, 131088, 0, 0, 196624, 0, 0, 262160, 0, 0, 524304, 0, 0, 589840, 0, 0, 655376, 0, 0, 720912, 0, 0, 786432, 0, 0, 786433, 0, 0, 786434, 0, 0, 786435, 0, 0, 786436, 0, 0, 786437, 0, 0, 786438, 0, 0, 786439, 0, 0, 786440, 0, 0, 786441, 0, 0, 786442, 0, 0, 786443, 0, 0, 786444, 0, 0, 786445, 0, 0, 786446, 0, 0, 786447, 0, 0, 786448, 0, 0, 524289, 0, 0, 589825, 0, 0, 655361, 0, 0, 524290, 0, 0, 589826, 0, 0, 524291, 0, 0, 589827, 0, 0, 655363, 0, 0, 524292, 0, 0, 589828, 0, 0, 655364, 0, 0, 524293, 0, 0, 589829, 0, 0, 524294, 0, 0, 589830, 0, 0, 655366, 0, 0, 524295, 0, 0, 589831, 0, 0, 655367, 0, 0, 524296, 0, 0, 589832, 0, 0, 655368, 0, 0, 524297, 0, 0, 589833, 0, 0, 524298, 0, 0, 589834, 0, 0, 655370, 0, 0, 524299, 0, 0, 589835, 0, 0, 655371, 0, 0, 524300, 0, 0, 589836, 0, 0, 655372, 0, 0, 524301, 0, 0, 655373, 0, 0, 589838, 0, 0, 524303, 0, 0, 655375, 0, 0, 7, 0, 0, 8, 0, 0, 9, 0, 0, 262150, 0, 0, 262151, 0, 0, 262152, 0, 0, 262153, 0, 0, 262154, 0, 0, 327687, 0, 0, 393223, 0, 0, 458759, 0, 0, 327689, 0, 0, 393225, 0, 0, 458761, 0, 0, 327688, 0, 0, 393224, 0, 0, 458760, 0, 0, 262149, 1, 0, 262148, 1, 0, 262155, 1, 0, 262156, 1, 0, 196616, 3, 65536, 196613, 3, 196608, 196619, 3, 196608, 458754, 3, 196608, 458757, 3, 196608, 458763, 3, 196608, 458766, 3, 196608) +script = ExtResource("2_vqcoc") +left = true +right = true diff --git a/scenes/v2/worldgen/roomsets/standard/medium_hallway_down.tscn b/scenes/v2/worldgen/roomsets/standard/medium_hallway_down.tscn new file mode 100644 index 0000000..de36c8f --- /dev/null +++ b/scenes/v2/worldgen/roomsets/standard/medium_hallway_down.tscn @@ -0,0 +1,13 @@ +[gd_scene load_steps=3 format=3 uid="uid://6g13ayie0xqg"] + +[ext_resource type="TileSet" uid="uid://cluemfplimly4" path="res://assets/tiles.tres" id="1_kd5p1"] +[ext_resource type="Script" path="res://scripts/v2/worldgen/standard/room.gd" id="2_ex4sw"] + +[node name="MediumHallwayDown" type="TileMap"] +tile_set = ExtResource("1_kd5p1") +format = 2 +layer_0/tile_data = PackedInt32Array(0, 0, 0, 65536, 0, 0, 131072, 0, 0, 196608, 0, 0, 262144, 0, 0, 524288, 0, 0, 589824, 0, 0, 655360, 0, 0, 720896, 0, 0, 786432, 0, 0, 1, 0, 0, 786433, 0, 0, 2, 0, 0, 786434, 0, 0, 3, 0, 0, 786435, 0, 0, 4, 0, 0, 786436, 0, 0, 5, 0, 0, 786437, 0, 0, 6, 0, 0, 786438, 0, 0, 7, 0, 0, 8, 0, 0, 9, 0, 0, 10, 0, 0, 786442, 0, 0, 11, 0, 0, 786443, 0, 0, 12, 0, 0, 786444, 0, 0, 13, 0, 0, 786445, 0, 0, 14, 0, 0, 786446, 0, 0, 15, 0, 0, 786447, 0, 0, 16, 0, 0, 65552, 0, 0, 131088, 0, 0, 196624, 0, 0, 262160, 0, 0, 524304, 0, 0, 589840, 0, 0, 655376, 0, 0, 720912, 0, 0, 786448, 0, 0, 524290, 0, 0, 524302, 0, 0, 524301, 1, 0, 524291, 1, 0, 524289, 0, 0, 589825, 0, 0, 655361, 0, 0, 720897, 0, 0, 524303, 0, 0, 589839, 0, 0, 655375, 0, 0, 720911, 0, 0, 65537, 0, 0, 131073, 0, 0, 196609, 0, 0, 262145, 0, 0, 65538, 0, 0, 131074, 0, 0, 196610, 0, 0, 262146, 0, 0, 65539, 0, 0, 131075, 0, 0, 196611, 0, 0, 262147, 0, 0, 65540, 0, 0, 131076, 0, 0, 196612, 0, 0, 262148, 0, 0, 65541, 0, 0, 131077, 0, 0, 196613, 0, 0, 262149, 0, 0, 65542, 0, 0, 131078, 0, 0, 196614, 0, 0, 262150, 0, 0, 65543, 0, 0, 131079, 0, 0, 196615, 0, 0, 262151, 0, 0, 65544, 0, 0, 131080, 0, 0, 196616, 0, 0, 262152, 0, 0, 65545, 0, 0, 131081, 0, 0, 196617, 0, 0, 262153, 0, 0, 65546, 0, 0, 131082, 0, 0, 196618, 0, 0, 262154, 0, 0, 65547, 0, 0, 131083, 0, 0, 196619, 0, 0, 262155, 0, 0, 65548, 0, 0, 131084, 0, 0, 196620, 0, 0, 262156, 0, 0, 65549, 0, 0, 131085, 0, 0, 196621, 0, 0, 262157, 0, 0, 65550, 0, 0, 131086, 0, 0, 196622, 0, 0, 262158, 0, 0, 65551, 0, 0, 131087, 0, 0, 196623, 0, 0, 262159, 0, 0, 589826, 0, 0, 655362, 0, 0, 720898, 0, 0, 589838, 0, 0, 655374, 0, 0, 720910, 0, 0, 458767, 3, 65536, 458753, 3, 65536, 720900, 3, 196608, 720908, 3, 196608) +script = ExtResource("2_ex4sw") +left = true +right = true +bottom = true diff --git a/scripts/equipment/saber.gd b/scripts/equipment/saber.gd index ac29312..9fa6926 100644 --- a/scripts/equipment/saber.gd +++ b/scripts/equipment/saber.gd @@ -8,7 +8,7 @@ var animation_player: AnimationPlayer var area: Area2D @export -var damage: int = 1 +var damage: int = 3 func _ready() -> void: self.init_equipment() diff --git a/scripts/v2/creature.gd b/scripts/v2/creature.gd index 11cb23f..f818754 100644 --- a/scripts/v2/creature.gd +++ b/scripts/v2/creature.gd @@ -5,6 +5,7 @@ signal damaged(amount) signal healed(amount) signal death() +@export_category("Creature") @export var max_hp: int = 1 @@ -33,6 +34,8 @@ var hp: int : func _ready() -> void: self.hp = self.max_hp self.death.connect(self._creature_on_death) + if self.has_method("_on_ready"): + self.call("_on_ready") func take_damage(damage: int) -> void: self.hp -= damage diff --git a/scripts/v2/enemy.gd b/scripts/v2/enemy.gd index 45129c3..e087ab6 100644 --- a/scripts/v2/enemy.gd +++ b/scripts/v2/enemy.gd @@ -14,6 +14,12 @@ var state: State = State.IDLE @export var animation_player: AnimationPlayer +@export +var sprite: Sprite2D + +@export +var detection_area: Area2D + var _chase_target: Node2D var _target_is_left: bool = false @@ -29,9 +35,13 @@ func _play_animation(animation: String) -> void: animation_player.play(animation) +func _on_ready() -> void: + self.detection_area.body_entered.connect(self._on_detection_area_entered) + func _process(delta: float) -> void: var animation_name = str(State.keys()[self.state]).to_lower() self._play_animation(animation_name) + sprite.flip_h = self._target_is_left func _physics_process(delta: float) -> void: match self.state: @@ -39,4 +49,11 @@ func _physics_process(delta: float) -> void: if not self._chase_target: self.state = State.IDLE - pass + self._target_is_left = self._chase_target.position.x < self.position.x + +func _on_detection_area_entered(body: CollisionObject2D) -> void: + match state: + State.IDLE: + if body is Player: + self._chase_target = body + self.state = State.CHASE