|
|
@ -17,6 +17,18 @@ func _ready() -> void: |
|
|
|
EntityManager.reset_world.connect(_on_reset_world) |
|
|
|
EntityManager.spawn_player.connect(_spawn_player) |
|
|
|
|
|
|
|
clear_world() |
|
|
|
create_world() |
|
|
|
|
|
|
|
|
|
|
|
func clear_world() -> void: |
|
|
|
for block: Block in blocks_container.get_children(): |
|
|
|
block.queue_free() |
|
|
|
|
|
|
|
for block: DroppedBlock in dropped_items_container.get_children(): |
|
|
|
block.queue_free() |
|
|
|
|
|
|
|
func create_world() -> void: |
|
|
|
_initialize_ground() |
|
|
|
_create_test_blocks() |
|
|
|
|
|
|
@ -70,8 +82,4 @@ func _initialize_ground() -> void: |
|
|
|
|
|
|
|
## Generally for resetting/emptying the world to allow for load_game |
|
|
|
func _on_reset_world() -> void: |
|
|
|
for block: Block in blocks_container.get_children(): |
|
|
|
block.queue_free() |
|
|
|
|
|
|
|
for block: DroppedBlock in dropped_items_container.get_children(): |
|
|
|
block.queue_free() |
|
|
|
clear_world() |