Version 0.1 - 0.3.1
Added the World Added Mobs, and spawning those mobs at runtime Added simple camera movement Added simple UI/HUD
This commit is contained in:
23
scenes/spawner/advanced_spwaner.gd
Normal file
23
scenes/spawner/advanced_spwaner.gd
Normal file
@@ -0,0 +1,23 @@
|
||||
extends Node
|
||||
|
||||
@export var scenes: Array[PackedScene]
|
||||
|
||||
# Spawn the corresponding Entity at position
|
||||
func spawn_entity(index, position):
|
||||
var entity = scenes[index].instantiate()
|
||||
|
||||
if entity is Node2D:
|
||||
entity.position = position
|
||||
|
||||
add_child(entity)
|
||||
|
||||
return entity
|
||||
|
||||
|
||||
|
||||
|
||||
func spawn_fly(position):
|
||||
return spawn_entity(0, position)
|
||||
|
||||
func spawn_bee(position):
|
||||
return spawn_entity(1, position)
|
||||
Reference in New Issue
Block a user