Skip to content

Commit 446b2be

Browse files
authored
Merge pull request #6 from fenath/improve-map
Improve map
2 parents 7e0f876 + bfcebdb commit 446b2be

File tree

16 files changed

+1034
-214
lines changed

16 files changed

+1034
-214
lines changed

prefabs/enemy.tscn

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
[gd_scene load_steps=23 format=3 uid="uid://cqndhocdt7dso"]
1+
[gd_scene load_steps=24 format=3 uid="uid://cqndhocdt7dso"]
22

33
[ext_resource type="Texture2D" uid="uid://dvotad0vy67hq" path="res://assets/Factions/Goblins/Troops/Torch/Red/Torch_Red.png" id="1_6jcrq"]
4+
[ext_resource type="Script" path="res://scripts/enemy.gd" id="1_jwbne"]
45

56
[sub_resource type="CircleShape2D" id="CircleShape2D_ge2oi"]
67
radius = 23.0217
@@ -104,7 +105,7 @@ animations = [{
104105
}],
105106
"loop": true,
106107
"name": &"attack",
107-
"speed": 5.0
108+
"speed": 10.0
108109
}, {
109110
"frames": [{
110111
"duration": 1.0,
@@ -130,7 +131,7 @@ animations = [{
130131
}],
131132
"loop": true,
132133
"name": &"idle",
133-
"speed": 5.0
134+
"speed": 10.0
134135
}, {
135136
"frames": [{
136137
"duration": 1.0,
@@ -153,14 +154,22 @@ animations = [{
153154
}],
154155
"loop": true,
155156
"name": &"run",
156-
"speed": 5.0
157+
"speed": 10.0
157158
}]
158159

159160
[node name="enemy" type="CharacterBody2D"]
161+
script = ExtResource("1_jwbne")
160162

161163
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
162164
shape = SubResource("CircleShape2D_ge2oi")
163165

164166
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
165167
sprite_frames = SubResource("SpriteFrames_dcaq6")
166168
animation = &"run"
169+
frame_progress = 0.176552
170+
171+
[node name="NavigationAgent" type="NavigationAgent2D" parent="."]
172+
path_desired_distance = 10.0
173+
path_postprocessing = 1
174+
avoidance_enabled = true
175+
debug_enabled = true

prefabs/tree.tscn

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
[gd_scene load_steps=13 format=3 uid="uid://bm5i5qwn085kf"]
2+
3+
[ext_resource type="Texture2D" uid="uid://dfhun0rxuho42" path="res://assets/Resources/Trees/Tree.png" id="1_ev32q"]
4+
[ext_resource type="Script" path="res://scripts/tree.gd" id="1_r4wqh"]
5+
[ext_resource type="Script" path="res://scripts/health_component.gd" id="3_536mh"]
6+
7+
[sub_resource type="AtlasTexture" id="AtlasTexture_aja1u"]
8+
atlas = ExtResource("1_ev32q")
9+
region = Rect2(0, 384, 192, 192)
10+
11+
[sub_resource type="AtlasTexture" id="AtlasTexture_4ret0"]
12+
atlas = ExtResource("1_ev32q")
13+
region = Rect2(0, 192, 192, 192)
14+
15+
[sub_resource type="AtlasTexture" id="AtlasTexture_n62uk"]
16+
atlas = ExtResource("1_ev32q")
17+
region = Rect2(192, 192, 192, 192)
18+
19+
[sub_resource type="AtlasTexture" id="AtlasTexture_aawt1"]
20+
atlas = ExtResource("1_ev32q")
21+
region = Rect2(192, 0, 192, 192)
22+
23+
[sub_resource type="AtlasTexture" id="AtlasTexture_480w5"]
24+
atlas = ExtResource("1_ev32q")
25+
region = Rect2(384, 0, 192, 192)
26+
27+
[sub_resource type="AtlasTexture" id="AtlasTexture_jo6ls"]
28+
atlas = ExtResource("1_ev32q")
29+
region = Rect2(576, 0, 192, 192)
30+
31+
[sub_resource type="AtlasTexture" id="AtlasTexture_0y7tt"]
32+
atlas = ExtResource("1_ev32q")
33+
region = Rect2(0, 0, 192, 192)
34+
35+
[sub_resource type="SpriteFrames" id="SpriteFrames_7dcf2"]
36+
animations = [{
37+
"frames": [{
38+
"duration": 1.0,
39+
"texture": SubResource("AtlasTexture_aja1u")
40+
}],
41+
"loop": false,
42+
"name": &"chopped",
43+
"speed": 5.0
44+
}, {
45+
"frames": [{
46+
"duration": 1.0,
47+
"texture": SubResource("AtlasTexture_4ret0")
48+
}, {
49+
"duration": 1.0,
50+
"texture": SubResource("AtlasTexture_n62uk")
51+
}],
52+
"loop": false,
53+
"name": &"hit",
54+
"speed": 10.0
55+
}, {
56+
"frames": [{
57+
"duration": 1.0,
58+
"texture": SubResource("AtlasTexture_aawt1")
59+
}, {
60+
"duration": 1.0,
61+
"texture": SubResource("AtlasTexture_480w5")
62+
}, {
63+
"duration": 1.0,
64+
"texture": SubResource("AtlasTexture_jo6ls")
65+
}, {
66+
"duration": 1.0,
67+
"texture": SubResource("AtlasTexture_0y7tt")
68+
}],
69+
"loop": true,
70+
"name": &"idle",
71+
"speed": 10.0
72+
}]
73+
74+
[sub_resource type="RectangleShape2D" id="RectangleShape2D_onxyc"]
75+
size = Vector2(25, 40)
76+
77+
[node name="Tree" type="StaticBody2D"]
78+
collision_mask = 3
79+
script = ExtResource("1_r4wqh")
80+
81+
[node name="Sprite" type="AnimatedSprite2D" parent="."]
82+
sprite_frames = SubResource("SpriteFrames_7dcf2")
83+
animation = &"chopped"
84+
85+
[node name="HealthComponent" type="Node2D" parent="."]
86+
script = ExtResource("3_536mh")
87+
88+
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
89+
position = Vector2(1.5, 54)
90+
shape = SubResource("RectangleShape2D_onxyc")

project.godot

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,24 @@ config/icon="res://icon-tower-guard.svg"
2020
resources=""
2121
player=""
2222

23+
[input]
24+
25+
attack={
26+
"deadzone": 0.5,
27+
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":90,"key_label":0,"unicode":122,"location":0,"echo":false,"script":null)
28+
]
29+
}
30+
interact={
31+
"deadzone": 0.5,
32+
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":88,"key_label":0,"unicode":120,"location":0,"echo":false,"script":null)
33+
]
34+
}
35+
eat={
36+
"deadzone": 0.5,
37+
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":67,"key_label":0,"unicode":99,"location":0,"echo":false,"script":null)
38+
]
39+
}
40+
2341
[rendering]
2442

