This commit is contained in:
2023-10-18 15:26:27 -04:00
parent 5dac6ced93
commit 0fa604298f
12 changed files with 114 additions and 79 deletions

10
scripts/v2/world.gd Normal file
View File

@ -0,0 +1,10 @@
extends Node
@export
var generator: WorldGenerator
@export
var map: TileMap
func _ready() -> void:
self.generator.generate(map)

View File

@ -0,0 +1,8 @@
class_name StandardWorldGenerator
extends WorldGenerator
@export
var parts: Array[PackedScene] = []
func _generate(map: TileMap) -> void:
pass

View File

@ -0,0 +1,9 @@
class_name WorldGenerator
extends Resource
func generate(map: TileMap) -> void:
if self.has_method("_generate"):
push_error("Generator missing `_generate` method")
return
self.call("_generate", map)