Ludum Dare 50
Theme: Delay the inevitable
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
using System;
|
|
|
|
using Enemies.States;
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
namespace Enemies
|
|
|
|
{
|
|
|
|
public abstract class Enemy : MonoBehaviour
|
|
|
|
{
|
|
|
|
public enum States
|
|
|
|
{
|
|
|
|
Idle,
|
|
|
|
Target,
|
|
|
|
Path,
|
|
|
|
Follow,
|
|
|
|
Attack,
|
|
|
|
Die
|
|
|
|
}
|
|
|
|
|
|
|
|
public States? currentState;
|
|
|
|
public float health { get; set; } = 10f;
|
|
|
|
public float damage = 1;
|
|
|
|
|
|
|
|
public GameObject target { get; set; }
|
|
|
|
public float speed = 2f;
|
|
|
|
public float viewRange = 5f;
|
|
|
|
public float attackRange = 1f;
|
|
|
|
|
|
|
|
public IState state { get; set; }
|
|
|
|
|
|
|
|
public abstract void SwitchState(States s);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|