diff --git a/scenes/game/maps/entities/mob.tscn b/scenes/game/maps/entities/mob.tscn index e8ab632..a96717e 100644 --- a/scenes/game/maps/entities/mob.tscn +++ b/scenes/game/maps/entities/mob.tscn @@ -122,8 +122,11 @@ animations = [{ "speed": 5.0 }] -[node name="Mob" type="Node2D"] +[node name="Mob" type="Node2D" node_paths=PackedStringArray("animator", "collisionRay_1", "collisionRay_2")] script = ExtResource("1_mu6cs") +animator = NodePath("AnimatedSprite2D") +collisionRay_1 = NodePath("CollisionRayCast_1") +collisionRay_2 = NodePath("CollisionRayCast_2") [node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] position = Vector2(8, 8) diff --git a/scenes/game/maps/entities/player.tscn b/scenes/game/maps/entities/player.tscn index 92d2726..9c4e2da 100644 --- a/scenes/game/maps/entities/player.tscn +++ b/scenes/game/maps/entities/player.tscn @@ -5,3 +5,6 @@ [node name="Player" instance=ExtResource("1_7y2qh")] script = ExtResource("2_us7jc") + +[node name="Camera2D" type="Camera2D" parent="." index="3"] +zoom = Vector2(2, 2) diff --git a/scenes/game/maps/world_map.tscn b/scenes/game/maps/world_map.tscn index a70e64f..512a358 100644 --- a/scenes/game/maps/world_map.tscn +++ b/scenes/game/maps/world_map.tscn @@ -1,10 +1,11 @@ [gd_scene load_steps=3 format=3 uid="uid://cspwqlbaoldqe"] [ext_resource type="TileSet" uid="uid://c21smbsro4gdq" path="res://tilesets/default.tres" id="1_wjcuv"] -[ext_resource type="Script" uid="uid://bbrwrbwsxt32g" path="res://scripts/game/maps/world_map.gd" id="2_yhw3p"] +[ext_resource type="Script" uid="uid://bbrwrbwsxt32g" path="res://scripts/game/maps/WorldMap.gd" id="2_yhw3p"] [node name="World Map" type="TileMap"] tile_set = ExtResource("1_wjcuv") format = 2 layer_0/tile_data = PackedInt32Array(196613, 262144, 9, 262149, 262144, 9, 327685, 262144, 9, 393221, 262144, 9, 458757, 262144, 9, 524293, 262144, 9, 589829, 262144, 9, 655365, 0, 1, 720901, 0, 1, 786437, 262144, 9, 851973, 262144, 9, 917509, 262144, 9, 983045, 262144, 9, 1048581, 262144, 9, 1114117, 262144, 9, 1179653, 262144, 9, 1245189, 262144, 9, 1310725, 262144, 9, 1376261, 262144, 9, 1441797, 262144, 9, 196614, 262144, 9, 262150, 262144, 9, 327686, 262144, 9, 393222, 262144, 9, 458758, 262144, 9, 524294, 0, 1, 589830, 0, 1, 655366, 0, 1, 720902, 0, 1, 786438, 0, 1, 851974, 0, 1, 917510, 262144, 9, 983046, 262144, 9, 1048582, 262144, 9, 1114118, 262144, 9, 1179654, 262144, 9, 1245190, 262144, 9, 1310726, 262144, 9, 1376262, 262144, 9, 1441798, 262144, 9, 196615, 262144, 9, 262151, 262144, 9, 327687, 262144, 9, 393223, 262144, 9, 458759, 262144, 9, 524295, 0, 1, 589831, 0, 1, 655367, 0, 1, 720903, 0, 1, 786439, 0, 1, 851975, 0, 1, 917511, 0, 1, 983047, 262144, 9, 1048583, 262144, 9, 1114119, 262144, 9, 1179655, 262144, 9, 1245191, 262144, 9, 1310727, 262144, 9, 1376263, 262144, 9, 1441799, 262144, 9, 196616, 262144, 9, 262152, 262144, 9, 327688, 262144, 9, 393224, 262144, 9, 458760, 65536, 0, 524296, 0, 1, 589832, 0, 1, 655368, 0, 1, 720904, 0, 1, 786440, 0, 1, 851976, 0, 1, 917512, 0, 1, 983048, 65536, 0, 1048584, 65536, 0, 1114120, 262144, 9, 1179656, 262144, 9, 1245192, 262144, 9, 1310728, 262144, 9, 1376264, 262144, 9, 1441800, 262144, 9, 196617, 262144, 9, 262153, 262144, 9, 327689, 65536, 2, 393225, 65536, 0, 458761, 65536, 0, 524297, 65536, 2, 589833, 0, 1, 655369, 0, 1, 720905, 65536, 2, 786441, 65536, 2, 851977, 65536, 2, 917513, 65536, 2, 983049, 65536, 0, 1048585, 65536, 0, 1114121, 262144, 9, 1179657, 262144, 9, 1245193, 262144, 9, 1310729, 262144, 9, 1376265, 262144, 9, 1441801, 262144, 9, 196618, 262144, 9, 262154, 262144, 9, 327690, 65536, 2, 393226, 65536, 0, 458762, 65536, 0, 524298, 65536, 2, 589834, 65536, 2, 655370, 65536, 2, 720906, 65536, 2, 786442, 65536, 2, 851978, 65536, 2, 917514, 65536, 2, 983050, 65536, 0, 1048586, 65536, 0, 1114122, 65536, 0, 1179658, 262144, 9, 1245194, 262144, 9, 1310730, 262144, 9, 1376266, 262144, 9, 1441802, 262144, 9, 196619, 262144, 9, 262155, 262144, 9, 327691, 65536, 2, 393227, 65536, 0, 458763, 65536, 0, 524299, 65536, 0, 589835, 65536, 0, 655371, 65536, 2, 720907, 65536, 2, 786443, 65536, 2, 851979, 65536, 2, 917515, 65536, 2, 983051, 65536, 0, 1048587, 65536, 0, 1114123, 65536, 0, 1179659, 65536, 0, 1245195, 262144, 9, 1310731, 262144, 9, 1376267, 262144, 9, 1441803, 262144, 9, 196620, 262144, 9, 262156, 262144, 9, 327692, 65536, 2, 393228, 65536, 2, 458764, 65536, 2, 524300, 65536, 0, 589836, 65536, 0, 655372, 65536, 2, 720908, 65536, 2, 786444, 65536, 2, 851980, 65536, 2, 917516, 65536, 0, 983052, 65536, 0, 1048588, 65536, 0, 1114124, 65536, 0, 1179660, 65536, 0, 1245196, 262144, 9, 1310732, 262144, 9, 1376268, 262144, 9, 1441804, 262144, 9, 196621, 262144, 9, 262157, 262144, 9, 327693, 65536, 2, 393229, 65536, 2, 458765, 65536, 2, 524301, 65536, 0, 589837, 65536, 0, 655373, 65536, 2, 720909, 65536, 2, 786445, 65536, 2, 851981, 65536, 2, 917517, 65536, 0, 983053, 65536, 0, 1048589, 65536, 0, 1114125, 65536, 0, 1179661, 65536, 0, 1245197, 262144, 9, 1310733, 262144, 9, 1376269, 262144, 9, 1441805, 262144, 9, 196622, 262144, 9, 262158, 262144, 9, 327694, 65536, 2, 393230, 65536, 2, 458766, 65536, 2, 524302, 65536, 0, 589838, 65536, 0, 655374, 65536, 2, 720910, 65536, 2, 786446, 65536, 2, 851982, 65536, 0, 917518, 65536, 0, 983054, 65536, 0, 1048590, 65536, 0, 1114126, 65536, 0, 1179662, 65536, 0, 1245198, 262144, 9, 1310734, 262144, 9, 1376270, 262144, 9, 1441806, 262144, 9, 196623, 262144, 9, 262159, 262144, 9, 327695, 65536, 2, 393231, 65536, 2, 458767, 65536, 2, 524303, 65536, 0, 589839, 65536, 0, 655375, 65536, 2, 720911, 65536, 2, 786447, 65536, 0, 851983, 65536, 0, 917519, 65536, 0, 983055, 65536, 0, 1048591, 65536, 0, 1114127, 65536, 0, 1179663, 65536, 0, 1245199, 262144, 9, 1310735, 262144, 9, 1376271, 262144, 9, 1441807, 262144, 9, 196624, 262144, 9, 262160, 262144, 9, 327696, 65536, 2, 393232, 65536, 2, 458768, 65536, 2, 524304, 65536, 0, 589840, 65536, 0, 655376, 65536, 0, 720912, 65536, 0, 786448, 65536, 0, 851984, 65536, 0, 917520, 65536, 0, 983056, 65536, 0, 1048592, 65536, 0, 1114128, 65536, 0, 1179664, 65536, 0, 1245200, 262144, 9, 1310736, 262144, 9, 1376272, 262144, 9, 1441808, 262144, 9, 196625, 262144, 9, 262161, 262144, 9, 327697, 262144, 9, 393233, 0, 0, 458769, 65536, 2, 524305, 65536, 0, 589841, 65536, 0, 655377, 65536, 0, 720913, 65536, 0, 786449, 65536, 0, 851985, 65536, 0, 917521, 65536, 0, 983057, 65536, 0, 1048593, 65536, 0, 1114129, 65536, 0, 1179665, 65536, 0, 1245201, 65536, 0, 1310737, 131072, 1, 1376273, 131072, 1, 1441809, 262144, 9, 196626, 262144, 9, 262162, 262144, 9, 327698, 262144, 9, 393234, 262144, 9, 458770, 65536, 0, 524306, 65536, 0, 589842, 65536, 0, 655378, 65536, 0, 720914, 65536, 0, 786450, 65536, 0, 851986, 65536, 0, 917522, 65536, 0, 983058, 65536, 0, 1048594, 65536, 0, 1114130, 65536, 0, 1179666, 65536, 0, 1245202, 65536, 0, 1310738, 65536, 0, 1376274, 131072, 1, 1441810, 131072, 1, 196627, 262144, 9, 262163, 262144, 9, 327699, 262144, 9, 393235, 262144, 9, 458771, 262144, 9, 524307, 65536, 0, 589843, 65536, 0, 655379, 65536, 0, 720915, 65536, 0, 786451, 65536, 0, 851987, 65536, 0, 917523, 65536, 0, 983059, 65536, 0, 1048595, 65536, 0, 1114131, 65536, 0, 1179667, 262144, 9, 1245203, 262144, 9, 1310739, 65536, 0, 1376275, 131072, 1, 1441811, 131072, 1, 196628, 262144, 9, 262164, 262144, 9, 327700, 262144, 9, 393236, 262144, 9, 458772, 262144, 9, 524308, 262144, 9, 589844, 65536, 0, 655380, 65536, 0, 720916, 65536, 0, 786452, 65536, 0, 851988, 65536, 0, 917524, 65536, 0, 983060, 65536, 0, 1048596, 65536, 0, 1114132, 65536, 0, 1179668, 262144, 9, 1245204, 262144, 9, 1310740, 65536, 0, 1376276, 131072, 1, 1441812, 131072, 1, 196629, 262144, 9, 262165, 262144, 9, 327701, 262144, 9, 393237, 262144, 9, 458773, 262144, 9, 524309, 262144, 9, 589845, 262144, 9, 655381, 65536, 0, 720917, 65536, 0, 786453, 65536, 0, 851989, 65536, 0, 917525, 65536, 0, 983061, 65536, 0, 1048597, 65536, 0, 1114133, 262144, 9, 1179669, 262144, 9, 1245205, 262144, 9, 1310741, 65536, 0, 1376277, 131072, 1, 1441813, 131072, 1, 196630, 262144, 9, 262166, 262144, 9, 327702, 262144, 9, 393238, 262144, 9, 458774, 262144, 9, 524310, 262144, 9, 589846, 262144, 9, 655382, 262144, 9, 720918, 65536, 0, 786454, 65536, 0, 851990, 65536, 0, 917526, 65536, 0, 983062, 65536, 0, 1048598, 262144, 9, 1114134, 262144, 9, 1179670, 262144, 9, 1245206, 262144, 9, 1310742, 262144, 9, 1376278, 131072, 1, 1441814, 131072, 1, 196631, 262144, 9, 262167, 262144, 9, 327703, 262144, 9, 393239, 262144, 9, 458775, 262144, 9, 524311, 262144, 9, 589847, 262144, 9, 655383, 262144, 9, 720919, 65536, 0, 786455, 65536, 0, 851991, 65536, 0, 917527, 65536, 0, 983063, 65536, 0, 1048599, 262144, 9, 1114135, 262144, 9, 1179671, 262144, 9, 1245207, 262144, 9, 1310743, 262144, 9, 1376279, 131072, 1, 1441815, 131072, 1, 196632, 262144, 9, 262168, 262144, 9, 327704, 262144, 9, 393240, 262144, 9, 458776, 262144, 9, 524312, 262144, 9, 589848, 262144, 9, 655384, 262144, 9, 720920, 262144, 9, 786456, 65536, 0, 851992, 65536, 0, 917528, 65536, 0, 983064, 65536, 0, 1048600, 65536, 0, 1114136, 262144, 9, 1179672, 262144, 9, 1245208, 262144, 9, 1310744, 262144, 9, 1376280, 262144, 9, 1441816, 131072, 1, 196633, 262144, 9, 262169, 262144, 9, 327705, 262144, 9, 393241, 262144, 9, 458777, 262144, 9, 524313, 262144, 9, 589849, 262144, 9, 655385, 262144, 9, 720921, 65536, 0, 786457, 65536, 0, 851993, 65536, 0, 917529, 65536, 0, 983065, 65536, 0, 1048601, 65536, 0, 1114137, 262144, 9, 1179673, 262144, 9, 1245209, 262144, 9, 1310745, 262144, 9, 1376281, 262144, 9, 1441817, 262144, 9, 196634, 262144, 9, 262170, 262144, 9, 327706, 262144, 9, 393242, 262144, 9, 458778, 262144, 9, 524314, 262144, 9, 589850, 262144, 9, 655386, 65536, 0, 720922, 65536, 0, 786458, 65536, 0, 851994, 65536, 0, 917530, 65536, 0, 983066, 65536, 0, 1048602, 65536, 0, 1114138, 65536, 0, 1179674, 262144, 9, 1245210, 262144, 9, 1310746, 262144, 9, 1376282, 262144, 9, 1441818, 262144, 9, 196635, 262144, 9, 262171, 262144, 9, 327707, 262144, 9, 393243, 262144, 9, 458779, 262144, 9, 524315, 262144, 9, 589851, 262144, 9, 655387, 65536, 0, 720923, 65536, 0, 786459, 0, 1, 851995, 0, 1, 917531, 0, 1, 983067, 65536, 0, 1048603, 65536, 0, 1114139, 65536, 0, 1179675, 65536, 0, 1245211, 262144, 9, 1310747, 262144, 9, 1376283, 262144, 9, 1441819, 262144, 9, 196636, 262144, 9, 262172, 262144, 9, 327708, 262144, 9, 393244, 262144, 9, 458780, 262144, 9, 524316, 262144, 9, 589852, 65536, 0, 655388, 65536, 0, 720924, 65536, 0, 786460, 0, 1, 851996, 0, 1, 917532, 0, 1, 983068, 65536, 0, 1048604, 65536, 0, 1114140, 65536, 0, 1179676, 65536, 0, 1245212, 262144, 9, 1310748, 262144, 9, 1376284, 262144, 9, 1441820, 262144, 9, 196637, 262144, 9, 262173, 262144, 9, 327709, 262144, 9, 393245, 262144, 9, 458781, 262144, 9, 524317, 65536, 0, 589853, 65536, 0, 655389, 65536, 0, 720925, 0, 1, 786461, 0, 1, 851997, 0, 1, 917533, 0, 1, 983069, 0, 1, 1048605, 65536, 0, 1114141, 65536, 0, 1179677, 65536, 0, 1245213, 65536, 0, 1310749, 262144, 9, 1376285, 262144, 9, 1441821, 262144, 9, 196638, 262144, 9, 262174, 262144, 9, 327710, 262144, 9, 393246, 262144, 9, 458782, 65536, 0, 524318, 65536, 0, 589854, 65536, 0, 655390, 0, 1, 720926, 0, 1, 786462, 0, 1, 851998, 0, 1, 917534, 0, 1, 983070, 0, 1, 1048606, 65536, 0, 1114142, 65536, 0, 1179678, 65536, 0, 1245214, 65536, 0, 1310750, 65536, 0, 1376286, 262144, 9, 1441822, 262144, 9, 196639, 262144, 9, 262175, 262144, 9, 327711, 262144, 9, 393247, 262144, 9, 458783, 65536, 0, 524319, 65536, 0, 589855, 65536, 0, 655391, 0, 1, 720927, 0, 1, 786463, 0, 1, 851999, 0, 1, 917535, 65536, 0, 983071, 65536, 0, 1048607, 65536, 0, 1114143, 65536, 0, 1179679, 65536, 0, 1245215, 65536, 0, 1310751, 65536, 0, 1376287, 262144, 9, 1441823, 262144, 9, 196640, 262144, 9, 262176, 262144, 9, 327712, 262144, 9, 393248, 262144, 9, 458784, 65536, 0, 524320, 65536, 0, 589856, 65536, 0, 655392, 65536, 0, 720928, 65536, 0, 786464, 65536, 0, 852000, 65536, 0, 917536, 65536, 0, 983072, 65536, 0, 1048608, 65536, 0, 1114144, 65536, 0, 1179680, 65536, 0, 1245216, 65536, 0, 1310752, 65536, 0, 1376288, 65536, 0, 1441824, 65536, 0, 196641, 262144, 9, 262177, 262144, 9, 327713, 262144, 9, 393249, 262144, 9, 458785, 65536, 0, 524321, 65536, 0, 589857, 65536, 0, 655393, 65536, 0, 720929, 65536, 0, 786465, 65536, 0, 852001, 65536, 0, 917537, 65536, 0, 983073, 65536, 0, 1048609, 65536, 0, 1114145, 65536, 0, 1179681, 65536, 0, 1245217, 65536, 0, 1310753, 65536, 0, 1376289, 65536, 0, 1441825, 65536, 0, 196642, 262144, 9, 262178, 262144, 9, 327714, 262144, 9, 393250, 262144, 9, 458786, 65536, 0, 524322, 65536, 0, 589858, 65536, 0, 655394, 65536, 0, 720930, 65536, 0, 786466, 65536, 0, 852002, 65536, 0, 917538, 65536, 0, 983074, 65536, 0, 1048610, 65536, 0, 1114146, 65536, 0, 1179682, 65536, 0, 1245218, 65536, 0, 1310754, 65536, 0, 1376290, 65536, 0, 1441826, 65536, 0, 196643, 262144, 9, 262179, 262144, 9, 327715, 262144, 9, 393251, 262144, 9, 458787, 65536, 0, 524323, 65536, 0, 589859, 65536, 0, 655395, 65536, 0, 720931, 65536, 0, 786467, 65536, 0, 852003, 65536, 0, 917539, 65536, 0, 983075, 65536, 0, 1048611, 65536, 0, 1114147, 65536, 0, 1179683, 65536, 0, 1245219, 65536, 0, 1310755, 65536, 0, 1376291, 65536, 0, 1441827, 65536, 0, 196644, 262144, 9, 262180, 262144, 9, 327716, 262144, 9, 393252, 262144, 9, 458788, 65536, 0, 524324, 65536, 0, 589860, 65536, 0, 655396, 65536, 0, 720932, 65536, 0, 786468, 65536, 0, 852004, 65536, 0, 917540, 65536, 0, 983076, 65536, 0, 1048612, 65536, 0, 1114148, 65536, 0, 1179684, 65536, 0, 1245220, 65536, 0, 1310756, 65536, 0, 1376292, 65536, 0, 1441828, 65536, 0, 196645, 262144, 9, 262181, 262144, 9, 327717, 262144, 9, 393253, 262144, 9, 458789, 65536, 0, 524325, 65536, 0, 589861, 65536, 0, 655397, 65536, 0, 720933, 65536, 0, 786469, 65536, 0, 852005, 65536, 0, 917541, 65536, 0, 983077, 65537, 21, 1048613, 65536, 0, 1114149, 65536, 0, 1179685, 65536, 0, 1245221, 0, 5, 1310757, 0, 5, 1376293, 65536, 0, 1441829, 65536, 0, 196646, 262144, 9, 262182, 262144, 9, 327718, 262144, 9, 393254, 262144, 9, 458790, 262144, 9, 524326, 65536, 0, 589862, 65536, 0, 655398, 65536, 0, 720934, 65536, 0, 786470, 65536, 0, 852006, 0, 5, 917542, 0, 5, 983078, 0, 5, 1048614, 0, 5, 1114150, 0, 5, 1179686, 0, 5, 1245222, 0, 5, 1310758, 0, 5, 1376294, 65536, 0, 1441830, 65536, 0, 196647, 262144, 9, 262183, 262144, 9, 327719, 262144, 9, 393255, 262144, 9, 458791, 262144, 9, 524327, 65536, 0, 589863, 65536, 0, 655399, 65536, 0, 720935, 65536, 0, 786471, 65536, 0, 852007, 0, 5, 917543, 0, 5, 983079, 0, 5, 1048615, 0, 5, 1114151, 0, 5, 1179687, 0, 5, 1245223, 0, 5, 1310759, 0, 5, 1376295, 65536, 0, 1441831, 65536, 0, 1507333, 262144, 9, 1572869, 262144, 9, 1638405, 262144, 9, 1507334, 262144, 9, 1572870, 262144, 9, 1638406, 262144, 9, 1507335, 262144, 9, 1572871, 262144, 9, 1638407, 262144, 9, 1507336, 262144, 9, 1572872, 262144, 9, 1638408, 262144, 9, 1507337, 262144, 9, 1572873, 262144, 9, 1638409, 262144, 9, 1507338, 262144, 9, 1572874, 262144, 9, 1638410, 262144, 9, 1507339, 262144, 9, 1572875, 262144, 9, 1638411, 262144, 9, 1507340, 262144, 9, 1572876, 262144, 9, 1638412, 262144, 9, 1507341, 262144, 9, 1572877, 262144, 9, 1638413, 262144, 9, 1507342, 262144, 9, 1572878, 262144, 9, 1638414, 262144, 9, 1507343, 262144, 9, 1572879, 262144, 9, 1638415, 262144, 9, 1507344, 262144, 9, 1572880, 262144, 9, 1638416, 262144, 9, 1507345, 262144, 9, 1572881, 262144, 9, 1638417, 262144, 9, 1507346, 131072, 1, 1572882, 262144, 9, 1638418, 262144, 9, 1507347, 131072, 1, 1572883, 262144, 9, 1638419, 262144, 9, 1507348, 131072, 1, 1572884, 262144, 9, 1638420, 262144, 9, 1507349, 131072, 1, 1572885, 262144, 9, 1638421, 262144, 9, 1507350, 131072, 1, 1572886, 262144, 9, 1638422, 262144, 9, 1507351, 131072, 1, 1572887, 131072, 1, 1638423, 262144, 9, 1507352, 131072, 1, 1572888, 131072, 1, 1638424, 262144, 9, 1507353, 262144, 9, 1572889, 262144, 9, 1638425, 262144, 9, 1507354, 262144, 9, 1572890, 262144, 9, 1638426, 262144, 9, 1507355, 262144, 9, 1572891, 262144, 9, 1638427, 262144, 9, 1507356, 262144, 9, 1572892, 262144, 9, 1638428, 262144, 9, 1507357, 262144, 9, 1572893, 262144, 9, 1638429, 262144, 9, 1507358, 262144, 9, 1572894, 262144, 9, 1638430, 262144, 9, 1507359, 262144, 9, 1572895, 262144, 9, 1638431, 262144, 9, 1507360, 262144, 9, 1572896, 262144, 9, 1638432, 262144, 9, 1507361, 65536, 0, 1572897, 262144, 9, 1638433, 262144, 9, 1507362, 65536, 0, 1572898, 65536, 0, 1638434, 262144, 9, 1507363, 65536, 0, 1572899, 65536, 0, 1638435, 262144, 9, 1507364, 65536, 0, 1572900, 65536, 0, 1638436, 262144, 9, 1507365, 65536, 0, 1572901, 65536, 0, 1638437, 262144, 9, 1507366, 65536, 0, 1572902, 65536, 0, 1638438, 65536, 0, 1507367, 65536, 0, 1572903, 65536, 0, 1638439, 65536, 0, 196648, 262144, 9, 262184, 262144, 9, 327720, 262144, 9, 393256, 262144, 9, 458792, 262144, 9, 524328, 65536, 0, 589864, 65536, 0, 655400, 65536, 0, 720936, 65536, 0, 786472, 65536, 0, 852008, 0, 5, 917544, 0, 5, 983080, 0, 5, 1048616, 0, 5, 1114152, 0, 5, 1179688, 0, 5, 1245224, 0, 5, 1310760, 65536, 0, 1376296, 65536, 0, 1441832, 65536, 0, 1507368, 65536, 0, 1572904, 65536, 0, 1638440, 65536, 0, 196649, 262144, 9, 262185, 262144, 9, 327721, 262144, 9, 393257, 262144, 9, 458793, 262144, 9, 524329, 262144, 9, 589865, 65536, 0, 655401, 65536, 0, 720937, 65536, 0, 786473, 65536, 0, 852009, 0, 5, 917545, 0, 5, 983081, 0, 5, 1048617, 196609, 6, 1114153, 0, 5, 1179689, 0, 5, 1245225, 0, 5, 1310761, 65536, 0, 1376297, 65536, 0, 1441833, 65536, 0, 1507369, 65536, 0, 1572905, 65536, 0, 1638441, 65536, 0, 196650, 262144, 9, 262186, 262144, 9, 327722, 262144, 9, 393258, 262144, 9, 458794, 262144, 9, 524330, 262144, 9, 589866, 65536, 0, 655402, 65536, 0, 720938, 65536, 0, 786474, 65536, 0, 852010, 65536, 0, 917546, 0, 5, 983082, 0, 5, 1048618, 0, 5, 1114154, 0, 5, 1179690, 0, 5, 1245226, 0, 5, 1310762, 65536, 0, 1376298, 65536, 0, 1441834, 65536, 0, 1507370, 65536, 0, 1572906, 65536, 0, 1638442, 65536, 0, 196651, 262144, 9, 262187, 262144, 9, 327723, 262144, 9, 393259, 262144, 9, 458795, 262144, 9, 524331, 262144, 9, 589867, 262144, 9, 655403, 65536, 0, 720939, 65536, 0, 786475, 65536, 0, 852011, 65536, 0, 917547, 65536, 0, 983083, 0, 5, 1048619, 0, 5, 1114155, 65536, 0, 1179691, 65536, 0, 1245227, 65536, 0, 1310763, 65536, 0, 1376299, 65536, 0, 1441835, 65536, 0, 1507371, 65536, 0, 1572907, 65536, 0, 1638443, 65536, 0, 196652, 262144, 9, 262188, 262144, 9, 327724, 262144, 9, 393260, 262144, 9, 458796, 262144, 9, 524332, 262144, 9, 589868, 262144, 9, 655404, 262144, 9, 720940, 65536, 0, 786476, 65536, 0, 852012, 65536, 0, 917548, 65536, 0, 983084, 65536, 0, 1048620, 65536, 0, 1114156, 65536, 0, 1179692, 65536, 0, 1245228, 65536, 0, 1310764, 65536, 0, 1376300, 65536, 0, 1441836, 65536, 0, 1507372, 65536, 0, 1572908, 65536, 0, 1638444, 262144, 9, 0, 262144, 9, 65536, 262144, 9, 131072, 262144, 9, 196608, 262144, 9, 262144, 262144, 9, 327680, 262144, 9, 393216, 262144, 9, 458752, 262144, 9, 524288, 262144, 9, 589824, 262144, 9, 655360, 262144, 9, 720896, 262144, 9, 786432, 262144, 9, 851968, 262144, 9, 917504, 262144, 9, 983040, 262144, 9, 1048576, 262144, 9, 1114112, 262144, 9, 1179648, 262144, 9, 1245184, 262144, 9, 1310720, 262144, 9, 1376256, 262144, 9, 1441792, 262144, 9, 1507328, 262144, 9, 1572864, 262144, 9, 1638400, 262144, 9, 1703936, 262144, 9, 1769472, 262144, 9, 1835008, 262144, 9, 1900544, 262144, 9, 1900545, 262144, 9, 1900546, 262144, 9, 1900547, 262144, 9, 1900548, 262144, 9, 1900549, 262144, 9, 1900550, 262144, 9, 1900551, 262144, 9, 1900552, 262144, 9, 1900553, 262144, 9, 1900554, 262144, 9, 1900555, 262144, 9, 1900556, 262144, 9, 1900557, 262144, 9, 1900558, 262144, 9, 1900559, 262144, 9, 1900560, 262144, 9, 1900561, 262144, 9, 1900562, 262144, 9, 1900563, 262144, 9, 1900564, 262144, 9, 1900565, 262144, 9, 1900566, 262144, 9, 1900567, 262144, 9, 1900568, 262144, 9, 1900569, 262144, 9, 1900570, 262144, 9, 1900571, 262144, 9, 1900572, 262144, 9, 1900573, 262144, 9, 1900574, 262144, 9, 1900575, 262144, 9, 1900576, 262144, 9, 1900577, 262144, 9, 1900578, 262144, 9, 1900579, 262144, 9, 1900580, 262144, 9, 1900581, 262144, 9, 1900582, 262144, 9, 1900583, 262144, 9, 1900584, 262144, 9, 1900585, 262144, 9, 1900586, 262144, 9, 1900587, 262144, 9, 1900588, 262144, 9, 1900589, 262144, 9, 1900590, 262144, 9, 1900591, 262144, 9, 1900592, 262144, 9, 1835056, 262144, 9, 1769520, 262144, 9, 1703984, 262144, 9, 1638448, 262144, 9, 1572912, 262144, 9, 1507376, 262144, 9, 1441840, 262144, 9, 1376304, 262144, 9, 1310768, 262144, 9, 1245232, 262144, 9, 1179696, 262144, 9, 1114160, 262144, 9, 1048624, 262144, 9, 983088, 262144, 9, 917552, 262144, 9, 852016, 262144, 9, 786480, 262144, 9, 720944, 262144, 9, 655408, 262144, 9, 589872, 262144, 9, 524336, 262144, 9, 458800, 262144, 9, 393264, 262144, 9, 327728, 262144, 9, 262192, 262144, 9, 196656, 262144, 9, 131120, 262144, 9, 65584, 262144, 9, 48, 262144, 9, 47, 262144, 9, 46, 262144, 9, 45, 262144, 9, 44, 262144, 9, 43, 262144, 9, 42, 262144, 9, 41, 262144, 9, 40, 262144, 9, 39, 262144, 9, 38, 262144, 9, 37, 262144, 9, 36, 262144, 9, 35, 262144, 9, 34, 262144, 9, 33, 262144, 9, 32, 262144, 9, 31, 262144, 9, 30, 262144, 9, 29, 262144, 9, 28, 262144, 9, 27, 262144, 9, 26, 262144, 9, 25, 262144, 9, 24, 262144, 9, 23, 262144, 9, 22, 262144, 9, 21, 262144, 9, 20, 262144, 9, 19, 262144, 9, 18, 262144, 9, 17, 262144, 9, 16, 262144, 9, 15, 262144, 9, 14, 262144, 9, 13, 262144, 9, 12, 262144, 9, 11, 262144, 9, 10, 262144, 9, 9, 262144, 9, 8, 262144, 9, 7, 262144, 9, 6, 262144, 9, 5, 262144, 9, 4, 262144, 9, 3, 262144, 9, 2, 262144, 9, 1, 262144, 9, 1572867, 262144, 9, 1507331, 262144, 9, 1441795, 262144, 9, 1376259, 262144, 9, 1310723, 262144, 9, 1245187, 262144, 9, 1179651, 262144, 9, 1114115, 262144, 9, 1048579, 262144, 9, 983043, 262144, 9, 917507, 262144, 9, 851971, 262144, 9, 786435, 262144, 9, 720899, 262144, 9, 655363, 262144, 9, 589827, 262144, 9, 524291, 262144, 9, 458755, 262144, 9, 393219, 262144, 9, 327683, 262144, 9, 262147, 262144, 9, 196611, 262144, 9, 131075, 262144, 9, 65539, 262144, 9, 65538, 262144, 9, 65537, 262144, 9, 131073, 262144, 9, 196609, 262144, 9, 262145, 262144, 9, 327681, 262144, 9, 393217, 262144, 9, 458753, 262144, 9, 524289, 262144, 9, 589825, 262144, 9, 655361, 262144, 9, 720897, 262144, 9, 786433, 262144, 9, 851969, 262144, 9, 917505, 262144, 9, 983041, 262144, 9, 1048577, 262144, 9, 1114113, 262144, 9, 1179649, 262144, 9, 1245185, 262144, 9, 1310721, 262144, 9, 1376257, 262144, 9, 1441793, 262144, 9, 1507329, 262144, 9, 1572865, 262144, 9, 1638401, 262144, 9, 1703937, 262144, 9, 1769473, 262144, 9, 1835009, 262144, 9, 1835010, 262144, 9, 1769474, 262144, 9, 1703938, 262144, 9, 1638402, 262144, 9, 1572866, 262144, 9, 1507330, 262144, 9, 1441794, 262144, 9, 1376258, 262144, 9, 1310722, 262144, 9, 1245186, 262144, 9, 1179650, 262144, 9, 1114114, 262144, 9, 1048578, 262144, 9, 983042, 262144, 9, 917506, 262144, 9, 851970, 262144, 9, 786434, 262144, 9, 720898, 262144, 9, 655362, 262144, 9, 589826, 262144, 9, 524290, 262144, 9, 458754, 262144, 9, 393218, 262144, 9, 327682, 262144, 9, 262146, 262144, 9, 196610, 262144, 9, 131074, 262144, 9, 1638403, 262144, 9, 1703939, 262144, 9, 1769475, 262144, 9, 1835011, 262144, 9, 1835012, 262144, 9, 1769476, 262144, 9, 1703940, 262144, 9, 1638404, 262144, 9, 1572868, 262144, 9, 1507332, 262144, 9, 1441796, 262144, 9, 1376260, 262144, 9, 1310724, 262144, 9, 1245188, 262144, 9, 1179652, 262144, 9, 1114116, 262144, 9, 1048580, 262144, 9, 983044, 262144, 9, 917508, 262144, 9, 851972, 262144, 9, 786436, 262144, 9, 720900, 262144, 9, 655364, 262144, 9, 589828, 262144, 9, 524292, 262144, 9, 458756, 262144, 9, 393220, 262144, 9, 327684, 262144, 9, 262148, 262144, 9, 196612, 262144, 9, 131076, 262144, 9, 65540, 262144, 9, 65541, 262144, 9, 131077, 262144, 9, 131078, 262144, 9, 65542, 262144, 9, 65543, 262144, 9, 131079, 262144, 9, 131080, 262144, 9, 65544, 262144, 9, 65545, 262144, 9, 131081, 262144, 9, 131082, 262144, 9, 65546, 262144, 9, 65547, 262144, 9, 131083, 262144, 9, 131084, 262144, 9, 65548, 262144, 9, 65549, 262144, 9, 131085, 262144, 9, 131086, 262144, 9, 65550, 262144, 9, 65551, 262144, 9, 131087, 262144, 9, 131088, 262144, 9, 65552, 262144, 9, 65553, 262144, 9, 131089, 262144, 9, 131090, 262144, 9, 65554, 262144, 9, 65555, 262144, 9, 131091, 262144, 9, 131092, 262144, 9, 65556, 262144, 9, 65557, 262144, 9, 131093, 262144, 9, 131094, 262144, 9, 65558, 262144, 9, 65559, 262144, 9, 131095, 262144, 9, 131096, 262144, 9, 65560, 262144, 9, 65561, 262144, 9, 131097, 262144, 9, 131098, 262144, 9, 65562, 262144, 9, 65563, 262144, 9, 131099, 262144, 9, 131100, 262144, 9, 65564, 262144, 9, 65565, 262144, 9, 131101, 262144, 9, 131102, 262144, 9, 65566, 262144, 9, 65567, 262144, 9, 131103, 262144, 9, 131104, 262144, 9, 65568, 262144, 9, 65569, 262144, 9, 131105, 262144, 9, 131106, 262144, 9, 65570, 262144, 9, 65571, 262144, 9, 131107, 262144, 9, 131108, 262144, 9, 65572, 262144, 9, 65573, 262144, 9, 131109, 262144, 9, 131110, 262144, 9, 65574, 262144, 9, 65575, 262144, 9, 131111, 262144, 9, 131112, 262144, 9, 65576, 262144, 9, 65577, 262144, 9, 131113, 262144, 9, 131114, 262144, 9, 65578, 262144, 9, 65579, 262144, 9, 131115, 262144, 9, 131116, 262144, 9, 65580, 262144, 9, 65581, 262144, 9, 131117, 262144, 9, 196653, 262144, 9, 262189, 262144, 9, 327725, 262144, 9, 393261, 262144, 9, 458797, 262144, 9, 524333, 262144, 9, 589869, 262144, 9, 655405, 262144, 9, 720941, 262144, 9, 786477, 65536, 0, 852013, 65536, 0, 917549, 65536, 0, 983085, 65536, 0, 1048621, 65536, 0, 1114157, 65536, 0, 1179693, 65536, 0, 1245229, 65536, 0, 1310765, 65536, 0, 1376301, 65536, 0, 1441837, 65536, 0, 1507373, 262144, 9, 1572909, 262144, 9, 1638445, 262144, 9, 1703981, 262144, 9, 1703980, 262144, 9, 1703979, 262144, 9, 1703978, 262144, 9, 1703977, 262144, 9, 1703976, 262144, 9, 1703975, 262144, 9, 1703974, 262144, 9, 1703973, 262144, 9, 1703972, 262144, 9, 1703971, 262144, 9, 1703970, 262144, 9, 1703969, 262144, 9, 1703968, 262144, 9, 1703967, 262144, 9, 1703966, 262144, 9, 1703965, 262144, 9, 1703964, 262144, 9, 1703963, 262144, 9, 1703962, 262144, 9, 1703961, 262144, 9, 1703960, 262144, 9, 1703959, 262144, 9, 1703958, 262144, 9, 1703957, 262144, 9, 1703956, 262144, 9, 1703955, 262144, 9, 1703954, 262144, 9, 1703953, 262144, 9, 1703952, 262144, 9, 1703951, 262144, 9, 1703950, 262144, 9, 1703949, 262144, 9, 1703948, 262144, 9, 1703947, 262144, 9, 1703946, 262144, 9, 1703945, 262144, 9, 1703944, 262144, 9, 1703943, 262144, 9, 1703942, 262144, 9, 1703941, 262144, 9, 1769477, 262144, 9, 1835013, 262144, 9, 1835014, 262144, 9, 1769478, 262144, 9, 1769479, 262144, 9, 1835015, 262144, 9, 1835016, 262144, 9, 1769480, 262144, 9, 1769481, 262144, 9, 1835017, 262144, 9, 1835018, 262144, 9, 1769482, 262144, 9, 1769483, 262144, 9, 1835019, 262144, 9, 1835020, 262144, 9, 1769484, 262144, 9, 1769485, 262144, 9, 1835021, 262144, 9, 1835022, 262144, 9, 1769486, 262144, 9, 1769487, 262144, 9, 1835023, 262144, 9, 1835024, 262144, 9, 1769488, 262144, 9, 1769489, 262144, 9, 1835025, 262144, 9, 1835026, 262144, 9, 1769490, 262144, 9, 1769491, 262144, 9, 1835027, 262144, 9, 1835028, 262144, 9, 1769492, 262144, 9, 1769493, 262144, 9, 1835029, 262144, 9, 1835030, 262144, 9, 1769494, 262144, 9, 1769495, 262144, 9, 1835031, 262144, 9, 1835032, 262144, 9, 1769496, 262144, 9, 1769497, 262144, 9, 1835033, 262144, 9, 1835034, 262144, 9, 1769498, 262144, 9, 1769499, 262144, 9, 1835035, 262144, 9, 1835036, 262144, 9, 1769500, 262144, 9, 1769501, 262144, 9, 1835037, 262144, 9, 1835038, 262144, 9, 1769502, 262144, 9, 1769503, 262144, 9, 1835039, 262144, 9, 1835040, 262144, 9, 1769504, 262144, 9, 1769505, 262144, 9, 1835041, 262144, 9, 1835042, 262144, 9, 1769506, 262144, 9, 1769507, 262144, 9, 1835043, 262144, 9, 1835044, 262144, 9, 1769508, 262144, 9, 1769509, 262144, 9, 1835045, 262144, 9, 1835046, 262144, 9, 1769510, 262144, 9, 1769511, 262144, 9, 1835047, 262144, 9, 1835048, 262144, 9, 1769512, 262144, 9, 1769513, 262144, 9, 1835049, 262144, 9, 1835050, 262144, 9, 1769514, 262144, 9, 1769515, 262144, 9, 1835051, 262144, 9, 1835052, 262144, 9, 1769516, 262144, 9, 1769517, 262144, 9, 1835053, 262144, 9, 1835054, 262144, 9, 1769518, 262144, 9, 1703982, 262144, 9, 1638446, 262144, 9, 1572910, 262144, 9, 1507374, 262144, 9, 1441838, 262144, 9, 1376302, 262144, 9, 1310766, 262144, 9, 1245230, 65536, 0, 1179694, 65536, 0, 1114158, 65536, 0, 1048622, 65536, 0, 983086, 65536, 0, 917550, 65536, 0, 852014, 65536, 0, 786478, 65536, 0, 720942, 262144, 9, 655406, 262144, 9, 589870, 262144, 9, 524334, 262144, 9, 458798, 262144, 9, 393262, 262144, 9, 327726, 262144, 9, 262190, 262144, 9, 196654, 262144, 9, 131118, 262144, 9, 65582, 262144, 9, 65583, 262144, 9, 131119, 262144, 9, 196655, 262144, 9, 262191, 262144, 9, 327727, 262144, 9, 393263, 262144, 9, 458799, 262144, 9, 524335, 262144, 9, 589871, 262144, 9, 655407, 262144, 9, 720943, 262144, 9, 786479, 262144, 9, 852015, 262144, 9, 917551, 262144, 9, 983087, 262144, 9, 1048623, 262144, 9, 1114159, 262144, 9, 1179695, 262144, 9, 1245231, 262144, 9, 1310767, 262144, 9, 1376303, 262144, 9, 1441839, 262144, 9, 1507375, 262144, 9, 1572911, 262144, 9, 1638447, 262144, 9, 1703983, 262144, 9, 1769519, 262144, 9, 1835055, 262144, 9) script = ExtResource("2_yhw3p") +defaultPlayerStartPosition = Vector2i(11, 7) diff --git a/scenes/game.tscn b/scenes/game_screen.tscn similarity index 65% rename from scenes/game.tscn rename to scenes/game_screen.tscn index 0f753e0..cb976f2 100644 --- a/scenes/game.tscn +++ b/scenes/game_screen.tscn @@ -1,26 +1,21 @@ -[gd_scene load_steps=7 format=3 uid="uid://c0b5w48jk67qd"] +[gd_scene load_steps=8 format=3 uid="uid://c0b5w48jk67qd"] -[ext_resource type="Script" uid="uid://c0uvlwmkm3r8o" path="res://scripts/game/game_screen.gd" id="1_uwrxv"] -[ext_resource type="Script" uid="uid://dcqqr8b42tn0x" path="res://scripts/game/CommandProcessor.gd" id="2_lbhrr"] -[ext_resource type="Texture2D" uid="uid://ccxs3ctob15es" path="res://gfx/ui/main_frame.png" id="2_lnu2h"] -[ext_resource type="FontFile" uid="uid://1u28cjgctsn7" path="res://fonts/alagard_by_pix3m-d6awiwp.ttf" id="3_lbhrr"] -[ext_resource type="Script" uid="uid://b63jt1uexm120" path="res://scripts/game/maps/MapContainer.gd" id="3_p57ef"] -[ext_resource type="Script" uid="uid://dv3fd112uj8o1" path="res://scripts/ui/Message Console.gd" id="5_iywne"] +[ext_resource type="Script" uid="uid://c0uvlwmkm3r8o" path="res://scripts/game/game_screen.gd" id="1_dthvl"] +[ext_resource type="Script" uid="uid://dcqqr8b42tn0x" path="res://scripts/game/CommandProcessor.gd" id="2_r01d7"] +[ext_resource type="Script" uid="uid://b63jt1uexm120" path="res://scripts/game/maps/MapContainer.gd" id="3_vnpv3"] +[ext_resource type="Script" uid="uid://bjic7g285omo8" path="res://scripts/ui/UI.gd" id="4_4m8lb"] +[ext_resource type="Texture2D" uid="uid://ccxs3ctob15es" path="res://gfx/ui/main_frame.png" id="5_mjl5p"] +[ext_resource type="FontFile" uid="uid://1u28cjgctsn7" path="res://fonts/alagard_by_pix3m-d6awiwp.ttf" id="6_2yu03"] +[ext_resource type="Script" uid="uid://dv3fd112uj8o1" path="res://scripts/ui/Message Console.gd" id="7_5vo8s"] [node name="Game" type="Node" node_paths=PackedStringArray("map")] -script = ExtResource("1_uwrxv") -map = NodePath("MapContainer") +script = ExtResource("1_dthvl") +map = NodePath("UI/Map View/SubViewport/MapContainer") [node name="Command Processor" type="Timer" parent="."] wait_time = 3.0 autostart = true -script = ExtResource("2_lbhrr") - -[node name="MapContainer" type="Node" parent="." node_paths=PackedStringArray("entities")] -script = ExtResource("3_p57ef") -entities = NodePath("Entities") - -[node name="Entities" type="Node" parent="MapContainer"] +script = ExtResource("2_r01d7") [node name="UI" type="Control" parent="."] layout_mode = 3 @@ -29,6 +24,7 @@ anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 +script = ExtResource("4_4m8lb") [node name="Background Frame" type="TextureRect" parent="UI"] layout_mode = 1 @@ -37,7 +33,7 @@ anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 -texture = ExtResource("2_lnu2h") +texture = ExtResource("5_mjl5p") [node name="Left Display" type="MarginContainer" parent="UI"] layout_mode = 0 @@ -58,7 +54,7 @@ layout_mode = 2 [node name="Pass Button" type="Button" parent="UI/Left Display/Contents/Command Menu"] layout_mode = 2 -theme_override_fonts/font = ExtResource("3_lbhrr") +theme_override_fonts/font = ExtResource("6_2yu03") text = "Pass" [node name="Message Console" type="MarginContainer" parent="UI" node_paths=PackedStringArray("scrollContainer", "messages")] @@ -67,7 +63,7 @@ offset_left = 13.0 offset_top = 231.0 offset_right = 627.0 offset_bottom = 345.0 -script = ExtResource("5_iywne") +script = ExtResource("7_5vo8s") scrollContainer = NodePath("ScrollContainer") messages = NodePath("ScrollContainer/Messages") @@ -83,6 +79,24 @@ horizontal_scroll_mode = 0 layout_mode = 2 size_flags_horizontal = 3 +[node name="Map View" type="SubViewportContainer" parent="UI"] +layout_mode = 0 +offset_left = 181.0 +offset_top = 15.0 +offset_right = 627.0 +offset_bottom = 216.0 +stretch = true + +[node name="SubViewport" type="SubViewport" parent="UI/Map View"] +size = Vector2i(446, 201) + +[node name="MapContainer" type="Node" parent="UI/Map View/SubViewport" node_paths=PackedStringArray("entities")] +script = ExtResource("3_vnpv3") +entities = NodePath("Entities") + +[node name="Entities" type="Node2D" parent="UI/Map View/SubViewport/MapContainer"] +z_index = 1 + [connection signal="BROADCAST_COMMAND" from="Command Processor" to="UI/Message Console" method="_on_command"] [connection signal="timeout" from="Command Processor" to="Command Processor" method="_on_timeout"] -[connection signal="pressed" from="UI/Left Display/Contents/Command Menu/Pass Button" to="." method="_on_pass_button_pressed"] +[connection signal="pressed" from="UI/Left Display/Contents/Command Menu/Pass Button" to="UI" method="_on_pass_button_pressed"] diff --git a/scenes/ui/title_screen.tscn b/scenes/ui/title_screen.tscn index f749074..e6eb2d3 100644 --- a/scenes/ui/title_screen.tscn +++ b/scenes/ui/title_screen.tscn @@ -4,7 +4,7 @@ [ext_resource type="Script" uid="uid://bklj1ua1qok02" path="res://scripts/title/title_screen.gd" id="1_r23qo"] [ext_resource type="FontFile" uid="uid://1u28cjgctsn7" path="res://fonts/alagard_by_pix3m-d6awiwp.ttf" id="2_aqpy5"] [ext_resource type="Theme" uid="uid://dnxny0n7ti7eq" path="res://themes/default_theme.tres" id="3_w8uqo"] -[ext_resource type="Script" uid="uid://bfc7ybsw6riri" path="res://scripts/title/version_number.gd" id="4_a4ium"] +[ext_resource type="Script" uid="uid://bfc7ybsw6riri" path="res://scripts/title/Version Number.gd" id="4_a4ium"] [sub_resource type="LabelSettings" id="LabelSettings_w8uqo"] font = ExtResource("2_aqpy5") diff --git a/scripts/game/GameManager.gd b/scripts/game/GameManager.gd index c817f28..7551246 100644 --- a/scripts/game/GameManager.gd +++ b/scripts/game/GameManager.gd @@ -1,8 +1,8 @@ extends Node -var defaultMapPath:String = "res://scenes/game/maps/world_map.tscn" +var startMap:String = "res://scenes/game/maps/world_map.tscn" -var currentMapPath +var currentMap:String func startNewGame(): - currentMapPath = defaultMapPath + currentMap = startMap diff --git a/scripts/game/commands/CommandDispatcher.gd b/scripts/game/commands/CommandDispatcher.gd index 41b1c34..af2eecc 100644 --- a/scripts/game/commands/CommandDispatcher.gd +++ b/scripts/game/commands/CommandDispatcher.gd @@ -13,4 +13,4 @@ signal DISPLAY_MESSAGE(message) signal DISPLAY_COMMAND_PROMPT signal DISPLAY_CLEAR -signal LOAD_MAP(currentMap, newMap, spawnpoint, facing) +signal LOAD_MAP(currentMap, newMapPath, spawnpoint, facing) diff --git a/scripts/game/commands/MoveCommand.gd b/scripts/game/commands/MoveCommand.gd index c51c2fb..a0172e0 100644 --- a/scripts/game/commands/MoveCommand.gd +++ b/scripts/game/commands/MoveCommand.gd @@ -11,7 +11,7 @@ func _init(dir): func execute(): CommandDispatcher.PLAYER_MOVE.emit(direction) - emit_signal("COMMAND_PROCESSED", getCommandText()) + COMMAND_PROCESSED.emit(getCommandText()) func getDirectionString() -> String: diff --git a/scripts/game/game_screen.gd b/scripts/game/game_screen.gd index cf4ebb1..12081b8 100644 --- a/scripts/game/game_screen.gd +++ b/scripts/game/game_screen.gd @@ -5,8 +5,4 @@ class_name GameScreen @export var map:Node func _ready(): - CommandDispatcher.LOAD_MAP.emit(null, GameManager.defaultMapPath, null, Map.Direction.North) - - -func _on_pass_button_pressed(): - CommandDispatcher.PROCESS_COMMAND.emit(PassCommand.new()) + CommandDispatcher.LOAD_MAP.emit(GameManager.startMap, null, Map.Direction.North) diff --git a/scripts/game/maps/Map.gd b/scripts/game/maps/Map.gd new file mode 100644 index 0000000..91d9374 --- /dev/null +++ b/scripts/game/maps/Map.gd @@ -0,0 +1,47 @@ +extends TileMap + +class_name Map + +enum Direction { North, East, South, West } + +@export var defaultPlayerStartPosition:Vector2i +@export var stepIncrement:float = 1.0 + +var player + +func _ready(): + CommandDispatcher.PLAYER_MOVE.connect(onPlayerMove) + + +func spawnPlayerAtPosition(position, facing): + var spawnposition:Vector2i + + if (position == null): + spawnposition = defaultPlayerStartPosition + else: + spawnposition = position + + player.position = Vector2(spawnposition.x * 16, spawnposition.y * 16) + + +func onPlayerMove(direction): + var newPos = Vector2(player.position) + var moveIncrement = tile_set.tile_size.x * stepIncrement + + match(direction): + Direction.North: + newPos.y -= moveIncrement + Direction.South: + newPos.y += moveIncrement + Direction.West: + newPos.x -= moveIncrement + Direction.East: + newPos.x += moveIncrement + + if (playerCanMoveTo(newPos)): + player.position = newPos + player.updateAnimation(direction) + + +func playerCanMoveTo(position) -> bool: + return false diff --git a/scripts/game/maps/map.gd.uid b/scripts/game/maps/Map.gd.uid similarity index 100% rename from scripts/game/maps/map.gd.uid rename to scripts/game/maps/Map.gd.uid diff --git a/scripts/game/maps/map2d.gd b/scripts/game/maps/Map2d.gd similarity index 99% rename from scripts/game/maps/map2d.gd rename to scripts/game/maps/Map2d.gd index d68cad9..ac1aa6e 100644 --- a/scripts/game/maps/map2d.gd +++ b/scripts/game/maps/Map2d.gd @@ -12,9 +12,10 @@ func getTerrainDataForTile(layer, data, x, y): else: return null + func spawnPlayerAtPosition(position, facing): player = load("res://scenes/game/maps/entities/player.tscn").instantiate() - + super.spawnPlayerAtPosition(position, facing) return player diff --git a/scripts/game/maps/map2d.gd.uid b/scripts/game/maps/Map2d.gd.uid similarity index 100% rename from scripts/game/maps/map2d.gd.uid rename to scripts/game/maps/Map2d.gd.uid diff --git a/scripts/game/maps/MapContainer.gd b/scripts/game/maps/MapContainer.gd index 95874ca..2a5dba8 100644 --- a/scripts/game/maps/MapContainer.gd +++ b/scripts/game/maps/MapContainer.gd @@ -8,16 +8,39 @@ func _ready(): CommandDispatcher.LOAD_MAP.connect(loadMap) -func loadMap(currentMapPath, newMapPath, spawnpoint, facing): - var newMap:Map = load(newMapPath).instantiate() +func loadMap(newMapPath, spawnpoint, facing): + var newMap:Map CommandDispatcher.PAUSE_PROCESSOR.emit() - if (currentMapPath != null): - currentMapPath.queue_free() + if (map != null): + map.queue_free() + + map = load(newMapPath).instantiate() + + add_child(map) + + entities.add_child(map.spawnPlayerAtPosition(spawnpoint, facing)) + + GameManager.currentMap = newMapPath - add_child(newMap) - - entities.add_child(newMap.spawnPlayerAtPosition(spawnpoint, facing)) - CommandDispatcher.WAIT_FOR_COMMAND.emit() + + +func _unhandled_key_input(event): + var direction + + if (Input.is_action_pressed("ui_right")): + direction = Map.Direction.East + + if (Input.is_action_pressed("ui_left")): + direction = Map.Direction.West + + if (Input.is_action_pressed("ui_up")): + direction = Map.Direction.North + + if (Input.is_action_pressed("ui_down")): + direction = Map.Direction.South + + if (direction != null): + CommandDispatcher.PROCESS_COMMAND.emit(MoveCommand.new(direction)) diff --git a/scripts/game/maps/WorldMap.gd b/scripts/game/maps/WorldMap.gd new file mode 100644 index 0000000..d1a78e5 --- /dev/null +++ b/scripts/game/maps/WorldMap.gd @@ -0,0 +1,20 @@ +extends Map2d + +class_name WorldMap + +func playerCanMoveTo(position:Vector2) -> bool: + var tilesize = tile_set.tile_size.x + var cast_cell_1 + var cast_cell_2 + + player.updateRaycasts(position) + + cast_cell_1 = local_to_map(position + player.collisionRay_1.position) + cast_cell_2 = local_to_map(position + player.collisionRay_2.position) + + if (getTerrainDataForTile(0, TerrainDataTypes.TerrainType, cast_cell_1.x, cast_cell_1.y) != "Water" and + getTerrainDataForTile(0, TerrainDataTypes.TerrainType, cast_cell_2.x, cast_cell_2.y) != "Water"): + return true + else: + CommandDispatcher.DISPLAY_MESSAGE.emit("Your path is blocked.") + return false diff --git a/scripts/game/maps/world_map.gd.uid b/scripts/game/maps/WorldMap.gd.uid similarity index 100% rename from scripts/game/maps/world_map.gd.uid rename to scripts/game/maps/WorldMap.gd.uid diff --git a/scripts/game/maps/map.gd b/scripts/game/maps/map.gd deleted file mode 100644 index fd740f3..0000000 --- a/scripts/game/maps/map.gd +++ /dev/null @@ -1,19 +0,0 @@ -extends TileMap - -class_name Map - -enum Direction { North, East, South, West } - -@export var defaultPlayerStartPosition:Vector2i - -var player - -func spawnPlayerAtPosition(position, facing): - var spawnposition - - if (position == null): - spawnposition = defaultPlayerStartPosition - else: - spawnposition = position - - player.position = Vector2(spawnposition.x * 16, spawnposition.y * 16) diff --git a/scripts/game/maps/world_map.gd b/scripts/game/maps/world_map.gd deleted file mode 100644 index cc6ab35..0000000 --- a/scripts/game/maps/world_map.gd +++ /dev/null @@ -1,4 +0,0 @@ -extends Map2d - -#func _ready() -> void: -# super._ready() diff --git a/scripts/title/Version Number.gd b/scripts/title/Version Number.gd new file mode 100644 index 0000000..e265413 --- /dev/null +++ b/scripts/title/Version Number.gd @@ -0,0 +1,4 @@ +extends Label + +func _ready(): + text = text + ProjectSettings.get_setting("application/config/version") diff --git a/scripts/title/version_number.gd.uid b/scripts/title/Version Number.gd.uid similarity index 100% rename from scripts/title/version_number.gd.uid rename to scripts/title/Version Number.gd.uid diff --git a/scripts/title/title_screen.gd b/scripts/title/title_screen.gd index 60c6069..d05f296 100644 --- a/scripts/title/title_screen.gd +++ b/scripts/title/title_screen.gd @@ -4,4 +4,4 @@ extends Control func _on_new_game_button_pressed(): GameManager.startNewGame() - Loader.loadScene(self, "res://scenes/game.tscn") + Loader.loadScene(self, "res://scenes/game_screen.tscn") diff --git a/scripts/title/version_number.gd b/scripts/title/version_number.gd deleted file mode 100644 index abe0f78..0000000 --- a/scripts/title/version_number.gd +++ /dev/null @@ -1,4 +0,0 @@ -extends Label - -func _ready(): - text += ProjectSettings.get_setting("application/config/version") diff --git a/scripts/ui/UI.gd b/scripts/ui/UI.gd new file mode 100644 index 0000000..ab74004 --- /dev/null +++ b/scripts/ui/UI.gd @@ -0,0 +1,6 @@ +extends Control + +class_name UI + +func _on_pass_button_pressed(): + CommandDispatcher.PROCESS_COMMAND.emit(PassCommand.new()) diff --git a/scripts/ui/UI.gd.uid b/scripts/ui/UI.gd.uid new file mode 100644 index 0000000..d8d290c --- /dev/null +++ b/scripts/ui/UI.gd.uid @@ -0,0 +1 @@ +uid://bjic7g285omo8