feat: properly scale instantiated dragons
This commit is contained in:
parent
a169e953c3
commit
09586aaa5e
5 changed files with 12 additions and 5 deletions
|
@ -2,6 +2,7 @@ extends Window
|
|||
class_name Dragon
|
||||
|
||||
@export var dragon_speed: float = 20.0
|
||||
@export var dragon: Node2D
|
||||
|
||||
@onready var _actual_position: Vector2 = position
|
||||
var main_window_rect: Rect2i
|
||||
|
@ -63,3 +64,8 @@ func _pick_random_screen_position() -> void:
|
|||
)
|
||||
|
||||
_target_pos = random_pos
|
||||
|
||||
|
||||
func set_scale(scale: float) -> void:
|
||||
size = Vector2i(size.x * scale, size.y * scale)
|
||||
dragon.scale = Vector2(scale, scale)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue