Parallax beams

This commit is contained in:
MaddoScientisto 2025-03-12 18:46:17 +01:00
commit 208ce8c533
9 changed files with 465 additions and 243 deletions

View file

@ -16,5 +16,10 @@ public partial class PlayerStateMachine : StateMachineBase<PlayerState, Characte
{
GD.Print("Refilling shield");
}
public void NoClip()
{
GD.Print("NoClip");
}
}

View file

@ -55,6 +55,9 @@ public partial class GameManager : Node2D
public delegate void PlayerRespawnedEventHandler();
public Vector2 LastCheckpointPosition { get; set; }
[Export]
public Node2D PlayerParentNode { get; set; }
// Called when the node enters the scene tree for the first time.
public override void _Ready()
@ -165,8 +168,18 @@ public partial class GameManager : Node2D
_player = PlayerTemplate.Instantiate<PlayerFSMProxy>();
//this.CallDeferred("add_child", _player);
this.AddChild(_player);
_player.Owner = this;
if (PlayerParentNode is not null)
{
PlayerParentNode.AddChild(_player);
_player.Owner = PlayerParentNode;
}
else
{
this.AddChild(_player);
_player.Owner = this;
}
_player.Transform = this.GlobalTransform;