2543
textures/canvas_textures/default_texture_filter=0
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[gd_scene load_steps=2 format=3 uid="uid://bbwglqm1aagrv"]
2+
3+
[ext_resource type="Script" path="res://scripts/health_component.gd" id="1_6r0q1"]
4+
5+
[node name="HealthComponent" type="Node2D"]
6+
script = ExtResource("1_6r0q1")

scenes/main.tscn

Lines changed: 8 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -1,117 +1,15 @@
1-
[gd_scene load_steps=35 format=3 uid="uid://djaltvt06unu0"]
1+
[gd_scene load_steps=20 format=3 uid="uid://djaltvt06unu0"]
22

33
[ext_resource type="PackedScene" uid="uid://bjhjupefmfgqs" path="res://scenes/tiles.tscn" id="1_d6p3j"]
4-
[ext_resource type="Script" path="res://scripts/character_body_2d.gd" id="2_v3nol"]
5-
[ext_resource type="Texture2D" uid="uid://deo0js5p0gxx7" path="res://assets/Factions/Knights/Troops/Warrior/Blue/Warrior_Blue.png" id="2_w4gtl"]
64
[ext_resource type="PackedScene" uid="uid://c7jm2yuaacdqh" path="res://scenes/hud.tscn" id="3_617g2"]
7-
[ext_resource type="Script" path="res://scripts/follow_camera.gd" id="4_tcs51"]
5+
[ext_resource type="PackedScene" uid="uid://7lsouk5v2cwt" path="res://scenes/player.tscn" id="3_el764"]
86
[ext_resource type="PackedScene" uid="uid://dsb8p4ysfqkdi" path="res://prefabs/meat.tscn" id="5_w7uh3"]
97
[ext_resource type="Script" path="res://scripts/gold_entity.gd" id="6_jgvlv"]
108
[ext_resource type="PackedScene" uid="uid://buky2dgx2kia3" path="res://prefabs/gold.tscn" id="6_mytpp"]
119
[ext_resource type="Texture2D" uid="uid://bunj2btgrwyu3" path="res://assets/Resources/Resources/G_Idle.png" id="7_52rrg"]
1210
[ext_resource type="PackedScene" uid="uid://br5nrp3rtcimi" path="res://prefabs/wood.tscn" id="7_m1s7h"]
1311
[ext_resource type="Texture2D" uid="uid://cco37rio8rbnf" path="res://assets/Resources/Resources/G_Spawn.png" id="8_xnn5u"]
14-
15-
[sub_resource type="AtlasTexture" id="AtlasTexture_q0c52"]
16-
atlas = ExtResource("2_w4gtl")
17-
region = Rect2(0, 0, 192, 192)
18-
19-
[sub_resource type="AtlasTexture" id="AtlasTexture_j6wva"]
20-
atlas = ExtResource("2_w4gtl")
21-
region = Rect2(192, 0, 192, 192)
22-
23-
[sub_resource type="AtlasTexture" id="AtlasTexture_jivnv"]
24-
atlas = ExtResource("2_w4gtl")
25-
region = Rect2(384, 0, 192, 192)
26-
27-
[sub_resource type="AtlasTexture" id="AtlasTexture_euptx"]
28-
atlas = ExtResource("2_w4gtl")
29-
region = Rect2(576, 0, 192, 192)
30-
31-
[sub_resource type="AtlasTexture" id="AtlasTexture_ndmye"]
32-
atlas = ExtResource("2_w4gtl")
33-
region = Rect2(768, 0, 192, 192)
34-
35-
[sub_resource type="AtlasTexture" id="AtlasTexture_g4vkm"]
36-
atlas = ExtResource("2_w4gtl")
37-
region = Rect2(960, 0, 192, 192)
38-
39-
[sub_resource type="AtlasTexture" id="AtlasTexture_rb4no"]
40-
atlas = ExtResource("2_w4gtl")
41-
region = Rect2(0, 192, 192, 192)
42-
43-
[sub_resource type="AtlasTexture" id="AtlasTexture_k54yu"]
44-
atlas = ExtResource("2_w4gtl")
45-
region = Rect2(192, 192, 192, 192)
46-
47-
[sub_resource type="AtlasTexture" id="AtlasTexture_rui1o"]
48-
atlas = ExtResource("2_w4gtl")
49-
region = Rect2(384, 192, 192, 192)
50-
51-
[sub_resource type="AtlasTexture" id="AtlasTexture_anl6s"]
52-
atlas = ExtResource("2_w4gtl")
53-
region = Rect2(576, 192, 192, 192)
54-
55-
[sub_resource type="AtlasTexture" id="AtlasTexture_t7npc"]
56-
atlas = ExtResource("2_w4gtl")
57-
region = Rect2(768, 192, 192, 192)
58-
59-
[sub_resource type="AtlasTexture" id="AtlasTexture_anj4k"]
60-
atlas = ExtResource("2_w4gtl")
61-
region = Rect2(960, 192, 192, 192)
62-
63-
[sub_resource type="SpriteFrames" id="SpriteFrames_lh52o"]
64-
animations = [{
65-
"frames": [{
66-
"duration": 1.0,
67-
"texture": SubResource("AtlasTexture_q0c52")
68-
}, {
69-
"duration": 1.0,
70-
"texture": SubResource("AtlasTexture_j6wva")
71-
}, {
72-
"duration": 1.0,
73-
"texture": SubResource("AtlasTexture_jivnv")
74-
}, {
75-
"duration": 1.0,
76-
"texture": SubResource("AtlasTexture_euptx")
77-
}, {
78-
"duration": 1.0,
79-
"texture": SubResource("AtlasTexture_ndmye")
80-
}, {
81-
"duration": 1.0,
82-
"texture": SubResource("AtlasTexture_g4vkm")
83-
}],
84-
"loop": true,
85-
"name": &"idle",
86-
"speed": 12.0
87-
}, {
88-
"frames": [{
89-
"duration": 1.0,
90-
"texture": SubResource("AtlasTexture_rb4no")
91-
}, {
92-
"duration": 1.0,
93-
"texture": SubResource("AtlasTexture_k54yu")
94-
}, {
95-
"duration": 1.0,
96-
"texture": SubResource("AtlasTexture_rui1o")
97-
}, {
98-
"duration": 1.0,
99-
"texture": SubResource("AtlasTexture_anl6s")
100-
}, {
101-
"duration": 1.0,
102-
"texture": SubResource("AtlasTexture_t7npc")
103-
}, {
104-
"duration": 1.0,
105-
"texture": SubResource("AtlasTexture_anj4k")
106-
}],
107-
"loop": true,
108-
"name": &"walking",
109-
"speed": 12.0
110-
}]
111-
112-
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_xesxe"]
113-
radius = 18.0
114-
height = 44.0
12+
[ext_resource type="PackedScene" uid="uid://bm5i5qwn085kf" path="res://prefabs/tree.tscn" id="12_53pmu"]
11513

