added modular animation system for drones

This commit is contained in:
2026-02-24 10:49:50 +01:00
parent 772858f04f
commit d036169237
23 changed files with 268 additions and 119 deletions

View File

@@ -1,7 +1,7 @@
extends Drone
func _ready() -> void:
self_body = self
pass
func primary_action() -> float:
return -1

View File

@@ -190,7 +190,7 @@ animations = [{
}],
"loop": true,
"name": &"base_head_idle_front",
"speed": 4.0
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
@@ -226,12 +226,8 @@ animations = [{
[node name="BaseDrone" unique_id=872770085 instance=ExtResource("1_j7lnw")]
script = ExtResource("2_njeil")
dodge_cd = null
model_name = &"Base"
carry_capacity = null
hit_points = null
fuel_tank_capacity = null
movement_speed = 5.0
movement_speed = 150.0
[node name="Brain" parent="." index="0" unique_id=1086286463]
position = Vector2(-4.7683716e-07, -0.9999995)
@@ -261,4 +257,6 @@ position = Vector2(-2.842171e-14, -5.9604645e-08)
scale = Vector2(0.6875, 0.6875)
sprite_frames = SubResource("SpriteFrames_wbero")
animation = &"base_head_idle_front"
frame_progress = 0.7447344
[node name="Camera2D" parent="." index="6" unique_id=2079743221]
zoom = Vector2(5, 5)

View File

@@ -7,6 +7,7 @@ size = Vector2(10, 8)
[node name="Drone" type="CharacterBody2D" unique_id=19986915]
texture_filter = 1
collision_layer = 3
[node name="Brain" type="AnimatedSprite2D" parent="." unique_id=1086286463]
sprite_frames = SubResource("SpriteFrames_bsvqd")
@@ -25,3 +26,7 @@ sprite_frames = SubResource("SpriteFrames_bsvqd")
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1475205819]
shape = SubResource("RectangleShape2D_6pa52")
[node name="Camera2D" type="Camera2D" parent="." unique_id=2079743221]
[node name="DodgeDurationTimer" type="Timer" parent="." unique_id=656287999]