basic ECS spawner
This commit is contained in:
24
maps/world.gd
Normal file
24
maps/world.gd
Normal file
@@ -0,0 +1,24 @@
|
||||
extends Node3D
|
||||
|
||||
@onready var world: World = $World
|
||||
|
||||
@onready var spawn_point: E_SpawnPoint = $SpawnPoint
|
||||
@onready var spawn_point_2: E_SpawnPoint = $SpawnPoint2
|
||||
|
||||
func _ready():
|
||||
ECS.world = world
|
||||
|
||||
#var player_scene = preload("res://GECS/entities/BasicEnemy/BasicEnemy.tscn") # Adjust path as needed
|
||||
#var basic_enemy = player_scene.instantiate() as BasicEnemy
|
||||
#
|
||||
#add_child(basic_enemy) # Add to scene tree
|
||||
ECS.world.add_entity(spawn_point)
|
||||
ECS.world.add_entity(spawn_point_2)
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if ECS.world:
|
||||
ECS.process(delta, "gameplay")
|
||||
|
||||
func _physics_process(delta):
|
||||
if ECS.world:
|
||||
ECS.process(delta, "physics")
|
||||
Reference in New Issue
Block a user