summaryrefslogtreecommitdiff
path: root/Game/States/Build/BuilderElement.gd
diff options
context:
space:
mode:
Diffstat (limited to 'Game/States/Build/BuilderElement.gd')
-rw-r--r--Game/States/Build/BuilderElement.gd18
1 files changed, 11 insertions, 7 deletions
diff --git a/Game/States/Build/BuilderElement.gd b/Game/States/Build/BuilderElement.gd
index 8c98bdc..cc9c051 100644
--- a/Game/States/Build/BuilderElement.gd
+++ b/Game/States/Build/BuilderElement.gd
@@ -15,13 +15,17 @@ var collision_areas: Array[Area2D] = []
func _ready():
instance = element.instantiate()
- var element_sprite: Sprite2D = instance.get_node("Sprite2D")
- $Sprite2D.texture = element_sprite.texture
- $Sprite2D.region_enabled = element_sprite.region_enabled
- $Sprite2D.region_rect = element_sprite.region_rect
- $Sprite2D.scale = element_sprite.scale
- $Sprite2D.position = element_sprite.position
- $Sprite2D.scale = instance.scale
+ var element_sprite: AnimatedSprite2D = instance.get_node("AnimatedSprite2D").duplicate()
+ element_sprite.scale *= instance.scale
+ element_sprite.position *= instance.scale
+ add_child(element_sprite)
+ element_sprite.play()
+ #$Sprite2D.texture = element_sprite.sprite_frames.get_frame_texture("default", 0)
+ #$Sprite2D.region_enabled = element_sprite.region_enabled
+ #$Sprite2D.region_rect = element_sprite.region_rect
+ #$Sprite2D.scale = element_sprite.scale
+ #$Sprite2D.position = element_sprite.position
+ #$Sprite2D.scale = instance.scale
var element_collision_shape = instance.get_node("CollisionShape2D").duplicate() as CollisionShape2D
collision_shape = element_collision_shape.shape