Fix game over
This commit is contained in:
@@ -216,6 +216,7 @@ size = Vector3(0.856928, 1.65704, 0.82877)
|
||||
|
||||
[node name="Capricorn" type="CharacterBody3D" groups=["Player"]]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.408962, 0)
|
||||
collision_layer = 17
|
||||
motion_mode = 1
|
||||
script = ExtResource("1_aqn5t")
|
||||
_fireProjectile = ExtResource("2_e6qos")
|
||||
|
||||
@@ -23,9 +23,9 @@ public partial class CapricornControls : Character
|
||||
if (Input.IsActionJustPressed("exit"))
|
||||
GetTree().Quit();
|
||||
|
||||
if (Input.IsActionJustPressed(_ownerPlayer.PlayerInput.Fire()) && CanShoot)
|
||||
if (Input.IsActionJustPressed(OwnerPlayer.PlayerInput.Fire()) && CanShoot)
|
||||
Fire(_fireProjectile);
|
||||
if (Input.IsActionJustPressed(_ownerPlayer.PlayerInput.AltFire()) && CanShoot)
|
||||
if (Input.IsActionJustPressed(OwnerPlayer.PlayerInput.AltFire()) && CanShoot)
|
||||
Fire(_altFireProjectile);
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ public partial class CapricornControls : Character
|
||||
{
|
||||
var velocity = Velocity;
|
||||
|
||||
var inputDir = Input.GetVector(_ownerPlayer.PlayerInput.Left(), _ownerPlayer.PlayerInput.Right(), _ownerPlayer.PlayerInput.Up(), _ownerPlayer.PlayerInput.Down());
|
||||
var inputDir = Input.GetVector(OwnerPlayer.PlayerInput.Left(), OwnerPlayer.PlayerInput.Right(), OwnerPlayer.PlayerInput.Up(), OwnerPlayer.PlayerInput.Down());
|
||||
var direction = (Transform.Basis * new Vector3(inputDir.X, 0, inputDir.Y)).Normalized();
|
||||
if (direction != Vector3.Zero)
|
||||
{
|
||||
@@ -119,6 +119,6 @@ public partial class CapricornControls : Character
|
||||
public new void OnHit(Node3D node)
|
||||
{
|
||||
if (this != null)
|
||||
_gameManager.CallDeferred(GameManager.MethodName.RemoveCharacter, _ownerPlayer);
|
||||
_gameManager.CallDeferred(GameManager.MethodName.RemoveCharacter, OwnerPlayer);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user