Skip to content

Commit a4591aa

Browse files
authored
Merge pull request #7 from fenath/feat/animations
Feat/animations
2 parents 446b2be + 632da32 commit a4591aa

40 files changed

+845
-76
lines changed

export_presets.cfg

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
[preset.0]
2+
3+
name="Windows Desktop"
4+
platform="Windows Desktop"
5+
runnable=true
6+
advanced_options=false
7+
dedicated_server=false
8+
custom_features=""
9+
export_filter="all_resources"
10+
include_filter=""
11+
exclude_filter=""
12+
export_path=""
13+
encryption_include_filters=""
14+
encryption_exclude_filters=""
15+
encrypt_pck=false
16+
encrypt_directory=false
17+
script_export_mode=2
18+
19+
[preset.0.options]
20+
21+
custom_template/debug=""
22+
custom_template/release=""
23+
debug/export_console_wrapper=1
24+
binary_format/embed_pck=false
25+
texture_format/s3tc_bptc=true
26+
texture_format/etc2_astc=false
27+
binary_format/architecture="x86_64"
28+
codesign/enable=false
29+
codesign/timestamp=true
30+
codesign/timestamp_server_url=""
31+
codesign/digest_algorithm=1
32+
codesign/description=""
33+
codesign/custom_options=PackedStringArray()
34+
application/modify_resources=true
35+
application/icon=""
36+
application/console_wrapper_icon=""
37+
application/icon_interpolation=4
38+
application/file_version=""
39+
application/product_version=""
40+
application/company_name=""
41+
application/product_name=""
42+
application/file_description=""
43+
application/copyright=""
44+
application/trademarks=""
45+
application/export_angle=0
46+
application/export_d3d12=0
47+
application/d3d12_agility_sdk_multiarch=true
48+
ssh_remote_deploy/enabled=false
49+
ssh_remote_deploy/host="user@host_ip"
50+
ssh_remote_deploy/port="22"
51+
ssh_remote_deploy/extra_args_ssh=""
52+
ssh_remote_deploy/extra_args_scp=""
53+
ssh_remote_deploy/run_script="Expand-Archive -LiteralPath '{temp_dir}\\{archive_name}' -DestinationPath '{temp_dir}'
54+
$action = New-ScheduledTaskAction -Execute '{temp_dir}\\{exe_name}' -Argument '{cmd_args}'
55+
$trigger = New-ScheduledTaskTrigger -Once -At 00:00
56+
$settings = New-ScheduledTaskSettingsSet
57+
$task = New-ScheduledTask -Action $action -Trigger $trigger -Settings $settings
58+
Register-ScheduledTask godot_remote_debug -InputObject $task -Force:$true
59+
Start-ScheduledTask -TaskName godot_remote_debug
60+
while (Get-ScheduledTask -TaskName godot_remote_debug | ? State -eq running) { Start-Sleep -Milliseconds 100 }
61+
Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue"
62+
ssh_remote_deploy/cleanup_script="Stop-ScheduledTask -TaskName godot_remote_debug -ErrorAction:SilentlyContinue
63+
Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue
64+
Remove-Item -Recurse -Force '{temp_dir}'"

