Since its release it has been played and recommended by several YouTubers and Steam curators and received very positive reviews.
public abstract class Enemy : MonoBehaviour
{
EnemyBehaviour currentBehaviour;
protected void SwitchToBehaviour(EnemyBehaviour newBehaviour)
{
if (currentBehaviour != null)
currentBehaviour.End();
currentBehaviour = newBehaviour;
currentBehaviour.Start();
}
protected virtual void Update()
{
if (currentBehaviour != null)
currentBehaviour.Update();
}
abstract class EnemyBehaviour
{
Enemy enemy;
public EnemyBehaviour(Enemy enemy)
{
this.enemy = enemy;
}
// Event Hooks
protected abstract void OnStart();
protected abstract void OnUpdate();
protected abstract void OnEnd();
protected abstract string GetDebugInfo();
}
}
public class BasicEnemy : Enemy
{
const float roamingWaitTime = 4.0f;
void Start() => SwitchToBehaviour(new RoamingBehaviour());
class RoamingBehaviour : EnemyBehaviour
{
enum Substate
{
MovingToDestination,
Waiting
}
Substate substate;
float startedWaitTimestamp;
protected override void OnStart()
{
substate = Substate.MovingToDestination;
enemy.SetMoveDestination(GetRandomPointOnNavMesh());
}
protected override void OnUpdate()
{
switch (substate)
{
case Substate.MovingToDestination:
if (enemy.HasReachedMoveDestination())
{
startedWaitTimestamp = Time.time;
substate = Substate.Waiting;
}
break;
case Substate.Waiting:
if (Time.time >= startedWaitTimestamp + enemy.roamingWaitTime)
substate = Substate.MovingToDestination;
break;
}
}
}
}
Equally tedious was level design. Every WtW level went through at least three complete do-overs, graphically and topographically. The size of the levels had to be just small enough for players to stumble upon their objectives, but just large enough to create dynamic encounters with the various monsters. A big problem the game faced during development was that players would get lost on the last power box, struggle for ages until their power went out and they had to start over. I combatted this with two changes: