-
Notifications
You must be signed in to change notification settings - Fork 0
IAIBehaviour
Nick Stapleton edited this page Jun 11, 2019
·
3 revisions
This interface controls all behaviour for AI. To make an AI, define it's Action functions and call them successively in Update().
- Move
- Shoot
- Shield
Inherit from SimpleDotBehaviour.cs
class ShooterDotBehaviour : SimpleDotBehaviour
{
// Call base and set the type.
new void Start()
{
base.Start();
type = "Shooter Dot";
}
// Call base which Moves and Checkscore.
// Then call any functions you define.
new public void Update()
{
base.Update();
Fire();
}
// Define any new functions.
new public void Fire()
{
if (Random.Range(0, 100) <= owner.GetFireChance())
{
owner.Shoot();
}
}
}
namespace DotBehaviour.Command
{
public interface IAIBehaviour
{
// Sets the parent.
void init(IGeo geo);
// Updates the parent's stats according to it's kill record.
void CheckScore();
// Move Logic for AI.
void Move();
// Returns the type of behaviour script.
string GetType();
// Shields Logic for AI.
void Shields();
// Shooting Logic for AI.
void Fire();
}
}
ECS 189L Group Members- Megan Brown, Brian Coe, David Lee, Kyle Catapusan, Nick Stapleton