OutOfBody/Scripts/Exit.cs

15 lines
397 B
C#

using Godot;
using System;
public partial class Exit : StaticBody2D
{
// no variable, no nothing, just detects the player and tells the game that it should increment the level counter
private void _on_exit_area_area_entered(Area2D area)
{
if (area.IsInGroup("Player")) //if player is in exit
{
GetNode<OoB>("/root/OutofBody").Level = GetNode<OoB>("/root/OutofBody").Level + 1;
}
}
}