Schmup-JIN/Assets/Scripts/PlayerCharacter.cs

32 lines
742 B
C#
Raw Normal View History

2019-09-17 15:43:40 +02:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerCharacter : AbstractCharacter
2019-09-17 15:43:40 +02:00
{
public override void Move(Vector2 movementDirection)
2019-09-17 15:43:40 +02:00
{
// TODO : Implement limits
_mover.Direction = movementDirection;
2019-09-17 15:43:40 +02:00
}
public override void Shoot()
2019-09-17 15:43:40 +02:00
{
_isShooting = true;
if (!_isDepleted && _shooter.Shoot(CurrentEnergy))
{
CurrentEnergy -= _shooter.EnergyCost;
}
else if (_isDepleted)
{
// Force regen when depleted even if holding the trigger
_isShooting = false;
}
2019-09-17 15:43:40 +02:00
}
protected override void Death()
{
throw new System.NotImplementedException();
}
2019-09-17 15:43:40 +02:00
}