diff --git a/assets/Tiles/Assets/Assets.png b/assets/Tiles/Assets/Assets.png index a5eab06..40a418b 100644 Binary files a/assets/Tiles/Assets/Assets.png and b/assets/Tiles/Assets/Assets.png differ diff --git a/assets/Tiles/Assets/Demo TileSet.tres b/assets/Tiles/Assets/Demo TileSet.tres index 24cdc31..b6d49ac 100644 --- a/assets/Tiles/Assets/Demo TileSet.tres +++ b/assets/Tiles/Assets/Demo TileSet.tres @@ -1,4 +1,4 @@ -[gd_resource type="TileSet" load_steps=13 format=2] +[gd_resource type="TileSet" load_steps=15 format=2] [ext_resource path="res://assets/Tiles/Assets/Assets.png" type="Texture" id=1] @@ -35,6 +35,12 @@ points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) [sub_resource type="ConvexPolygonShape2D" id=12] points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) +[sub_resource type="ConvexPolygonShape2D" id=13] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=14] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + [resource] 0/name = "Assets.png 0" 0/texture = ExtResource( 1 ) @@ -122,5 +128,17 @@ points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) "one_way_margin": 1.0, "shape": SubResource( 12 ), "shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 8, 2 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 13 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 9, 2 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 14 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) } ] 0/z_index = 0 diff --git a/project.godot b/project.godot index 5c62422..591cbce 100644 --- a/project.godot +++ b/project.godot @@ -49,6 +49,11 @@ _global_script_classes=[ { "language": "GDScript", "path": "res://src/state_modifier_properties.gd" }, { +"base": "Node2D", +"class": "Modifier_Receiver", +"language": "GDScript", +"path": "res://src/components/Modifier_Receiver.gd" +}, { "base": "Node", "class": "MovementComponent", "language": "GDScript", @@ -93,6 +98,7 @@ _global_script_class_icons={ "Interactable_Receiver": "", "Level": "", "ModifierProperties": "", +"Modifier_Receiver": "", "MovementComponent": "", "State": "", "StateAnimatedActor": "", diff --git a/src/Levels/Level.tscn b/src/Levels/Level.tscn index 6723520..c1430f3 100644 --- a/src/Levels/Level.tscn +++ b/src/Levels/Level.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=14 format=2] +[gd_scene load_steps=16 format=2] [ext_resource path="res://src/templates/Actor/ActorTemplate.tscn" type="PackedScene" id=1] [ext_resource path="res://assets/Tiles/Assets/Demo TileSet.tres" type="TileSet" id=2] @@ -10,6 +10,7 @@ [ext_resource path="res://src/Interactables/Door.tscn" type="PackedScene" id=8] [ext_resource path="res://src/components/Hitbox_Component.tscn" type="PackedScene" id=9] [ext_resource path="res://src/Level.gd" type="Script" id=10] +[ext_resource path="res://src/components/Modifier_Component.tscn" type="PackedScene" id=11] [sub_resource type="SegmentShape2D" id=1] b = Vector2( 1500, 0 ) @@ -21,11 +22,14 @@ b = Vector2( -1, 349 ) [sub_resource type="RectangleShape2D" id=3] extents = Vector2( 50, 2 ) +[sub_resource type="RectangleShape2D" id=4] +extents = Vector2( 80, 2.5 ) + [node name="Level" type="Node2D"] script = ExtResource( 10 ) [node name="PlayerStart" type="Position2D" parent="."] -position = Vector2( 86, 97 ) +position = Vector2( 1094, 128 ) [node name="CameraBoundaries" type="Area2D" parent="."] collision_layer = 256 @@ -84,7 +88,7 @@ tile_set = ExtResource( 2 ) cell_size = Vector2( 16, 16 ) show_collision = true format = 1 -tile_data = PoolIntArray( -65536, 0, 196613, 65528, 0, 0, 0, 0, 196613, 79, 0, 196613, 65536, 0, 196613, 65615, 0, 196613, 196603, 0, 0, 131072, 0, 196613, 131151, 0, 196613, 196608, 0, 196613, 196687, 0, 196613, 262144, 0, 196613, 262172, 0, 196613, 262173, 0, 196613, 262174, 0, 196613, 262175, 0, 196613, 262176, 0, 196613, 262177, 0, 196613, 262223, 0, 196613, 327680, 0, 196613, 327759, 0, 196613, 393216, 0, 196613, 393260, 0, 196613, 393261, 0, 196613, 393295, 0, 196613, 458752, 0, 196613, 458792, 0, 196613, 458793, 0, 196613, 458794, 0, 196613, 458795, 0, 196613, 458796, 0, 196613, 458797, 0, 196613, 458831, 0, 196613, 524288, 0, 196613, 524307, 0, 196613, 524308, 0, 196613, 524327, 0, 196613, 524328, 0, 196613, 524329, 0, 196613, 524330, 0, 196613, 524334, 0, 196613, 524367, 0, 196613, 589824, 0, 196613, 589843, 0, 196613, 589844, 0, 196613, 589863, 0, 196613, 589864, 0, 196613, 589870, 0, 196613, 589903, 0, 196613, 655360, 0, 196613, 655361, 0, 2, 655362, 0, 2, 655363, 0, 2, 655364, 0, 2, 655365, 0, 2, 655366, 0, 2, 655367, 0, 2, 655368, 0, 2, 655369, 0, 2, 655370, 0, 2, 655371, 0, 2, 655372, 0, 2, 655373, 0, 2, 655374, 0, 2, 655375, 0, 2, 655376, 0, 2, 655377, 0, 2, 655378, 0, 2, 655379, 0, 196613, 655380, 0, 196613, 655381, 0, 196613, 655382, 0, 196613, 655383, 0, 196613, 655384, 0, 196613, 655385, 0, 196613, 655386, 0, 196613, 655387, 0, 196613, 655388, 0, 196613, 655389, 0, 196613, 655390, 0, 196613, 655391, 0, 196613, 655392, 0, 196613, 655393, 0, 196613, 655394, 0, 196613, 655395, 0, 196613, 655396, 0, 196613, 655397, 0, 196613, 655398, 0, 196613, 655399, 0, 196613, 655400, 0, 196613, 655406, 0, 196613, 655407, 0, 196613, 655408, 0, 196613, 655409, 0, 196613, 655410, 0, 196613, 655411, 0, 196613, 655412, 0, 196613, 655413, 0, 196613, 655414, 0, 196613, 655415, 0, 196613, 655416, 0, 196613, 655417, 0, 196613, 655418, 0, 196613, 655419, 0, 196613, 655420, 0, 196613, 655421, 0, 196613, 655422, 0, 196613, 655423, 0, 196613, 655424, 0, 196613, 655425, 0, 196613, 655426, 0, 196613, 655427, 0, 196613, 655428, 0, 196613, 655439, 0, 196613, 720896, 0, 196613, 720897, 0, 65538, 720898, 0, 65538, 720899, 0, 65538, 720900, 0, 65538, 720901, 0, 65538, 720902, 0, 65538, 720903, 0, 65538, 720904, 0, 65538, 720905, 0, 65538, 720906, 0, 65538, 720907, 0, 65538, 720908, 0, 65538, 720909, 0, 65538, 720910, 0, 65538, 720911, 0, 65538, 720912, 0, 65538, 720913, 0, 65538, 720914, 0, 65538, 720915, 0, 196613, 720916, 0, 196613, 720917, 0, 196613, 720918, 0, 196613, 720919, 0, 196613, 720920, 0, 196613, 720921, 0, 196613, 720959, 0, 0, 720961, 0, 196613, 720962, 0, 196613, 720963, 0, 196613, 720964, 0, 196613, 720965, 0, 196613, 720975, 0, 196613, 786432, 0, 196613, 786495, 0, 0, 786511, 0, 196613, 851968, 0, 196613, 852002, 0, 196613, 852031, 0, 0, 852047, 0, 196613, 917504, 0, 196613, 917583, 0, 196613, 983040, 0, 196613, 983119, 0, 196613, 1048576, 0, 196613, 1048655, 0, 196613, 1114112, 0, 196613, 1114167, 0, 196613, 1114168, 0, 196613, 1114169, 0, 196613, 1114170, 0, 196613, 1114171, 0, 196613, 1114191, 0, 196613, 1179648, 0, 196613, 1179701, 0, 196613, 1179702, 0, 196613, 1179703, 0, 196613, 1179707, 0, 196613, 1179708, 0, 196613, 1179709, 0, 196613, 1179727, 0, 196613, 1245184, 0, 196613, 1245236, 0, 196613, 1245237, 0, 196613, 1245245, 0, 196613, 1245246, 0, 196613, 1245247, 0, 196613, 1245263, 0, 196613, 1310720, 0, 196613, 1310771, 0, 196613, 1310772, 0, 196613, 1310783, 0, 196613, 1310784, 0, 196613, 1310799, 0, 196613, 1376256, 0, 196613, 1376257, 0, 196613, 1376258, 0, 196613, 1376259, 0, 196613, 1376260, 0, 196613, 1376261, 0, 196613, 1376262, 0, 196613, 1376263, 0, 196613, 1376264, 0, 196613, 1376265, 0, 196613, 1376266, 0, 196613, 1376267, 0, 196613, 1376268, 0, 196613, 1376269, 0, 196613, 1376270, 0, 196613, 1376271, 0, 196613, 1376272, 0, 196613, 1376273, 0, 196613, 1376274, 0, 196613, 1376275, 0, 196613, 1376276, 0, 196613, 1376277, 0, 196613, 1376278, 0, 196613, 1376279, 0, 196613, 1376280, 0, 196613, 1376281, 0, 196613, 1376282, 0, 196613, 1376283, 0, 196613, 1376284, 0, 196613, 1376285, 0, 196613, 1376286, 0, 196613, 1376287, 0, 196613, 1376288, 0, 196613, 1376289, 0, 196613, 1376290, 0, 196613, 1376291, 0, 196613, 1376292, 0, 196613, 1376293, 0, 196613, 1376294, 0, 196613, 1376295, 0, 196613, 1376296, 0, 196613, 1376297, 0, 196613, 1376298, 0, 196613, 1376299, 0, 196613, 1376300, 0, 196613, 1376301, 0, 196613, 1376302, 0, 196613, 1376303, 0, 196613, 1376304, 0, 196613, 1376305, 0, 196613, 1376306, 0, 196613, 1376307, 0, 196613, 1376308, 0, 196613, 1376309, 0, 196613, 1376310, 0, 196613, 1376311, 0, 196613, 1376312, 0, 196613, 1376313, 0, 196613, 1376314, 0, 196613, 1376315, 0, 196613, 1376316, 0, 196613, 1376317, 0, 196613, 1376318, 0, 196613, 1376319, 0, 196613, 1376320, 0, 196613, 1376321, 0, 196613, 1376322, 0, 196613, 1376323, 0, 196613, 1376324, 0, 196613, 1376325, 0, 196613, 1376326, 0, 196613, 1376327, 0, 196613, 1376328, 0, 196613, 1376329, 0, 196613, 1376330, 0, 196613, 1376331, 0, 196613, 1376332, 0, 196613, 1376333, 0, 196613, 1376334, 0, 196613, 1376335, 0, 196613, 1441792, 0, 196613, 1441793, 0, 196613, 1441794, 0, 196613, 1441795, 0, 196613, 1441796, 0, 196613, 1441797, 0, 196613, 1441798, 0, 196613, 1441799, 0, 196613, 1441800, 0, 196613, 1441801, 0, 196613, 1441802, 0, 196613, 1441803, 0, 196613, 1441804, 0, 196613, 1441805, 0, 196613, 1441806, 0, 196613, 1441807, 0, 196613, 1441808, 0, 196613, 1441809, 0, 196613, 1441810, 0, 196613, 1441811, 0, 196613, 1441812, 0, 196613, 1441813, 0, 196613, 1441814, 0, 196613, 1441815, 0, 196613, 1441816, 0, 196613, 1441817, 0, 196613, 1441818, 0, 196613, 1441819, 0, 196613, 1441820, 0, 196613, 1441821, 0, 196613, 1441822, 0, 196613, 1441823, 0, 196613, 1441824, 0, 196613, 1441825, 0, 196613, 1441826, 0, 196613, 1441827, 0, 196613, 1441828, 0, 196613, 1441829, 0, 196613, 1441830, 0, 196613, 1441831, 0, 196613, 1441832, 0, 196613, 1441833, 0, 196613, 1441834, 0, 196613, 1441835, 0, 196613, 1441836, 0, 196613, 1441837, 0, 196613, 1441838, 0, 196613, 1441839, 0, 196613, 1441840, 0, 196613, 1441841, 0, 196613, 1441842, 0, 196613, 1441843, 0, 196613, 1441844, 0, 196613, 1441845, 0, 196613, 1441846, 0, 196613, 1441847, 0, 196613, 1441848, 0, 196613, 1441849, 0, 196613, 1441850, 0, 196613, 1441851, 0, 196613, 1441852, 0, 196613, 1441853, 0, 196613, 1441854, 0, 196613, 1441855, 0, 196613, 1441856, 0, 196613, 1441857, 0, 196613, 1441858, 0, 196613, 1441859, 0, 196613, 1441860, 0, 196613, 1441861, 0, 196613, 1441862, 0, 196613, 1441863, 0, 196613, 1441864, 0, 196613, 1441865, 0, 196613, 1441866, 0, 196613, 1441867, 0, 196613, 1441868, 0, 196613, 1441869, 0, 196613, 1441870, 0, 196613, 1441871, 0, 196613 ) +tile_data = PoolIntArray( -65536, 0, 196613, 65528, 0, 0, 0, 0, 196613, 79, 0, 196613, 65536, 0, 196613, 65615, 0, 196613, 196603, 0, 0, 131072, 0, 196613, 131151, 0, 196613, 196608, 0, 196613, 196687, 0, 196613, 262144, 0, 196613, 262172, 0, 196613, 262173, 0, 196613, 262174, 0, 196613, 262175, 0, 196613, 262176, 0, 196613, 262177, 0, 196613, 262223, 0, 196613, 327680, 0, 196613, 327759, 0, 196613, 393216, 0, 196613, 393260, 0, 196613, 393261, 0, 196613, 393295, 0, 196613, 458752, 0, 196613, 458792, 0, 196613, 458793, 0, 196613, 458794, 0, 196613, 458795, 0, 196613, 458796, 0, 196613, 458797, 0, 196613, 458831, 0, 196613, 524288, 0, 196613, 524307, 0, 196613, 524308, 0, 196613, 524327, 0, 196613, 524328, 0, 196613, 524329, 0, 196613, 524330, 0, 196613, 524334, 0, 196613, 524367, 0, 196613, 589824, 0, 196613, 589843, 0, 196613, 589844, 0, 196613, 589863, 0, 196613, 589864, 0, 196613, 589870, 0, 196613, 589903, 0, 196613, 655360, 0, 196613, 655361, 0, 2, 655362, 0, 2, 655363, 0, 2, 655364, 0, 2, 655365, 0, 2, 655366, 0, 2, 655367, 0, 2, 655368, 0, 2, 655369, 0, 2, 655370, 0, 2, 655371, 0, 2, 655372, 0, 2, 655373, 0, 2, 655374, 0, 2, 655375, 0, 2, 655376, 0, 2, 655377, 0, 2, 655378, 0, 2, 655379, 0, 196613, 655380, 0, 196613, 655381, 0, 196613, 655382, 0, 196613, 655383, 0, 196613, 655384, 0, 196613, 655385, 0, 196613, 655386, 0, 196613, 655387, 0, 196613, 655388, 0, 196613, 655389, 0, 196613, 655390, 0, 196613, 655391, 0, 196613, 655392, 0, 196613, 655393, 0, 196613, 655394, 0, 196613, 655395, 0, 196613, 655396, 0, 196613, 655397, 0, 196613, 655398, 0, 196613, 655399, 0, 196613, 655400, 0, 196613, 655406, 0, 196613, 655407, 0, 196613, 655408, 0, 196613, 655409, 0, 196613, 655410, 0, 196613, 655411, 0, 196613, 655412, 0, 196613, 655413, 0, 196613, 655414, 0, 196613, 655415, 0, 196613, 655416, 0, 196613, 655417, 0, 196613, 655418, 0, 196613, 655419, 0, 196613, 655420, 0, 196613, 655421, 0, 196613, 655422, 0, 196613, 655423, 0, 196613, 655424, 0, 196613, 655425, 0, 196613, 655426, 0, 196613, 655427, 0, 196613, 655428, 0, 196613, 655439, 0, 196613, 720896, 0, 196613, 720897, 0, 65538, 720898, 0, 65538, 720899, 0, 65538, 720900, 0, 65538, 720901, 0, 65538, 720902, 0, 65538, 720903, 0, 65538, 720904, 0, 65538, 720905, 0, 65538, 720906, 0, 65538, 720907, 0, 65538, 720908, 0, 65538, 720909, 0, 65538, 720910, 0, 65538, 720911, 0, 65538, 720912, 0, 65538, 720913, 0, 65538, 720914, 0, 65538, 720915, 0, 196613, 720916, 0, 196613, 720917, 0, 196613, 720918, 0, 196613, 720919, 0, 196613, 720920, 0, 196613, 720921, 0, 196613, 720959, 0, 0, 720961, 0, 196613, 720962, 0, 196613, 720963, 0, 196613, 720964, 0, 196613, 720965, 0, 196613, 720975, 0, 196613, 786432, 0, 196613, 786495, 0, 0, 786511, 0, 196613, 851968, 0, 196613, 852002, 0, 196613, 852031, 0, 0, 852047, 0, 196613, 917504, 0, 196613, 917583, 0, 196613, 983040, 0, 196613, 983119, 0, 196613, 1048576, 0, 196613, 1048655, 0, 196613, 1114112, 0, 196613, 1114167, 0, 196613, 1114168, 0, 196613, 1114169, 0, 196613, 1114170, 0, 196613, 1114171, 0, 196613, 1114191, 0, 196613, 1179648, 0, 196613, 1179701, 0, 196613, 1179702, 0, 196613, 1179703, 0, 196613, 1179707, 0, 196613, 1179708, 0, 196613, 1179709, 0, 196613, 1179727, 0, 196613, 1245184, 0, 196613, 1245236, 0, 196613, 1245237, 0, 196613, 1245245, 0, 196613, 1245246, 0, 196613, 1245247, 0, 196613, 1245263, 0, 196613, 1310720, 0, 196613, 1310771, 0, 196613, 1310772, 0, 196613, 1310783, 0, 196613, 1310784, 0, 196613, 1310799, 0, 196613, 1376256, 0, 196613, 1376257, 0, 196613, 1376258, 0, 196613, 1376259, 0, 196613, 1376260, 0, 196613, 1376261, 0, 196613, 1376262, 0, 196613, 1376263, 0, 196613, 1376264, 0, 196613, 1376265, 0, 196613, 1376266, 0, 196613, 1376267, 0, 196613, 1376268, 0, 196613, 1376269, 0, 196613, 1376270, 0, 196613, 1376271, 0, 196613, 1376272, 0, 196613, 1376273, 0, 196613, 1376274, 0, 196613, 1376275, 0, 196613, 1376276, 0, 196613, 1376277, 0, 196613, 1376278, 0, 196613, 1376279, 0, 196613, 1376280, 0, 196613, 1376281, 0, 196613, 1376282, 0, 196613, 1376283, 0, 196613, 1376284, 0, 196613, 1376285, 0, 196613, 1376286, 0, 196613, 1376287, 0, 196613, 1376288, 0, 196613, 1376289, 0, 196613, 1376290, 0, 196613, 1376291, 0, 196613, 1376292, 0, 196613, 1376293, 0, 196613, 1376294, 0, 196613, 1376295, 0, 196613, 1376296, 0, 196613, 1376297, 0, 196613, 1376298, 0, 196613, 1376299, 0, 196613, 1376300, 0, 196613, 1376301, 0, 196613, 1376302, 0, 196613, 1376303, 0, 196613, 1376304, 0, 196613, 1376305, 0, 196613, 1376306, 0, 196613, 1376307, 0, 196613, 1376308, 0, 196613, 1376309, 0, 196613, 1376310, 0, 196613, 1376311, 0, 196613, 1376312, 0, 196613, 1376313, 0, 196613, 1376314, 0, 196613, 1376315, 0, 196613, 1376316, 0, 196613, 1376317, 0, 196613, 1376318, 0, 196613, 1376319, 0, 196613, 1376320, 0, 196613, 1376321, 0, 196613, 1376322, 0, 196613, 1376323, 0, 196613, 1376324, 0, 196613, 1376325, 0, 131080, 1376326, 0, 131081, 1376327, 0, 131080, 1376328, 0, 131081, 1376329, 0, 131080, 1376330, 0, 131081, 1376331, 0, 131080, 1376332, 0, 131081, 1376333, 0, 131081, 1376334, 0, 131080, 1376335, 0, 196613, 1441792, 0, 196613, 1441793, 0, 196613, 1441794, 0, 196613, 1441795, 0, 196613, 1441796, 0, 196613, 1441797, 0, 196613, 1441798, 0, 196613, 1441799, 0, 196613, 1441800, 0, 196613, 1441801, 0, 196613, 1441802, 0, 196613, 1441803, 0, 196613, 1441804, 0, 196613, 1441805, 0, 196613, 1441806, 0, 196613, 1441807, 0, 196613, 1441808, 0, 196613, 1441809, 0, 196613, 1441810, 0, 196613, 1441811, 0, 196613, 1441812, 0, 196613, 1441813, 0, 196613, 1441814, 0, 196613, 1441815, 0, 196613, 1441816, 0, 196613, 1441817, 0, 196613, 1441818, 0, 196613, 1441819, 0, 196613, 1441820, 0, 196613, 1441821, 0, 196613, 1441822, 0, 196613, 1441823, 0, 196613, 1441824, 0, 196613, 1441825, 0, 196613, 1441826, 0, 196613, 1441827, 0, 196613, 1441828, 0, 196613, 1441829, 0, 196613, 1441830, 0, 196613, 1441831, 0, 196613, 1441832, 0, 196613, 1441833, 0, 196613, 1441834, 0, 196613, 1441835, 0, 196613, 1441836, 0, 196613, 1441837, 0, 196613, 1441838, 0, 196613, 1441839, 0, 196613, 1441840, 0, 196613, 1441841, 0, 196613, 1441842, 0, 196613, 1441843, 0, 196613, 1441844, 0, 196613, 1441845, 0, 196613, 1441846, 0, 196613, 1441847, 0, 196613, 1441848, 0, 196613, 1441849, 0, 196613, 1441850, 0, 196613, 1441851, 0, 196613, 1441852, 0, 196613, 1441853, 0, 196613, 1441854, 0, 196613, 1441855, 0, 196613, 1441856, 0, 196613, 1441857, 0, 196613, 1441858, 0, 196613, 1441859, 0, 196613, 1441860, 0, 196613, 1441861, 0, 196613, 1441862, 0, 196613, 1441863, 0, 196613, 1441864, 0, 196613, 1441865, 0, 196613, 1441866, 0, 196613, 1441867, 0, 196613, 1441868, 0, 196613, 1441869, 0, 196613, 1441870, 0, 196613, 1441871, 0, 196613 ) __meta__ = { "_edit_lock_": true } @@ -94,7 +98,7 @@ z_index = 1 tile_set = ExtResource( 2 ) cell_size = Vector2( 16, 16 ) format = 1 -tile_data = PoolIntArray( -131044, 0, 262152, -65508, 0, 262152, 28, 0, 262152, 44, 0, 262145, 45, 0, 262146, 46, 0, 262146, 47, 0, 262147, 65564, 0, 262152, 65581, 0, 327685, 65582, 0, 327686, 65583, 0, 327687, 131100, 0, 262152, 131118, 0, 327688, 196636, 0, 262152, 196654, 0, 327688, 262190, 0, 327688, 327726, 0, 327688, 393262, 0, 327688, 458798, 0, 327690, 589827, 0, 262148, 589828, 0, 262149, 589829, 0, 262149, 589830, 0, 262149, 589831, 0, 262151 ) +tile_data = PoolIntArray( -131044, 0, 262152, -65508, 0, 262152, 28, 0, 262152, 44, 0, 262145, 45, 0, 262146, 46, 0, 262146, 47, 0, 262147, 65564, 0, 262152, 65581, 0, 327685, 65582, 0, 327686, 65583, 0, 327687, 131100, 0, 262152, 131118, 0, 327688, 196636, 0, 262152, 196654, 0, 327688, 262190, 0, 327688, 327726, 0, 327688, 393262, 0, 327688, 458798, 0, 327690, 589827, 0, 262148, 589828, 0, 262149, 589829, 0, 262149, 589830, 0, 262149, 589831, 0, 262151, 1310765, 0, 262144, 1310766, 0, 262144, 1310767, 0, 262144, 1310768, 0, 262144, 1310769, 0, 262144, 1310770, 0, 262144 ) [node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."] stream = ExtResource( 6 ) @@ -137,3 +141,14 @@ shape = SubResource( 3 ) __meta__ = { "_edit_lock_": true } + +[node name="Ice" parent="." instance=ExtResource( 11 )] +position = Vector2( 1101, 328 ) +collision_layer = 0 +collision_mask = 2 +modifier_name = "ice_flow_nowhere_to_go" +jerk_factor = -80.0 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Ice"] +position = Vector2( 83, 9.5 ) +shape = SubResource( 4 ) diff --git a/src/components/Modifier_Component.gd b/src/components/Modifier_Component.gd new file mode 100644 index 0000000..13ec527 --- /dev/null +++ b/src/components/Modifier_Component.gd @@ -0,0 +1,48 @@ +extends Area2D + + +var modifier_type = 0 + +export var modifier_name :String = '' +var animation_name: String = '' # Not using this one +var timeout_seconds: float = 0.0 # Not doing timeout based ones yet either. + +export var move_speed: float = 0.0 +export var move_acceleration: float = 0.0 +export var move_speed_modifier: float = 0.0 +export var move_modifier_move_acceleration: float = 0.0 +export var jerk_factor: float = 0 + +export var gravity_modifier: int = 0 + +#var state_timeout: Timer + +# Declare member variables here. Examples: +# var a = 2 +# var b = "text" + +var modifier :StateModifier +#var modifier_properties: ModifierProperties + + +# Called when the node enters the scene tree for the first time. +func _ready(): + modifier = StateModifier.new() + modifier.ready( modifier_name, animation_name , modifier.TYPE.NONE, timeout_seconds) + modifier.modifier_properties = ModifierProperties.new( move_speed, + gravity_modifier, + move_acceleration, + move_speed_modifier, + move_modifier_move_acceleration, + jerk_factor) + +func _on_Modifier_Component_body_entered(body): + var colliding_node = body + if colliding_node.has_node("Modifier_Receiver"): + colliding_node.get_node("Modifier_Receiver").register_modifier(modifier) + + +func _on_Modifier_Component_body_exited(body): + var colliding_node = body + if colliding_node.has_node("Modifier_Receiver"): + colliding_node.get_node("Modifier_Receiver").remove_modifier(modifier) diff --git a/src/components/Modifier_Component.tscn b/src/components/Modifier_Component.tscn new file mode 100644 index 0000000..cd6c7d0 --- /dev/null +++ b/src/components/Modifier_Component.tscn @@ -0,0 +1,9 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://src/components/Modifier_Component.gd" type="Script" id=1] + +[node name="Modifier_Component" type="Area2D"] +script = ExtResource( 1 ) + +[connection signal="body_entered" from="." to="." method="_on_Modifier_Component_body_entered"] +[connection signal="body_exited" from="." to="." method="_on_Modifier_Component_body_exited"] diff --git a/src/components/Modifier_Receiver.gd b/src/components/Modifier_Receiver.gd new file mode 100644 index 0000000..f70a652 --- /dev/null +++ b/src/components/Modifier_Receiver.gd @@ -0,0 +1,53 @@ +class_name Modifier_Receiver +extends Node2D + +# This may be stupid but we're going to have two kinds of callbacks here. +# It's going to be up to the parent/actor/kinematicbody2d/whatever to know +# what conditions have to be met before being able to call that interactible's +# function. +# This is a nice and generic interface that I might be able to use for +# things like opening doors in a level, opening chests/flipping switches etc. + +# This node can keep an array of various interactibles within a level +# and provide several helper functions for managing them perhaps. + +export(String) var modifier_parent_callback = "" +export var debug_receiver :bool = false + +var call_function: FuncRef + +#var interactable_function_callables = [] + +var modifier_collection = [] + +# Declare member variables here. Examples: +# var a = 2 +# var b = "text" + +##NOTE: +## Call function should be implemented as two parameters, one expecting a modifier +## and the other expecting a boolean as to whether its being added + +# Called when the node enters the scene tree for the first time. +func _ready(): + if modifier_parent_callback: + call_function = funcref(owner, modifier_parent_callback) + else: + print("Warning: No modifier receiver function defined on ", owner.name) + +# Switching to a new model that starts with Hitbox +func register_modifier(modifier: StateModifier): + if modifier_collection.has(modifier) == false: + print("New Modifier Registered " + modifier.name) + modifier_collection.append(modifier) + if call_function.is_valid(): + call_function.call_func(modifier, true) + +func remove_modifier(modifier): + print("Modifier Removal " + modifier.name) + if modifier_collection.has(modifier): + var modifier_index = modifier_collection.rfind(modifier) + if modifier_index != -1: + modifier_collection.remove(modifier_index) + if call_function.is_valid(): + call_function.call_func(modifier, false) diff --git a/src/components/Modifier_Receiver.tscn b/src/components/Modifier_Receiver.tscn new file mode 100644 index 0000000..6e0c4a3 --- /dev/null +++ b/src/components/Modifier_Receiver.tscn @@ -0,0 +1,6 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://src/components/Modifier_Receiver.gd" type="Script" id=1] + +[node name="Modifier_Receiver" type="Node2D"] +script = ExtResource( 1 ) diff --git a/src/playerD/Player.gd b/src/playerD/Player.gd index b7a7064..3e31c0c 100644 --- a/src/playerD/Player.gd +++ b/src/playerD/Player.gd @@ -27,6 +27,13 @@ func hit_Receiver(damage): yield( get_tree().create_timer(2 + $movement_state_machine/hurt.timeout_seconds), "timeout") $Hurtbox_Component.set_hurtbox(true) +func receive_modifier(incomming_modifier :StateModifier, is_adding_modifier_operation: bool): + #var mod :StateModifier + if is_adding_modifier_operation: + print("Player Received modifier:", incomming_modifier.name) + else: + print("Player Removed modifier:", incomming_modifier.name) + func touch_the_thing(the_thing: Interactable) -> bool: print("You see! a THING...", the_thing.name) if the_thing is HealthPickup: diff --git a/src/playerD/Player.tscn b/src/playerD/Player.tscn index cbe695c..33be82c 100644 --- a/src/playerD/Player.tscn +++ b/src/playerD/Player.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=126 format=2] +[gd_scene load_steps=127 format=2] [ext_resource path="res://src/templates/Actor/ActorTemplate.tscn" type="PackedScene" id=1] [ext_resource path="res://src/playerD/movement_component.gd" type="Script" id=2] @@ -8,6 +8,7 @@ [ext_resource path="res://src/playerD/states/fall.gd" type="Script" id=6] [ext_resource path="res://src/components/Health_Component.tscn" type="PackedScene" id=7] [ext_resource path="res://src/playerD/states/jump.gd" type="Script" id=8] +[ext_resource path="res://src/components/Modifier_Receiver.tscn" type="PackedScene" id=9] [ext_resource path="res://src/playerD/states/attack.gd" type="Script" id=10] [ext_resource path="res://src/playerD/states/dash.gd" type="Script" id=11] [ext_resource path="res://src/playerD/states/hurt.gd" type="Script" id=12] @@ -578,14 +579,12 @@ roll_node = NodePath("../roll") [node name="fall" parent="movement_state_machine" index="1"] script = ExtResource( 6 ) -debug_state = true move_speed = 90.0 animation_sequence = [ "jump" ] landing_node = NodePath("") [node name="move" parent="movement_state_machine" index="2"] script = ExtResource( 5 ) -debug_state = true move_speed = 90.0 animation_sequence = [ "step", "run" ] jump_node = NodePath("../jump") @@ -593,7 +592,6 @@ attack_node = NodePath("../attack") [node name="jump" type="Node" parent="movement_state_machine" index="3"] script = ExtResource( 8 ) -debug_state = true move_speed = 90.0 animation_sequence = [ "jump" ] idle_node = NodePath("../idle") @@ -675,6 +673,10 @@ default_color = Color( 1, 0.607843, 0, 1 ) script = ExtResource( 16 ) interactable_parent_callback = "touch_the_thing" +[node name="Modifier_Receiver" parent="." index="9" instance=ExtResource( 9 )] +modifier_parent_callback = "receive_modifier" +debug_receiver = true + [connection signal="do_attack" from="movement_state_machine/attack" to="." method="_on_attack_do_attack"] [connection signal="frame_reached" from="movement_state_machine/roll" to="." method="_on_roll_frame_reached"] [connection signal="state_exited" from="movement_state_machine/roll" to="." method="_on_roll_state_exited"] diff --git a/src/state_modifier.gd b/src/state_modifier.gd index 9da82f7..06be1b4 100644 --- a/src/state_modifier.gd +++ b/src/state_modifier.gd @@ -92,6 +92,7 @@ func get_modifier_properties() -> ModifierProperties: modifier_properties.jerk_factor) func ready(modifier_name:String, anim_name:String = '', type = TYPE.NONE, timeout : float = 0, parent:Node = null, function_name : String = "") -> Timer: + name = modifier_name # If somebody forgot to specify the type if anim_name != '' and type == TYPE.NONE: modifier_type = TYPE.REPLACE_ANIMATION