master
chimchooree 1 year ago
parent deabe48ba4
commit adf4cc3433

@ -1,4 +1,4 @@
[gd_scene load_steps=79 format=2] [gd_scene load_steps=83 format=2]
[ext_resource path="res://res/level/neighbor.png" type="Texture" id=1] [ext_resource path="res://res/level/neighbor.png" type="Texture" id=1]
[ext_resource path="res://res/character/girl.png" type="Texture" id=2] [ext_resource path="res://res/character/girl.png" type="Texture" id=2]
@ -7,287 +7,295 @@
[ext_resource path="res://entity/KinematicBody2D.gd" type="Script" id=5] [ext_resource path="res://entity/KinematicBody2D.gd" type="Script" id=5]
[ext_resource path="res://entity/Girl.gd" type="Script" id=6] [ext_resource path="res://entity/Girl.gd" type="Script" id=6]
[ext_resource path="res://entity/AI/Player.gd" type="Script" id=7] [ext_resource path="res://entity/AI/Player.gd" type="Script" id=7]
[ext_resource path="res://entity/Marsh.gd" type="Script" id=8]
[ext_resource path="res://entity/NPC.gd" type="Script" id=9]
[sub_resource type="RectangleShape2D" id=24] [sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 63.6867, 3.6744 ) extents = Vector2( 63.6867, 3.6744 )
[sub_resource type="RectangleShape2D" id=25] [sub_resource type="RectangleShape2D" id=2]
extents = Vector2( 32.0662, 3.6744 ) extents = Vector2( 32.0662, 3.6744 )
[sub_resource type="RectangleShape2D" id=33] [sub_resource type="RectangleShape2D" id=3]
extents = Vector2( 37.8145, 3.6744 ) extents = Vector2( 37.8145, 3.6744 )
[sub_resource type="RectangleShape2D" id=34] [sub_resource type="RectangleShape2D" id=4]
extents = Vector2( 8.02289, 30.0256 ) extents = Vector2( 8.02289, 30.0256 )
[sub_resource type="RectangleShape2D" id=46] [sub_resource type="RectangleShape2D" id=5]
extents = Vector2( 8.02289, 108.577 ) extents = Vector2( 8.02289, 108.577 )
[sub_resource type="RectangleShape2D" id=35] [sub_resource type="RectangleShape2D" id=6]
extents = Vector2( 8.02289, 293.961 ) extents = Vector2( 8.02289, 293.961 )
[sub_resource type="RectangleShape2D" id=74] [sub_resource type="RectangleShape2D" id=7]
extents = Vector2( 20.3464, 583.982 ) extents = Vector2( 20.3464, 583.982 )
[sub_resource type="RectangleShape2D" id=47] [sub_resource type="RectangleShape2D" id=8]
extents = Vector2( 8.02289, 30.9752 ) extents = Vector2( 8.02289, 30.9752 )
[sub_resource type="RectangleShape2D" id=48] [sub_resource type="RectangleShape2D" id=9]
extents = Vector2( 8.02289, 98.1562 ) extents = Vector2( 8.02289, 98.1562 )
[sub_resource type="RectangleShape2D" id=60] [sub_resource type="RectangleShape2D" id=10]
extents = Vector2( 8.02289, 67.4859 ) extents = Vector2( 8.02289, 67.4859 )
[sub_resource type="RectangleShape2D" id=49] [sub_resource type="RectangleShape2D" id=11]
extents = Vector2( 8.02289, 74.0901 ) extents = Vector2( 8.02289, 74.0901 )
[sub_resource type="RectangleShape2D" id=50] [sub_resource type="RectangleShape2D" id=12]
extents = Vector2( 8.02289, 35.0995 ) extents = Vector2( 8.02289, 35.0995 )
[sub_resource type="RectangleShape2D" id=45] [sub_resource type="RectangleShape2D" id=13]
extents = Vector2( 8.02289, 444.485 ) extents = Vector2( 8.02289, 444.485 )
[sub_resource type="RectangleShape2D" id=36] [sub_resource type="RectangleShape2D" id=14]
extents = Vector2( 8.02289, 63.4933 ) extents = Vector2( 8.02289, 63.4933 )
[sub_resource type="RectangleShape2D" id=37] [sub_resource type="RectangleShape2D" id=15]
extents = Vector2( 8.02289, 76.8 ) extents = Vector2( 8.02289, 76.8 )
[sub_resource type="RectangleShape2D" id=38] [sub_resource type="RectangleShape2D" id=16]
extents = Vector2( 68.1425, 3.6744 ) extents = Vector2( 68.1425, 3.6744 )
[sub_resource type="RectangleShape2D" id=51] [sub_resource type="RectangleShape2D" id=17]
extents = Vector2( 38.0133, 3.6744 ) extents = Vector2( 38.0133, 3.6744 )
[sub_resource type="RectangleShape2D" id=39] [sub_resource type="RectangleShape2D" id=18]
extents = Vector2( 68.4766, 3.6744 ) extents = Vector2( 68.4766, 3.6744 )
[sub_resource type="RectangleShape2D" id=40] [sub_resource type="RectangleShape2D" id=19]
extents = Vector2( 40.3452, 3.6744 ) extents = Vector2( 40.3452, 3.6744 )
[sub_resource type="RectangleShape2D" id=41] [sub_resource type="RectangleShape2D" id=20]
extents = Vector2( 29.019, 6.21887 ) extents = Vector2( 29.019, 6.21887 )
[sub_resource type="RectangleShape2D" id=52] [sub_resource type="RectangleShape2D" id=21]
extents = Vector2( 71.2418, 6.21887 ) extents = Vector2( 71.2418, 6.21887 )
[sub_resource type="RectangleShape2D" id=53] [sub_resource type="RectangleShape2D" id=22]
extents = Vector2( 39.3086, 6.21887 ) extents = Vector2( 39.3086, 6.21887 )
[sub_resource type="RectangleShape2D" id=54] [sub_resource type="RectangleShape2D" id=23]
extents = Vector2( 60.4154, 6.21887 ) extents = Vector2( 60.4154, 6.21887 )
[sub_resource type="RectangleShape2D" id=61] [sub_resource type="RectangleShape2D" id=24]
extents = Vector2( 129.855, 6.21887 ) extents = Vector2( 86.5344, 6.21887 )
[sub_resource type="RectangleShape2D" id=75] [sub_resource type="RectangleShape2D" id=25]
extents = Vector2( 341.619, 24.2664 ) extents = Vector2( 341.619, 24.2664 )
[sub_resource type="RectangleShape2D" id=62] [sub_resource type="RectangleShape2D" id=26]
extents = Vector2( 34.9545, 6.21887 ) extents = Vector2( 34.9545, 6.21887 )
[sub_resource type="RectangleShape2D" id=63] [sub_resource type="RectangleShape2D" id=27]
extents = Vector2( 26.561, 6.21887 ) extents = Vector2( 26.561, 6.21887 )
[sub_resource type="RectangleShape2D" id=42] [sub_resource type="RectangleShape2D" id=28]
extents = Vector2( 284.625, 6.21887 ) extents = Vector2( 284.625, 6.21887 )
[sub_resource type="RectangleShape2D" id=43] [sub_resource type="RectangleShape2D" id=29]
extents = Vector2( 57.5036, 6.21887 ) extents = Vector2( 57.5036, 6.21887 )
[sub_resource type="RectangleShape2D" id=44] [sub_resource type="RectangleShape2D" id=30]
extents = Vector2( 15.5976, 3.6744 ) extents = Vector2( 15.5976, 3.6744 )
[sub_resource type="RectangleShape2D" id=68] [sub_resource type="RectangleShape2D" id=31]
extents = Vector2( 24.1026, 6.5618 ) extents = Vector2( 24.1026, 6.5618 )
[sub_resource type="RectangleShape2D" id=69] [sub_resource type="RectangleShape2D" id=32]
extents = Vector2( 24.1026, 8.75928 ) extents = Vector2( 24.1026, 8.75928 )
[sub_resource type="RectangleShape2D" id=28] [sub_resource type="RectangleShape2D" id=33]
extents = Vector2( 10.3047, 8.88223 ) extents = Vector2( 10.3047, 8.88223 )
[sub_resource type="RectangleShape2D" id=29] [sub_resource type="RectangleShape2D" id=34]
extents = Vector2( 10.3047, 6.35382 ) extents = Vector2( 10.3047, 6.35382 )
[sub_resource type="RectangleShape2D" id=70] [sub_resource type="RectangleShape2D" id=35]
extents = Vector2( 8.11879, 3.02176 ) extents = Vector2( 8.11879, 3.02176 )
[sub_resource type="RectangleShape2D" id=30] [sub_resource type="RectangleShape2D" id=36]
extents = Vector2( 16.1447, 3.35818 ) extents = Vector2( 16.1447, 3.35818 )
[sub_resource type="RectangleShape2D" id=71] [sub_resource type="RectangleShape2D" id=37]
extents = Vector2( 16.1447, 5.77868 ) extents = Vector2( 16.1447, 5.77868 )
[sub_resource type="RectangleShape2D" id=72] [sub_resource type="RectangleShape2D" id=38]
extents = Vector2( 19.9137, 21.6313 ) extents = Vector2( 19.9137, 21.6313 )
[sub_resource type="RectangleShape2D" id=55] [sub_resource type="RectangleShape2D" id=39]
extents = Vector2( 12.3065, 3.35818 ) extents = Vector2( 12.3065, 3.35818 )
[sub_resource type="RectangleShape2D" id=56] [sub_resource type="RectangleShape2D" id=40]
extents = Vector2( 12.3065, 6.64336 ) extents = Vector2( 12.3065, 6.64336 )
[sub_resource type="RectangleShape2D" id=57] [sub_resource type="RectangleShape2D" id=41]
extents = Vector2( 10.4873, 39.2022 ) extents = Vector2( 10.4873, 39.2022 )
[sub_resource type="RectangleShape2D" id=31] [sub_resource type="RectangleShape2D" id=42]
extents = Vector2( 12.9732, 3.6744 ) extents = Vector2( 12.9732, 3.6744 )
[sub_resource type="RectangleShape2D" id=58] [sub_resource type="RectangleShape2D" id=43]
extents = Vector2( 4.03589, 71.057 ) extents = Vector2( 4.03589, 71.057 )
[sub_resource type="RectangleShape2D" id=64] [sub_resource type="RectangleShape2D" id=44]
extents = Vector2( 4.03589, 37.6688 ) extents = Vector2( 4.03589, 37.6688 )
[sub_resource type="RectangleShape2D" id=67] [sub_resource type="RectangleShape2D" id=45]
extents = Vector2( 4.03589, 33.133 ) extents = Vector2( 4.03589, 33.133 )
[sub_resource type="RectangleShape2D" id=65] [sub_resource type="RectangleShape2D" id=46]
extents = Vector2( 4.03589, 67.6024 ) extents = Vector2( 4.03589, 67.6024 )
[sub_resource type="RectangleShape2D" id=66] [sub_resource type="RectangleShape2D" id=47]
extents = Vector2( 4.03589, 162.649 ) extents = Vector2( 4.03589, 162.649 )
[sub_resource type="RectangleShape2D" id=59] [sub_resource type="RectangleShape2D" id=48]
extents = Vector2( 74.0407, 3.6744 ) extents = Vector2( 74.0407, 3.6744 )
[sub_resource type="AtlasTexture" id=1] [sub_resource type="AtlasTexture" id=49]
flags = 4 flags = 4
atlas = ExtResource( 2 ) atlas = ExtResource( 2 )
region = Rect2( 99, 0, 33, 50 ) region = Rect2( 0, 0, 33, 50 )
[sub_resource type="AtlasTexture" id=2] [sub_resource type="AtlasTexture" id=50]
flags = 4 flags = 4
atlas = ExtResource( 2 ) atlas = ExtResource( 2 )
region = Rect2( 99, 50, 33, 50 ) region = Rect2( 0, 50, 33, 50 )
[sub_resource type="AtlasTexture" id=3] [sub_resource type="AtlasTexture" id=51]
flags = 4 flags = 4
atlas = ExtResource( 2 ) atlas = ExtResource( 2 )
region = Rect2( 99, 100, 33, 50 ) region = Rect2( 0, 100, 33, 50 )
[sub_resource type="AtlasTexture" id=4] [sub_resource type="AtlasTexture" id=52]
flags = 4 flags = 4
atlas = ExtResource( 2 ) atlas = ExtResource( 2 )
region = Rect2( 99, 150, 33, 50 ) region = Rect2( 0, 150, 33, 50 )
[sub_resource type="AtlasTexture" id=5] [sub_resource type="AtlasTexture" id=53]
flags = 4 flags = 4
atlas = ExtResource( 2 ) atlas = ExtResource( 2 )
region = Rect2( 99, 200, 33, 50 ) region = Rect2( 0, 200, 33, 50 )
[sub_resource type="AtlasTexture" id=6] [sub_resource type="AtlasTexture" id=54]
flags = 4 flags = 4
atlas = ExtResource( 2 ) atlas = ExtResource( 2 )
region = Rect2( 33, 0, 33, 50 ) region = Rect2( 0, 0, 33, 50 )
[sub_resource type="AtlasTexture" id=7] [sub_resource type="AtlasTexture" id=55]
flags = 4 flags = 4
atlas = ExtResource( 2 ) atlas = ExtResource( 2 )
region = Rect2( 33, 50, 33, 50 ) region = Rect2( 66, 0, 33, 50 )
[sub_resource type="AtlasTexture" id=8] [sub_resource type="AtlasTexture" id=56]
flags = 4 flags = 4
atlas = ExtResource( 2 ) atlas = ExtResource( 2 )
region = Rect2( 33, 100, 33, 50 ) region = Rect2( 66, 50, 33, 50 )
[sub_resource type="AtlasTexture" id=9] [sub_resource type="AtlasTexture" id=57]
flags = 4 flags = 4
atlas = ExtResource( 2 ) atlas = ExtResource( 2 )
region = Rect2( 33, 150, 33, 50 ) region = Rect2( 66, 100, 33, 50 )
[sub_resource type="AtlasTexture" id=10] [sub_resource type="AtlasTexture" id=58]
flags = 4 flags = 4
atlas = ExtResource( 2 ) atlas = ExtResource( 2 )
region = Rect2( 33, 200, 33, 50 ) region = Rect2( 66, 150, 33, 50 )
[sub_resource type="AtlasTexture" id=11] [sub_resource type="AtlasTexture" id=59]
flags = 4 flags = 4
atlas = ExtResource( 2 ) atlas = ExtResource( 2 )
region = Rect2( 66, 0, 33, 50 ) region = Rect2( 66, 200, 33, 50 )
[sub_resource type="AtlasTexture" id=12] [sub_resource type="AtlasTexture" id=60]
flags = 4 flags = 4
atlas = ExtResource( 2 ) atlas = ExtResource( 2 )
region = Rect2( 66, 50, 33, 50 ) region = Rect2( 99, 0, 33, 50 )
[sub_resource type="AtlasTexture" id=13] [sub_resource type="AtlasTexture" id=61]
flags = 4 flags = 4
atlas = ExtResource( 2 ) atlas = ExtResource( 2 )
region = Rect2( 66, 100, 33, 50 ) region = Rect2( 99, 50, 33, 50 )
[sub_resource type="AtlasTexture" id=14] [sub_resource type="AtlasTexture" id=62]
flags = 4 flags = 4
atlas = ExtResource( 2 ) atlas = ExtResource( 2 )
region = Rect2( 66, 150, 33, 50 ) region = Rect2( 99, 100, 33, 50 )
[sub_resource type="AtlasTexture" id=15] [sub_resource type="AtlasTexture" id=63]
flags = 4 flags = 4
atlas = ExtResource( 2 ) atlas = ExtResource( 2 )
region = Rect2( 66, 200, 33, 50 ) region = Rect2( 99, 150, 33, 50 )
[sub_resource type="AtlasTexture" id=16] [sub_resource type="AtlasTexture" id=64]
flags = 4 flags = 4
atlas = ExtResource( 2 ) atlas = ExtResource( 2 )
region = Rect2( 0, 0, 33, 50 ) region = Rect2( 99, 200, 33, 50 )
[sub_resource type="AtlasTexture" id=17] [sub_resource type="AtlasTexture" id=65]
flags = 4 flags = 4
atlas = ExtResource( 2 ) atlas = ExtResource( 2 )
region = Rect2( 0, 50, 33, 50 ) region = Rect2( 33, 0, 33, 50 )
[sub_resource type="AtlasTexture" id=18] [sub_resource type="AtlasTexture" id=66]
flags = 4 flags = 4
atlas = ExtResource( 2 ) atlas = ExtResource( 2 )
region = Rect2( 0, 100, 33, 50 ) region = Rect2( 33, 50, 33, 50 )
[sub_resource type="AtlasTexture" id=19] [sub_resource type="AtlasTexture" id=67]
flags = 4 flags = 4
atlas = ExtResource( 2 ) atlas = ExtResource( 2 )
region = Rect2( 0, 150, 33, 50 ) region = Rect2( 33, 100, 33, 50 )
[sub_resource type="AtlasTexture" id=20] [sub_resource type="AtlasTexture" id=68]
flags = 4 flags = 4
atlas = ExtResource( 2 ) atlas = ExtResource( 2 )
region = Rect2( 0, 200, 33, 50 ) region = Rect2( 33, 150, 33, 50 )
[sub_resource type="AtlasTexture" id=23] [sub_resource type="AtlasTexture" id=69]
flags = 4 flags = 4
atlas = ExtResource( 2 ) atlas = ExtResource( 2 )
region = Rect2( 0, 0, 33, 50 ) region = Rect2( 33, 200, 33, 50 )
[sub_resource type="SpriteFrames" id=21] [sub_resource type="SpriteFrames" id=70]
animations = [ { animations = [ {
"frames": [ SubResource( 1 ), SubResource( 2 ), SubResource( 3 ), SubResource( 4 ), SubResource( 5 ) ], "frames": [ SubResource( 49 ), SubResource( 50 ), SubResource( 51 ), SubResource( 52 ), SubResource( 53 ) ],
"loop": true, "loop": true,
"name": "WalkRight", "name": "WalkDown",
"speed": 10.0 "speed": 10.0
}, { }, {
"frames": [ SubResource( 6 ), SubResource( 7 ), SubResource( 8 ), SubResource( 9 ), SubResource( 10 ) ], "frames": [ SubResource( 54 ) ],
"loop": true, "loop": true,
"name": "WalkLeft", "name": "Idle",
"speed": 10.0 "speed": 5.0
}, { }, {
"frames": [ SubResource( 11 ), SubResource( 12 ), SubResource( 13 ), SubResource( 14 ), SubResource( 15 ) ], "frames": [ SubResource( 55 ), SubResource( 56 ), SubResource( 57 ), SubResource( 58 ), SubResource( 59 ) ],
"loop": true, "loop": true,
"name": "WalkUp", "name": "WalkUp",
"speed": 10.0 "speed": 10.0
}, { }, {
"frames": [ SubResource( 16 ), SubResource( 17 ), SubResource( 18 ), SubResource( 19 ), SubResource( 20 ) ], "frames": [ SubResource( 60 ), SubResource( 61 ), SubResource( 62 ), SubResource( 63 ), SubResource( 64 ) ],
"loop": true, "loop": true,
"name": "WalkDown", "name": "WalkRight",
"speed": 10.0 "speed": 10.0
}, { }, {
"frames": [ SubResource( 23 ) ], "frames": [ SubResource( 65 ), SubResource( 66 ), SubResource( 67 ), SubResource( 68 ), SubResource( 69 ) ],
"loop": true, "loop": true,
"name": "Idle", "name": "WalkLeft",
"speed": 5.0 "speed": 10.0
} ] } ]
[sub_resource type="RectangleShape2D" id=73] [sub_resource type="RectangleShape2D" id=71]
extents = Vector2( 7.40962, 1.04021 ) extents = Vector2( 7.40962, 1.04021 )
[sub_resource type="CircleShape2D" id=72]
radius = 27.4372
[sub_resource type="RectangleShape2D" id=73]
extents = Vector2( 4.49039, 2.85052 )
[node name="Node" type="Node"] [node name="Node" type="Node"]
[node name="World" type="Node2D" parent="."] [node name="World" type="Node2D" parent="."]
@ -302,236 +310,238 @@ __meta__ = {
[node name="CollisionShape2D2" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D2" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( 143.329, 237.348 ) position = Vector2( 143.329, 237.348 )
shape = SubResource( 24 ) shape = SubResource( 1 )
[node name="CollisionShape2D8" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D8" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( 32.535, 301.568 ) position = Vector2( 32.535, 301.568 )
shape = SubResource( 25 ) shape = SubResource( 2 )
[node name="CollisionShape2D9" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D9" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( 103.759, 364.845 ) position = Vector2( 103.759, 364.845 )
shape = SubResource( 33 ) shape = SubResource( 3 )
[node name="CollisionShape2D11" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D11" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( 72.0283, 392.309 ) position = Vector2( 72.0283, 392.309 )
shape = SubResource( 34 ) shape = SubResource( 4 )
[node name="CollisionShape2D12" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D12" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( 199.786, 473.006 ) position = Vector2( 199.786, 473.006 )
shape = SubResource( 46 ) shape = SubResource( 5 )
[node name="CollisionShape2D22" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D22" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( 264.062, -250.781 ) position = Vector2( 264.062, -250.781 )
shape = SubResource( 35 ) shape = SubResource( 6 )
[node name="CollisionShape2D54" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D54" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( 339.664, -4.98611 ) position = Vector2( 339.664, -4.98611 )
shape = SubResource( 74 ) shape = SubResource( 7 )
[node name="CollisionShape2D55" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D55" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( -336.336, 3.01389 ) position = Vector2( -336.336, 3.01389 )
shape = SubResource( 74 ) shape = SubResource( 7 )
[node name="CollisionShape2D29" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D29" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( 135.722, 10.1415 ) position = Vector2( 135.722, 10.1415 )
shape = SubResource( 47 ) shape = SubResource( 8 )
[node name="CollisionShape2D30" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D30" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( -120.363, 8.70917 ) position = Vector2( -120.363, 8.70917 )
shape = SubResource( 48 ) shape = SubResource( 9 )
[node name="CollisionShape2D39" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D39" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( -247.719, 162.66 ) position = Vector2( -247.719, 162.66 )
shape = SubResource( 60 ) shape = SubResource( 10 )
[node name="CollisionShape2D33" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D33" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( -184.36, -25.9392 ) position = Vector2( -184.36, -25.9392 )
shape = SubResource( 49 ) shape = SubResource( 11 )
[node name="CollisionShape2D35" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D35" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( -247.967, 6.94128 ) position = Vector2( -247.967, 6.94128 )
shape = SubResource( 50 ) shape = SubResource( 12 )
[node name="CollisionShape2D24" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D24" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( -312.286, -144.661 ) position = Vector2( -312.286, -144.661 )
shape = SubResource( 45 ) shape = SubResource( 13 )
[node name="CollisionShape2D13" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D13" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( -248.515, 514.109 ) position = Vector2( -248.515, 514.109 )
shape = SubResource( 36 ) shape = SubResource( 14 )
[node name="CollisionShape2D14" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D14" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( -311.583, 505.7 ) position = Vector2( -311.583, 505.7 )
shape = SubResource( 37 ) shape = SubResource( 15 )
[node name="CollisionShape2D10" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D10" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( 252.03, 364.099 ) position = Vector2( 252.03, 364.099 )
shape = SubResource( 38 ) shape = SubResource( 16 )
[node name="CollisionShape2D15" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D15" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( 45.4571, 165.13 ) position = Vector2( 45.4571, 165.13 )
shape = SubResource( 51 ) shape = SubResource( 17 )
[node name="CollisionShape2D16" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D16" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( -244.037, 301.104 ) position = Vector2( -244.037, 301.104 )
shape = SubResource( 39 ) shape = SubResource( 18 )
[node name="CollisionShape2D17" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D17" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( -280.493, 431.027 ) position = Vector2( -280.493, 431.027 )
shape = SubResource( 40 ) shape = SubResource( 19 )
[node name="CollisionShape2D19" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D19" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( -281.829, 482.368 ) position = Vector2( -281.829, 482.368 )
shape = SubResource( 41 ) shape = SubResource( 20 )
[node name="CollisionShape2D31" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D31" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( -183.471, 101.043 ) position = Vector2( -183.471, 101.043 )
shape = SubResource( 52 ) shape = SubResource( 21 )
[node name="CollisionShape2D32" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D32" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( -151.624, -93.6176 ) position = Vector2( -151.624, -93.6176 )
shape = SubResource( 53 ) shape = SubResource( 22 )
[node name="CollisionShape2D34" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D34" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( -216.825, 41.9985 ) position = Vector2( -216.825, 41.9985 )
shape = SubResource( 53 ) shape = SubResource( 22 )
[node name="CollisionShape2D36" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D36" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( -248.069, -26.9444 ) position = Vector2( -248.069, -26.9444 )
shape = SubResource( 54 ) shape = SubResource( 23 )
[node name="CollisionShape2D37" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D37" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( 13.9138, -22.7017 ) position = Vector2( -29.9763, -22.2298 )
shape = SubResource( 61 ) shape = SubResource( 24 )
[node name="CollisionShape2D56" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D56" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( 9.91382, -596.702 ) position = Vector2( 9.91382, -596.702 )
shape = SubResource( 75 ) shape = SubResource( 25 )
[node name="CollisionShape2D57" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D57" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( 11.9138, 599.298 ) position = Vector2( 11.9138, 599.298 )
shape = SubResource( 75 ) shape = SubResource( 25 )
[node name="CollisionShape2D38" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D38" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( -274.846, 231.538 ) position = Vector2( -274.846, 231.538 )
shape = SubResource( 62 ) shape = SubResource( 26 )
[node name="CollisionShape2D40" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D40" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( -280.519, 134.095 ) position = Vector2( -280.519, 134.095 )
shape = SubResource( 63 ) shape = SubResource( 27 )
[node name="CollisionShape2D20" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D20" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( -22.8132, 553.339 ) position = Vector2( -22.8132, 553.339 )
shape = SubResource( 42 ) shape = SubResource( 28 )
[node name="CollisionShape2D23" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D23" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( -21.3526, -532.319 ) position = Vector2( -21.3526, -532.319 )
shape = SubResource( 42 ) shape = SubResource( 28 )
[node name="CollisionShape2D21" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D21" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( 263.88, 553.708 ) position = Vector2( 263.88, 553.708 )
shape = SubResource( 43 ) shape = SubResource( 29 )
[node name="CollisionShape2D18" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D18" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( -183.805, 431.261 ) position = Vector2( -183.805, 431.261 )
shape = SubResource( 44 ) shape = SubResource( 30 )
[node name="CollisionShape2D4" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D4" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( 160.118, 247.028 ) position = Vector2( 160.118, 247.028 )
shape = SubResource( 68 ) shape = SubResource( 31 )
[node name="CollisionShape2D52" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D52" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( 224.187, 53.5974 ) position = Vector2( 224.187, 53.5974 )
shape = SubResource( 69 ) shape = SubResource( 32 )
[node name="CollisionShape2D5" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D5" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( 179.69, 275.496 ) position = Vector2( 179.69, 275.496 )
shape = SubResource( 28 ) shape = SubResource( 33 )
[node name="CollisionShape2D50" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D50" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( 147.591, 107.333 ) position = Vector2( 147.591, 107.333 )
shape = SubResource( 28 ) shape = SubResource( 33 )
[node name="CollisionShape2D45" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D45" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( -300.1, 363.242 ) position = Vector2( -300.1, 363.242 )
shape = SubResource( 28 ) shape = SubResource( 33 )
[node name="CollisionShape2D6" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D6" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( 147.851, 269.69 ) position = Vector2( 147.851, 269.69 )
shape = SubResource( 29 ) shape = SubResource( 34 )
[node name="CollisionShape2D49" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D49" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( -44.106, 356.071 ) position = Vector2( -44.106, 356.071 )
shape = SubResource( 70 ) shape = SubResource( 35 )
[node name="CollisionShape2D7" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D7" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( 103.944, 244.217 ) position = Vector2( 103.944, 244.217 )
shape = SubResource( 30 ) shape = SubResource( 36 )
[node name="CollisionShape2D51" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D51" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( 167.943, 49.624 ) position = Vector2( 167.943, 49.624 )
shape = SubResource( 71 ) shape = SubResource( 37 )
[node name="CollisionShape2D53" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D53" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( 27.8719, 18.4961 ) position = Vector2( 27.8719, 18.4961 )
shape = SubResource( 72 ) shape = SubResource( 38 )
[node name="CollisionShape2D46" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D46" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( -280.471, 307.809 ) position = Vector2( -280.471, 307.809 )
shape = SubResource( 30 ) shape = SubResource( 36 )
[node name="CollisionShape2D25" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D25" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( 67.9435, 181.467 ) position = Vector2( 67.9435, 181.467 )
shape = SubResource( 55 ) shape = SubResource( 39 )
[node name="CollisionShape2D26" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D26" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( 35.5376, 174.777 ) position = Vector2( 35.5376, 174.777 )
shape = SubResource( 56 ) shape = SubResource( 40 )
[node name="CollisionShape2D27" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D27" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( 13.957, 206.569 ) position = Vector2( 13.957, 206.569 )
shape = SubResource( 57 ) shape = SubResource( 41 )
[node name="CollisionShape2D3" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D3" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( 261.277, 237.027 ) position = Vector2( 261.277, 237.027 )
shape = SubResource( 31 ) shape = SubResource( 42 )
[node name="CollisionShape2D28" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D28" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( 131.998, 110.734 ) position = Vector2( 131.998, 110.734 )
shape = SubResource( 58 ) shape = SubResource( 43 )
[node name="CollisionShape2D42" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D42" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( 84.053, 199.419 ) position = Vector2( 84.053, 199.419 )
shape = SubResource( 64 ) shape = SubResource( 44 )
[node name="CollisionShape2D44" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D44" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( 68.0144, 331.03 ) position = Vector2( 68.0144, 331.03 )
shape = SubResource( 67 ) shape = SubResource( 45 )
[node name="CollisionShape2D43" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D43" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( 3.8119, 230.836 ) position = Vector2( 3.8119, 230.836 )
shape = SubResource( 65 ) shape = SubResource( 46 )
[node name="CollisionShape2D47" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D47" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( -315.828, 363.341 ) position = Vector2( -315.828, 363.341 )
shape = SubResource( 65 ) shape = SubResource( 46 )
[node name="CollisionShape2D48" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D48" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( -171.982, 365.025 ) position = Vector2( -171.982, 365.025 )
shape = SubResource( 65 ) shape = SubResource( 46 )
[node name="CollisionShape2D41" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D41" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( 275.084, 200.328 ) position = Vector2( 275.084, 200.328 )
shape = SubResource( 66 ) shape = SubResource( 47 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="World/Level/StaticBody2D"] [node name="CollisionShape2D" type="CollisionShape2D" parent="World/Level/StaticBody2D"]
position = Vector2( 204.182, 41.4701 ) position = Vector2( 204.182, 41.4701 )
shape = SubResource( 59 ) shape = SubResource( 48 )
[node name="Enter" type="Position2D" parent="World"] [node name="Enter" type="Position2D" parent="World"]
position = Vector2( 208.579, 63.3655 ) position = Vector2( 208.579, 63.3655 )
[node name="Girl" type="Node" parent="World/Enter"] [node name="Girl" type="Node" parent="World/Enter" groups=[
"player",
]]
script = ExtResource( 6 ) script = ExtResource( 6 )
[node name="KinematicBody2D" type="KinematicBody2D" parent="World/Enter/Girl"] [node name="KinematicBody2D" type="KinematicBody2D" parent="World/Enter/Girl"]
@ -539,32 +549,48 @@ position = Vector2( 208.579, 63.3655 )
script = ExtResource( 5 ) script = ExtResource( 5 )
[node name="AnimatedSprite" type="AnimatedSprite" parent="World/Enter/Girl/KinematicBody2D"] [node name="AnimatedSprite" type="AnimatedSprite" parent="World/Enter/Girl/KinematicBody2D"]
frames = SubResource( 21 ) frames = SubResource( 70 )
animation = "Idle" animation = "Idle"
[node name="CollisionShape2D" type="CollisionShape2D" parent="World/Enter/Girl/KinematicBody2D"] [node name="Feet" type="CollisionShape2D" parent="World/Enter/Girl/KinematicBody2D"]
position = Vector2( 2.68069, 14.3499 ) position = Vector2( 2.68069, 14.3499 )
shape = SubResource( 73 ) shape = SubResource( 71 )
[node name="Camera2D" type="Camera2D" parent="World/Enter/Girl/KinematicBody2D"] [node name="Camera2D" type="Camera2D" parent="World/Enter/Girl/KinematicBody2D"]
current = true current = true
[node name="PersonalSpace" type="Area2D" parent="World/Enter/Girl/KinematicBody2D"]
[node name="CollisionShape2D" type="CollisionShape2D" parent="World/Enter/Girl/KinematicBody2D/PersonalSpace"]
position = Vector2( 1.70442, -0.164558 )
shape = SubResource( 72 )
[node name="AI" type="Node" parent="World/Enter/Girl"] [node name="AI" type="Node" parent="World/Enter/Girl"]
script = ExtResource( 7 ) script = ExtResource( 7 )
[node name="SpawnNPC" type="Position2D" parent="World"] [node name="SpawnNPC" type="Position2D" parent="World"]
__meta__ = { position = Vector2( 99.5096, 278.601 )
"_edit_lock_": true
} [node name="Marsh" type="Node" parent="World/SpawnNPC" groups=[
"can_interact",
]]
script = ExtResource( 8 )
[node name="StaticBody2D" type="StaticBody2D" parent="World/SpawnNPC/Marsh"]
position = Vector2( 99.5096, 278.601 )
script = ExtResource( 9 )
[node name="NPC" type="Sprite" parent="World/SpawnNPC"] [node name="Sprite" type="Sprite" parent="World/SpawnNPC/Marsh/StaticBody2D" groups=[
"can_interact",
]]
texture = ExtResource( 3 ) texture = ExtResource( 3 )
region_enabled = true region_enabled = true
region_rect = Rect2( 7, 4, 34, 38 ) region_rect = Rect2( 7, 4, 34, 38 )
region_filter_clip = true region_filter_clip = true
__meta__ = {
"_edit_lock_": true [node name="Feet" type="CollisionShape2D" parent="World/SpawnNPC/Marsh/StaticBody2D"]
} position = Vector2( -1.125, 12.625 )
shape = SubResource( 73 )
[node name="SpawnEnemy" type="Position2D" parent="World"] [node name="SpawnEnemy" type="Position2D" parent="World"]
__meta__ = { __meta__ = {

@ -2,8 +2,11 @@ extends Node
# Player AI # Player AI
var ignore_input = false var ignore_input = false
var body_exit_signal = false # interact_input()
var interact_target = null
var velocity_sum = Vector2(0.0,0.0) var velocity_sum = Vector2(0.0,0.0)
# Setters + Getters
func set_ignore_input(new_bool): func set_ignore_input(new_bool):
ignore_input = new_bool ignore_input = new_bool
func get_ignore_input(): func get_ignore_input():
@ -11,10 +14,55 @@ func get_ignore_input():
func get_user(): func get_user():
return get_parent() return get_parent()
### LOGIC ###
# Get Player Input # Get Player Input
func get_input(): func get_input():
if not ignore_input: if not ignore_input:
get_movement_input() get_movement_input()
get_interact_input()
### INTERACTING ###
# Listen for Hotkey for Interacting
func get_interact_input():
## Interact Hotkey
if Input.is_action_just_pressed('interact'):
## Get overlapping bodies from range bubble
var bodies = get_user().get_overlapping_bodies()
#var areas = get_user().get_overlapping_areas()
## Exclusions
for body in bodies:
if !body.has_method("get_user"):
bodies.erase(body)
if body.has_method("get_user") and body.get_user().is_player():
bodies.erase(body)
#for area in areas:
# if area.has_method("get_user"):
# areas.erase(area)
## Collect Interactable Targets in Range
var interact_targets = []
for b in bodies:
if b.get_user().is_in_group("can_interact"):
interact_targets.append(b.get_user())
#for a in areas:
# if a.get_user().is_in_group("can_interact"):
# interact_targets.append(a.get_user())
## Find Nearest Interactable Target
if interact_targets:
interact_targets.sort_custom(FoeSorter.new(get_user().get_gpos()), "sort")
#get_user().set_target(interact_targets[0])
interact_targets[0].interact()
# Foe Finder System
class FoeSorter:
var point = null
func _init(new_point):
self.point = new_point
func sort(a, b):
return self.point.distance_to(a.get_gpos()) < self.point.distance_to(b.get_gpos())
### MOVEMENT ###
# Get Movement Key Input # Get Movement Key Input
func get_movement_input(): func get_movement_input():
@ -65,6 +113,8 @@ func movement_key_released(direction):
get_user().animate("Idle") get_user().animate("Idle")
get_user().set_internal_velocity(velocity_sum) get_user().set_internal_velocity(velocity_sum)
### PHYSICS PROCESS
# Physics Process # Physics Process
func _physics_process(_delta): func _physics_process(_delta):
## Keyboard Movement ## Keyboard Movement

@ -5,6 +5,8 @@ func get_body_node():
return $KinematicBody2D return $KinematicBody2D
func get_sprite_node(): func get_sprite_node():
return $KinematicBody2D/AnimatedSprite return $KinematicBody2D/AnimatedSprite
func is_player():
return true
## Parameters ## Parameters
func set_gpos(new_pos): func set_gpos(new_pos):
@ -13,6 +15,10 @@ func get_gpos():
return get_body_node().get_gpos() return get_body_node().get_gpos()
func set_internal_velocity(new_vel): func set_internal_velocity(new_vel):
get_body_node().set_internal_velocity(new_vel) get_body_node().set_internal_velocity(new_vel)
func get_overlapping_areas():
return get_body_node().get_overlapping_areas()
func get_overlapping_bodies():
return get_body_node().get_overlapping_bodies()
## Logic ## Logic
func animate(animation): func animate(animation):

@ -35,6 +35,10 @@ func get_internal_velocity():
if not get_can_move(): if not get_can_move():
return Vector2(0.0,0.0) return Vector2(0.0,0.0)
return internal_velocity return internal_velocity
func get_overlapping_areas():
return $PersonalSpace.get_overlapping_areas()
func get_overlapping_bodies():
return $PersonalSpace.get_overlapping_bodies()
func get_speed(): func get_speed():
if !get_can_move(): if !get_can_move():
return 0 return 0

@ -0,0 +1,10 @@
extends Node
func get_user():
return get_parent()
func is_player():
return false
func interact():
print_debug("HI")

@ -0,0 +1,7 @@
extends StaticBody2D
func get_user():
return get_parent()
func interact():
print_debug("HI")

@ -58,6 +58,11 @@ ui_down={
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":83,"unicode":0,"echo":false,"script":null) , Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":83,"unicode":0,"echo":false,"script":null)
] ]
} }
interact={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":69,"unicode":0,"echo":false,"script":null)
]
}
[rendering] [rendering]

Loading…
Cancel
Save