示例#1
0
 private void Start()
 {
     IsGameSceneEnabled = true;
     gameOverPanel.SetActive(false);
     gameOver = new GameOverConditions(player, World.instance.areas);
     Invoke("StartTutorial", 0.6f);
 }
        //====== ctors

        public GameLogic(Size terrainSize, GameTime gameTime) : base(gameTime)
        {
            terrain            = new Terrain(terrainSize);
            snakeBody          = new SnakeBody(new Point(terrain.Size.Width / 2, terrain.Size.Height / 2));
            speed              = new SnakeSpeed();
            applesGenerator    = new AppleGenerator(terrain, gameTime);
            applesConsumer     = new AppleConsumer(terrain, snakeBody, gameTime);
            terrainUpdater     = new TerrainUpdater(terrain, snakeBody, gameTime);
            gameOverConditions = new GameOverConditions(snakeBody, terrain, applesGenerator, gameTime);
            score              = new Score();
            moveQueue          = new SnakeMoveQueue();

            updater = new GameObjectsUpdater();
            SetupGameObjectsUpdater();

            applesConsumer.Consumed += AppleConsumer_AppleConsumed;
        }