11614
[sub_resource type="CircleShape2D" id="CircleShape2D_uk4ba"]
11715
radius = 25.0
@@ -182,34 +80,15 @@ animations = [{
18280
}]
18381

18482
[node name="main" type="Node2D"]
83+
y_sort_enabled = true
18584

18685
[node name="World" parent="." instance=ExtResource("1_d6p3j")]
18786

18887
[node name="CanvasLayer" type="CanvasLayer" parent="."]
18988

19089
[node name="Hud" parent="CanvasLayer" instance=ExtResource("3_617g2")]
19190

192-
[node name="player" type="Node2D" parent="."]
193-
position = Vector2(371, 465)
194-
195-
[node name="CharacterBody2D" type="CharacterBody2D" parent="player"]
196-
collision_mask = 3
197-
script = ExtResource("2_v3nol")
198-
199-
[node name="followCamera" type="Camera2D" parent="player/CharacterBody2D"]
200-
process_callback = 0
201-
limit_left = 0
202-
limit_top = 0
203-
limit_right = 2000
204-
script = ExtResource("4_tcs51")
205-
206-
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="player/CharacterBody2D"]
207-
sprite_frames = SubResource("SpriteFrames_lh52o")
208-
animation = &"idle"
209-
210-
[node name="CollisionShape2D" type="CollisionShape2D" parent="player/CharacterBody2D"]
211-
position = Vector2(0, 12)
212-
shape = SubResource("CapsuleShape2D_xesxe")
91+
[node name="player" parent="." instance=ExtResource("3_el764")]
21392

21493
[node name="resources" type="Node2D" parent="."]
21594

@@ -235,3 +114,6 @@ sprite_frames = SubResource("SpriteFrames_ouhmi")
235114
animation = &"spawn"
236115
frame = 6
237116
frame_progress = 1.0
117+
118+
[node name="Tree" parent="." instance=ExtResource("12_53pmu")]
119+
position = Vector2(969, 943)

0 commit comments

Comments
 (0)