Exemplo n.º 1
0
    public void UpdateCreature(float deltaTime)
    {
        if (isAlive)
        {
            energy -= deltaTime * energyConsume;

            if (energy >= creatureManager.reproduceMargin + creatureManager.reproduceEnergy)
            {
                creatureManager.Reproduce(this);
            }

            Move(deltaTime);
        }

        else
        {
            Die(deltaTime);
        }
    }