コード例 #1
0
        protected override void LoadContent()
        {
            font = Content.Load <SpriteFont>("fonts//Xolonium");
            font.DefaultCharacter = ' ';
            spriteBatch           = new SpriteBatch(GraphicsDevice);
            Generate();

            t.OnFinish += () =>
            {
                Genetics.Evolve(generation, () => Rand * Rand * Rand * Rand);
                //t.Reset(false);
                t.Start();
            };

            t.Start();
        }
コード例 #2
0
ファイル: Environment.cs プロジェクト: kazepilot/geneticCars
    public void Evolve()
    {
        _startTime = Time.time;
        Vector2 pos = StartPosition.position;

        _genetics.Evolve();
        _genetics.Reset(pos);
        _bestCurrentScore = 0;

        /*
         * int arena = Random.Range(0, Arenas.Length);
         * while (_prevArena == arena)
         * {
         *  arena = Random.Range(0, Arenas.Length);
         * }
         * Arenas[_prevArena].transform.position = new Vector3(0, -10, 0);
         * Arenas[arena].transform.position = new Vector3(0, 0, 0);
         * _prevArena = arena;
         */
    }