mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-11 00:05:54 +00:00
Changed player to new one
This commit is contained in:
parent
60ab375572
commit
1c1436a539
27 changed files with 323 additions and 87 deletions
|
|
@ -3,6 +3,7 @@ using System;
|
|||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Cirno.Scripts;
|
||||
using Cirno.Scripts.Components.FSM;
|
||||
using Cirno.Scripts.Resources;
|
||||
using Godot.Collections;
|
||||
using Cirno.Scripts.Utils;
|
||||
|
|
@ -12,11 +13,11 @@ public partial class GameManager : Node2D
|
|||
public static GameManager Instance { get; private set; }
|
||||
private Hud _hud;
|
||||
|
||||
private PlayerMovement _player;
|
||||
private PlayerStateMachine _player;
|
||||
|
||||
public GameState GameState { get; private set; }
|
||||
|
||||
public PlayerMovement Player => _player;
|
||||
public PlayerStateMachine Player => _player;
|
||||
|
||||
private Node2D _cameraTarget;
|
||||
|
||||
|
|
@ -132,17 +133,17 @@ public partial class GameManager : Node2D
|
|||
|
||||
if (_player != null && _hud != null)
|
||||
{
|
||||
_player.HealthChanged += (newHealth, maxHealth) => _hud.UpdateHealth(newHealth, maxHealth);
|
||||
|
||||
_player.ShieldChanged += (newShield, maxShield) => _hud.UpdateShield(newShield, maxShield);
|
||||
|
||||
_player.InteractableAreaEntered += (interactable) => _hud.UpdateInteractable(interactable);
|
||||
|
||||
_player.Death += () =>
|
||||
{
|
||||
// Show Game Over
|
||||
_hud.ShowGameOver();
|
||||
};
|
||||
// _player.HealthChanged += (newHealth, maxHealth) => _hud.UpdateHealth(newHealth, maxHealth);
|
||||
//
|
||||
// _player.ShieldChanged += (newShield, maxShield) => _hud.UpdateShield(newShield, maxShield);
|
||||
//
|
||||
// _player.InteractableAreaEntered += (interactable) => _hud.UpdateInteractable(interactable);
|
||||
//
|
||||
// _player.Death += () =>
|
||||
// {
|
||||
// // Show Game Over
|
||||
// _hud.ShowGameOver();
|
||||
// };
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -159,7 +160,7 @@ public partial class GameManager : Node2D
|
|||
if (_player != null) return;
|
||||
|
||||
//_player = this.CreateChild<PlayerMovement>(PlayerTemplate, PlayerSpawnMarker.Position );
|
||||
_player = PlayerTemplate.Instantiate<PlayerMovement>();
|
||||
_player = PlayerTemplate.Instantiate<PlayerStateMachine>();
|
||||
|
||||
this.CallDeferred("add_child", _player);
|
||||
_player.Transform = this.GlobalTransform;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue