Schmup-JIN/Assets/Scripts/EnemyCharacter.cs
trotFunky a571cf1d4b Added ennemy
Added new textures
Fixed collision issues (Not having a RigidBody ...)
2019-09-19 15:55:09 +02:00

30 lines
612 B
C#

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class EnemyCharacter : AbstractCharacter
{
public override void Move(Vector2 movementDirection)
{
_mover.Direction = movementDirection;
}
public override void Shoot()
{
// Always shoot
_shooter.Shoot(_shooter.EnergyCost+1);
}
// TODO : Gain points, maybe through Events?
protected override void Death()
{
Destroy(gameObject);
}
// Don't gain points
private void OnBecameInvisible()
{
Destroy(gameObject);
}
}