TestGame/src/level_manager.gd

23 lines
635 B
GDScript3
Raw Normal View History

2024-12-27 21:00:07 +01:00
extends Node
signal scene_transition
var CURRENT_LEVEL: Node3D = null
var CURRENT_PLAYER: CharacterBody3D = null
func _ready() -> void:
var lvl = load("res://assets/levels/level1.tscn")
var player = load("res://assets/characters/player.tscn")
CURRENT_LEVEL = lvl.instantiate()
CURRENT_PLAYER = player.instantiate()
CURRENT_PLAYER.transform.origin = Vector3(0, 1, 0)
add_child(CURRENT_LEVEL)
CURRENT_LEVEL.add_child(CURRENT_PLAYER)
#CURRENT_LEVEL.remove_child()
func _process(delta: float) -> void:
if (CURRENT_PLAYER.global_position.y) < -5:
CURRENT_PLAYER.translate(Vector3.UP*10)
# TODO: blah blah