OutOfBody/Scripts/Exit.cs

15 lines
397 B
C#
Raw Normal View History

2024-01-02 20:10:53 -05:00
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;
}
}
}