prefabs/effects/hit_animation.tscn

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
[gd_scene load_steps=4 format=3 uid="uid://cboi10dwwujxm"]
2+
3+
[sub_resource type="Animation" id="Animation_sxcau"]
4+
length = 0.001
5+
tracks/0/type = "value"
6+
tracks/0/imported = false
7+
tracks/0/enabled = true
8+
tracks/0/path = NodePath("Sprite:modulate")
9+
tracks/0/interp = 1
10+
tracks/0/loop_wrap = true
11+
tracks/0/keys = {
12+
"times": PackedFloat32Array(0),
13+
"transitions": PackedFloat32Array(1),
14+
"update": 0,
15+
"values": [Color(1, 1, 1, 1)]
16+
}
17+
18+
[sub_resource type="Animation" id="Animation_g83i5"]
19+
resource_name = "hit"
20+
length = 0.2
21+
tracks/0/type = "value"
22+
tracks/0/imported = false
23+
tracks/0/enabled = true
24+
tracks/0/path = NodePath("Sprite:modulate")
25+
tracks/0/interp = 1
26+
tracks/0/loop_wrap = true
27+
tracks/0/keys = {
28+
"times": PackedFloat32Array(0, 0.2),
29+
"transitions": PackedFloat32Array(1, 1),
30+
"update": 0,
31+
"values": [Color(0.677533, 0, 0.253646, 1), Color(1, 1, 1, 1)]
32+
}
33+
34+
[sub_resource type="AnimationLibrary" id="AnimationLibrary_tgvdp"]
35+
_data = {
36+
"RESET": SubResource("Animation_sxcau"),
37+
"hit": SubResource("Animation_g83i5")
38+
}
39+
40+
[node name="HitAnimation" type="AnimationPlayer"]
41+
libraries = {
42+
"": SubResource("AnimationLibrary_tgvdp")
43+
}

prefabs/meat.tscn

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ animations = [{
6464
"duration": 1.0,
6565
"texture": SubResource("AtlasTexture_kqexr")
6666
}],
67-
"loop": true,
67+
"loop": false,
6868
"name": &"spawn",
69-
"speed": 5.0
69+
"speed": 10.0
7070
}]
7171

7272
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_u7buq"]
@@ -79,7 +79,7 @@ script = ExtResource("1_fspv4")
7979

8080
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
8181
sprite_frames = SubResource("SpriteFrames_nekuw")
82-
animation = &"idle"
82+
animation = &"spawn"
8383

8484
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
8585
position = Vector2(2, 14)

prefabs/sheep.tscn

