Fixed merge errors
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
using Godot;
|
||||
using System;
|
||||
|
||||
// Designed by Jojackman1
|
||||
|
||||
public partial class LevelManager : Node
|
||||
{
|
||||
Node2D StartNode;
|
||||
@@ -12,6 +10,8 @@ public partial class LevelManager : Node
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
GetTree().Root.GetNode<CommonData>("CommonData").CurrentHealth = GetTree().Root.GetNode<CommonData>("CommonData").MaxHealth;
|
||||
|
||||
StartNode = GetParent().GetNode<Node2D>("StartNode");
|
||||
EndNode = GetParent().GetNode<Node2D>("EndNode");
|
||||
Player = GetParent().GetNode<Node2D>("Player");
|
||||
@@ -30,7 +30,7 @@ public partial class LevelManager : Node
|
||||
if (EndType == "nothing")
|
||||
{
|
||||
// Death
|
||||
if ()
|
||||
if (GetTree().Root.GetNode<CommonData>("CommonData").CurrentHealth <= 0)
|
||||
{
|
||||
EndManager("Death");
|
||||
EndType = "Death";
|
||||
@@ -48,9 +48,25 @@ public partial class LevelManager : Node
|
||||
{
|
||||
switch (EndType)
|
||||
{
|
||||
case "Death": // Player Dies
|
||||
case "Death": // Player Died
|
||||
//Player.QueueFree();
|
||||
// Go back to main menu (Replace with proper ending screen and then send back to main menu)
|
||||
GetNode<ChangeMenuInitiator>("ChangeMenuInitiator").ChangeMenu("FAST", "MainMenu", GetParent());
|
||||
break;
|
||||
case "Success": // Successfully make it to the end of the levels
|
||||
case "Success": // Success
|
||||
// Remove the player to stop checking
|
||||
//Player.QueueFree();
|
||||
// Add level completed to the hash set
|
||||
GetTree().Root.GetNode<CommonData>("CommonData").LevelsCompleted.Add(GetParent().Name);
|
||||
// Play exit animation
|
||||
GetParent().GetNode("ScreenAnimations").GetNode("LevelCompleteAssets").GetNode<AnimationPlayer>("LevelComplete").CurrentAnimation = "default";
|
||||
GetParent().GetNode("ScreenAnimations").GetNode<Node2D>("LevelCompleteAssets").Reparent(GetTree().Root.GetNode("Camera").GetNode("Camera2D"));
|
||||
GetTree().Root.GetNode("Camera").GetNode("Camera2D").GetNode<Node2D>("LevelCompleteAssets").GlobalPosition = GetTree().Root.GetNode("Camera").GetNode<Node2D>("Camera2D").GlobalPosition;
|
||||
GetTree().Root.GetNode("Camera").GetNode("Camera2D").GetNode<Node2D>("LevelCompleteAssets").Visible = true;
|
||||
// Go to exit cutscene after exit animation is complete
|
||||
var LevelName = (string)GetParent().Name;
|
||||
var LevelNumber = LevelName.Split("Level");
|
||||
GetNode<ChangeMenuInitiator>("ChangeMenuInitiator").ChangeMenu("SLOW", $"Cutscenes/ExitCutscene{LevelNumber[0]}", GetParent());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user