diff options
author | Daniel Weipert <git@mail.dweipert.de> | 2024-11-03 14:10:07 +0100 |
---|---|---|
committer | Daniel Weipert <git@mail.dweipert.de> | 2024-11-03 14:10:07 +0100 |
commit | 84365b6f901a9c0251a9f724a8d9f81a3787e97d (patch) | |
tree | 401e2bf99e6573d1d069f5044e7448067cdfb384 /Game/States | |
parent | a43499efa6c228cea3633f9661f3ff09127bd82d (diff) |
next commit
Diffstat (limited to 'Game/States')
-rw-r--r-- | Game/States/Build/BuilderElement.gd | 18 |
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 |