Lines changed: 186 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
[gd_scene load_steps=31 format=3 uid="uid://bou6rky8jvdmr"]
2+
3+
[ext_resource type="Texture2D" uid="uid://b5s8lkrg0j0j1" path="res://assets/Resources/Sheep/HappySheep_Idle.png" id="1_lgovn"]
4+
[ext_resource type="Script" path="res://scripts/sheep.gd" id="1_qs77e"]
5+
[ext_resource type="PackedScene" uid="uid://io7jjehpxqir" path="res://scenes/components/hitbox_component.tscn" id="2_oxvx7"]
6+
[ext_resource type="Script" path="res://scripts/health_component.gd" id="2_ycipw"]
7+
[ext_resource type="Texture2D" uid="uid://cpaof3cgh5w80" path="res://assets/Resources/Sheep/HappySheep_Bouncing.png" id="3_1upnk"]
8+
[ext_resource type="PackedScene" uid="uid://bu2pk8tju85xu" path="res://scenes/health_bar.tscn" id="4_krxru"]
9+
[ext_resource type="PackedScene" uid="uid://dvle86etxch48" path="res://scenes/components/knockback_component.tscn" id="5_qflnu"]
10+
[ext_resource type="PackedScene" uid="uid://cboi10dwwujxm" path="res://prefabs/effects/hit_animation.tscn" id="6_tfhpn"]
11+
[ext_resource type="Script" path="res://scripts/drop_items.gd" id="7_3b5mt"]
12+
[ext_resource type="PackedScene" uid="uid://dsb8p4ysfqkdi" path="res://prefabs/meat.tscn" id="8_pxsnm"]
13+
[ext_resource type="Script" path="res://scripts/state_machine.gd" id="9_ya02d"]
14+
[ext_resource type="Script" path="res://scripts/idle.gd" id="10_liamn"]
15+
[ext_resource type="Script" path="res://scripts/escape.gd" id="12_rqfsc"]
16+
17+
[sub_resource type="AtlasTexture" id="AtlasTexture_xy5yh"]
18+
atlas = ExtResource("1_lgovn")
19+
region = Rect2(0, 0, 128, 128)
20+
21+
[sub_resource type="AtlasTexture" id="AtlasTexture_30g1r"]
22+
atlas = ExtResource("1_lgovn")
23+
region = Rect2(128, 0, 128, 128)
24+
25+
[sub_resource type="AtlasTexture" id="AtlasTexture_f8ctw"]
26+
atlas = ExtResource("1_lgovn")
27+
region = Rect2(256, 0, 128, 128)
28+
29+
[sub_resource type="AtlasTexture" id="AtlasTexture_ml2t2"]
30+
atlas = ExtResource("1_lgovn")
31+
region = Rect2(384, 0, 128, 128)
32+
33+
[sub_resource type="AtlasTexture" id="AtlasTexture_xj7wv"]
34+
atlas = ExtResource("1_lgovn")
35+
region = Rect2(512, 0, 128, 128)
36+
37+
[sub_resource type="AtlasTexture" id="AtlasTexture_gm8by"]
38+
atlas = ExtResource("1_lgovn")
39+
region = Rect2(640, 0, 128, 128)
40+
41+
[sub_resource type="AtlasTexture" id="AtlasTexture_6n2fs"]
42+
atlas = ExtResource("1_lgovn")
43+
region = Rect2(768, 0, 128, 128)
44+
45+
[sub_resource type="AtlasTexture" id="AtlasTexture_mm1e4"]
46+
atlas = ExtResource("1_lgovn")
47+
region = Rect2(896, 0, 128, 128)
48+
49+
[sub_resource type="AtlasTexture" id="AtlasTexture_3ik0p"]
50+
atlas = ExtResource("3_1upnk")
51+
region = Rect2(0, 0, 128, 128)
52+
53+
[sub_resource type="AtlasTexture" id="AtlasTexture_g164v"]
54+
atlas = ExtResource("3_1upnk")
55+
region = Rect2(128, 0, 128, 128)
56+
57+
[sub_resource type="AtlasTexture" id="AtlasTexture_7h4s2"]
58+
atlas = ExtResource("3_1upnk")
59+
region = Rect2(256, 0, 128, 128)
60+
61+
[sub_resource type="AtlasTexture" id="AtlasTexture_5eihk"]
62+
atlas = ExtResource("3_1upnk")
63+
region = Rect2(384, 0, 128, 128)
64+
65+
[sub_resource type="AtlasTexture" id="AtlasTexture_6f568"]
66+
atlas = ExtResource("3_1upnk")
67+
region = Rect2(512, 0, 128, 128)
68+
69+
[sub_resource type="AtlasTexture" id="AtlasTexture_nplwa"]
70+
atlas = ExtResource("3_1upnk")
71+
region = Rect2(640, 0, 128, 128)
72+
73+
[sub_resource type="SpriteFrames" id="SpriteFrames_uweta"]
74+
animations = [{
75+
"frames": [{
76+
"duration": 1.0,
77+
"texture": SubResource("AtlasTexture_xy5yh")
78+
}, {
79+
"duration": 1.0,
80+
"texture": SubResource("AtlasTexture_30g1r")
81+
}, {
82+
"duration": 1.0,
83+
"texture": SubResource("AtlasTexture_f8ctw")
84+
}, {
85+
"duration": 1.0,
86+
"texture": SubResource("AtlasTexture_ml2t2")
87+
}, {
88+
"duration": 1.0,
89+
"texture": SubResource("AtlasTexture_xj7wv")
90+
}, {
91+
"duration": 1.0,
92+
"texture": SubResource("AtlasTexture_gm8by")
93+
}, {
94+
"duration": 1.0,
95+
"texture": SubResource("AtlasTexture_6n2fs")
96+
}, {
97+
"duration": 1.0,
98+
"texture": SubResource("AtlasTexture_mm1e4")
99+
}],
100+
"loop": true,
101+
"name": &"idle",
102+
"speed": 10.0
103+
}, {
104+
"frames": [{
105+
"duration": 1.0,
106+
"texture": SubResource("AtlasTexture_3ik0p")
107+
}, {
108+
"duration": 1.0,
109+
"texture": SubResource("AtlasTexture_g164v")
110+
}, {
111+
"duration": 1.0,
112+
"texture": SubResource("AtlasTexture_7h4s2")
113+
}, {
114+
"duration": 1.0,
115+
"texture": SubResource("AtlasTexture_5eihk")
116+
}, {
117+
"duration": 1.0,
118+
"texture": SubResource("AtlasTexture_6f568")
119+
}, {
120+
"duration": 1.0,
121+
"texture": SubResource("AtlasTexture_nplwa")
122+
}],
123+
"loop": true,
124+
"name": &"walk",
125+
"speed": 10.0
126+
}]
127+
128+
[sub_resource type="CircleShape2D" id="CircleShape2D_byhft"]
129+
radius = 19.0
130+
131+
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_fq8fe"]
132+
radius = 8.0
133+
height = 34.0
134+
135+
[node name="Sheep" type="CharacterBody2D"]
136+
script = ExtResource("1_qs77e")
137+
138+
[node name="Sprite" type="AnimatedSprite2D" parent="."]
139+
sprite_frames = SubResource("SpriteFrames_uweta")
140+
animation = &"walk"
141+
142+
[node name="HitboxComponent" parent="." node_paths=PackedStringArray("health_component") instance=ExtResource("2_oxvx7")]
143+
health_component = NodePath("../HealthComponent")
144+
145+
[node name="CollisionShape2D" type="CollisionShape2D" parent="HitboxComponent"]
146+
shape = SubResource("CircleShape2D_byhft")
147+
148+
[node name="KnockbackComponent" parent="." node_paths=PackedStringArray("hitbox", "body") instance=ExtResource("5_qflnu")]
149+
hitbox = NodePath("../HitboxComponent")
150+
body = NodePath("..")
151+
152+
[node name="HealthComponent" type="Node2D" parent="."]
153+
script = ExtResource("2_ycipw")
154+
MAX_HEALTH = 5
155+
156+
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
157+
position = Vector2(0, 8)
158+
rotation = 1.5708
159+
shape = SubResource("CapsuleShape2D_fq8fe")
160+
161+
[node name="HealthBar" parent="." node_paths=PackedStringArray("health_component") instance=ExtResource("4_krxru")]
162+
offset_left = -22.0
163+
offset_top = -26.0
164+
offset_right = 28.0
165+
offset_bottom = -20.0
166+
health_component = NodePath("../HealthComponent")
167+
168+
[node name="HitAnimation" parent="." instance=ExtResource("6_tfhpn")]
169+
170+
[node name="DropItems" type="Node2D" parent="."]
171+
script = ExtResource("7_3b5mt")
172+
MIN_DROP = 1
173+
MAX_DROP = 4
174+
item = ExtResource("8_pxsnm")
175+
176+
[node name="StateMachine" type="Node2D" parent="." node_paths=PackedStringArray("initial_state")]
177+
script = ExtResource("9_ya02d")
178+
initial_state = NodePath("Idle")
179+
180+
[node name="Idle" type="Node2D" parent="StateMachine" node_paths=PackedStringArray("character")]
181+
script = ExtResource("10_liamn")
182+
character = NodePath("../..")
183+
184+
[node name="Escape" type="Node2D" parent="StateMachine" node_paths=PackedStringArray("character")]
185+
script = ExtResource("12_rqfsc")
186+
character = NodePath("../..")

