chore: reorganize project structure
This commit is contained in:
parent
8983b84731
commit
8e0bcc51a3
14 changed files with 14 additions and 14 deletions
|
@ -1,27 +0,0 @@
|
|||
class_name DragonInstantiator
|
||||
|
||||
var _dragon_template: PackedScene
|
||||
var _positions: Array[Vector2i] = []
|
||||
|
||||
func _init(dragon: PackedScene, positions: Array[Node2D]) -> void:
|
||||
_dragon_template = dragon
|
||||
for pos in positions:
|
||||
_positions.push_back((Vector2i)(pos.position))
|
||||
|
||||
|
||||
func instantiate() -> Node:
|
||||
var position: Vector2i = _positions[0]
|
||||
return _instantiate_dragon(position)
|
||||
|
||||
|
||||
func _instantiate_dragon(relative_position: Vector2i) -> Node:
|
||||
var dragon: Window = _dragon_template.instantiate()
|
||||
|
||||
var window_position: Vector2i = DisplayServer.window_get_position()
|
||||
var window_size: Vector2i = DisplayServer.window_get_size()
|
||||
|
||||
dragon.position = window_position + relative_position - dragon.size / 2
|
||||
dragon.main_window_rect = Rect2i(window_position, window_size)
|
||||
dragon.show()
|
||||
|
||||
return dragon
|
Loading…
Add table
Add a link
Reference in a new issue