コード例 #1
0
        public void Update(TimeObject timeObject)
        {
            _intelligence.DoIntelligenceUpdate(timeObject);

            _temperatureCheckTimer -= timeObject.ElapsedGameTime;
            if (_temperatureCheckTimer <= 0)
            {
                _temperatureCheckTimer += _temperatureCheckTimerMax * (1.0f + ((float)(RandomGenerator.Random.NextDouble() - 0.5) * 0.5f));
                DoCheckTemperature();
                DoCheckTerrain();
            }

            _foodTimer -= timeObject.ElapsedGameTime;
            if (_foodTimer <= 0)
            {
                _foodTimer += MoveTimerMax * (1.0f + ((float)(RandomGenerator.Random.NextDouble() - 0.5) * 0.5f));
                EatFood();
            }


            if (_fuckDeadTime >= 0)
            {
                _fuckDeadTime -= timeObject.ElapsedGameTime;
            }
            if (_fuckDeadTime < 0)
            {
                if (Tribe.TwoAnimalOnPosition(PositionInTiles))
                {
                    FuckIt();
                }
            }
        }
コード例 #2
0
        private float _fuckDeadTime; // will also use MoveTimerMax



        public Animal(AnimalProperties properties, IWorld world, Tribe tribe, Vector2i initialPosition)
        {
            World           = world;
            Tribe           = tribe;
            _shape          = new CircleShape(TileSizeInPixels / 2.0f - 1.0f);
            PositionInTiles = initialPosition;

            CalculateAnimalParameters(properties);

            _intelligence = new AnimalAI(this);
        }
コード例 #3
0
 private void FuckIt()
 {
     //Console.WriteLine("F**k Yeah!");
     _fuckDeadTime += 175.0f * (float)Math.Sqrt(Math.Sqrt(MoveTimerMax));
     Tribe.LetThemHaveFun();
 }