@Override
    public void update(GameContainer container, StateBasedGame game, int delta) throws SlickException {
        super.update(container, game, delta);
        
        if (alive) {
            if (World.tickCount % 30 == 0) {
                energyTick();
            }
            
            if (energy <= 0 || health <= 0) {
                setDead();
                /*if (size > 50) {
                    size-= 20;
                    energy += 20;
                } else {
                    setDead();
                }*/
            }
        } else {
            deathTimer++;
            if (deathTimer < 1800) {
            col = Colour.setColorByHealth((1800 - deathTimer) / 1800F, col);
            } else {
                col = Colour.setColorByHealth(0, col);
            }
            if (size > 10) {
                if (World.rand.nextInt(10) == 0) {
                size -= Terrain.changeEnergy(x, y, 1);
                }
            } else {
                Terrain.changeEnergy(x, y, size);
                remove();
            }
        }
        
    }