prefabs/tree.tscn

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
[gd_scene load_steps=13 format=3 uid="uid://bm5i5qwn085kf"]
1+
[gd_scene load_steps=16 format=3 uid="uid://bm5i5qwn085kf"]
22

33
[ext_resource type="Texture2D" uid="uid://dfhun0rxuho42" path="res://assets/Resources/Trees/Tree.png" id="1_ev32q"]
44
[ext_resource type="Script" path="res://scripts/tree.gd" id="1_r4wqh"]
55
[ext_resource type="Script" path="res://scripts/health_component.gd" id="3_536mh"]
6+
[ext_resource type="PackedScene" uid="uid://cboi10dwwujxm" path="res://prefabs/effects/hit_animation.tscn" id="4_qtakn"]
7+
[ext_resource type="Script" path="res://scripts/hitbox_component.gd" id="4_vpb1d"]
68

79
[sub_resource type="AtlasTexture" id="AtlasTexture_aja1u"]
810
atlas = ExtResource("1_ev32q")
@@ -74,17 +76,30 @@ animations = [{
7476
[sub_resource type="RectangleShape2D" id="RectangleShape2D_onxyc"]
7577
size = Vector2(25, 40)
7678

79+
[sub_resource type="RectangleShape2D" id="RectangleShape2D_pkd5u"]
80+
size = Vector2(51, 124)
81+
7782
[node name="Tree" type="StaticBody2D"]
7883
collision_mask = 3
7984
script = ExtResource("1_r4wqh")
8085

8186
[node name="Sprite" type="AnimatedSprite2D" parent="."]
8287
sprite_frames = SubResource("SpriteFrames_7dcf2")
83-
animation = &"chopped"
88+
animation = &"idle"
8489

8590
[node name="HealthComponent" type="Node2D" parent="."]
8691
script = ExtResource("3_536mh")
8792

8893
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
8994
position = Vector2(1.5, 54)
9095
shape = SubResource("RectangleShape2D_onxyc")
96+
97+
[node name="HitboxComponent" type="Area2D" parent="." node_paths=PackedStringArray("health_component")]
98+
script = ExtResource("4_vpb1d")
99+
health_component = NodePath("../HealthComponent")
100+
101+
[node name="CollisionShape2D" type="CollisionShape2D" parent="HitboxComponent"]
102+
position = Vector2(0.5, 12)
103+
shape = SubResource("RectangleShape2D_pkd5u")
104+
105+
[node name="HitAnimation" parent="." instance=ExtResource("4_qtakn")]

prefabs/wood.tscn

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
[gd_scene load_steps=13 format=3 uid="uid://br5nrp3rtcimi"]
1+
[gd_scene load_steps=14 format=3 uid="uid://br5nrp3rtcimi"]
22

33
[ext_resource type="Script" path="res://scripts/wood.gd" id="1_mtbca"]
44
[ext_resource type="Texture2D" uid="uid://c8rwasm7d80ln" path="res://assets/Resources/Resources/W_Idle.png" id="1_wxc25"]
55
[ext_resource type="Texture2D" uid="uid://dmsxrf8m5q8ke" path="res://assets/Resources/Resources/W_Spawn.png" id="2_jxmfh"]
6+
[ext_resource type="Script" path="res://scripts/resources/dropping.gd" id="4_blvom"]
67

78
[sub_resource type="AtlasTexture" id="AtlasTexture_o2s5j"]
89
atlas = ExtResource("2_jxmfh")
@@ -64,9 +65,9 @@ animations = [{
6465
"duration": 1.0,
6566
"texture": SubResource("AtlasTexture_gm882")
6667
}],
67-
"loop": true,
68+
"loop": false,
6869
"name": &"spawn",
69-
"speed": 5.0
70+
"speed": 10.0
7071
}]
7172

7273
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_8awwb"]
@@ -79,9 +80,14 @@ script = ExtResource("1_mtbca")
7980

8081
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
8182
sprite_frames = SubResource("SpriteFrames_qsr5p")
82-
animation = &"idle"
83+
animation = &"spawn"
84+
frame = 6
85+
frame_progress = 1.0
8386

8487
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
8588
position = Vector2(0, 23)
8689
rotation = 1.24615
8790
shape = SubResource("CapsuleShape2D_8awwb")
91+
92+
[node name="Dropping" type="Node2D" parent="."]
93+
script = ExtResource("4_blvom")

0 commit comments

Comments
 (0)