Set spawn points

This commit is contained in:
2023-09-02 20:59:00 -07:00
parent 736060d6ca
commit 9b5a94bfab
12 changed files with 225 additions and 13 deletions

View File

@@ -1,11 +1,15 @@
using Godot;
public partial class Level1 : Node3D
public partial class AreaExit : Node3D
{
[Export]
private int _levelIndex;
private void OnExitEntered(Node3D node)
{
GD.Print("Exit reached");
var main = GetTree().Root.GetNode<Main>("/root/Main");
main.LoadNextLevel(0);
main.LoadNextLevel(_levelIndex);
}
}

5
Scripts/Level2.cs Normal file
View File

@@ -0,0 +1,5 @@
using Godot;
public partial class Level2 : Node3D
{
}

11
Scripts/SpawnPoint.cs Normal file
View File

@@ -0,0 +1,11 @@
using Godot;
public partial class SpawnPoint : Marker3D
{
// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
var player = GetTree().GetFirstNodeInGroup("Player") as TestCharacter;
player.Position = Position;
}
}