Browse Source

Creating a few functions

pull/14/head
Ryan Reed 1 month ago
parent
commit
a34eb5b2d9
1 changed files with 13 additions and 5 deletions
  1. +13
    -5
      scenes/world/world.gd

+ 13
- 5
scenes/world/world.gd View File

@ -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()

Loading…
Cancel
Save