Schmup-JIN/Assets/Scripts/PlayerCharacter.cs
trotFunky 42706712aa Implemented shooting
Fixed abstract character not depleting energy when reaching zero
Created prefabs for player and enemy bullets
Added physics layers for players and enemies
2019-09-19 12:36:24 +02:00

31 lines
742 B
C#

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