Пример #1
0
        private void StartBattle(MapEnemy obj)
        {
            Pause();
            var position = new Vector2D(player.Position.X, player.Position.Y);

            map.RemoveObject(player);
            var data = new BattleGameModelData
            {
                MapSize    = new Size(20000, 20000),
                Player     = player,
                Controls   = Controls,
                Enemy      = obj,
                Time       = Time,
                CameraSize = GameBasicCamera.Size,
                MainModel  = this
            };
            var model = new BattleGameModel(data);

            model.GameModelChanged += m =>
            {
                obj.Destoy();
                player.Position = position;
                map.AddGameObject(player);
                Controls.MouseHandler.ChangeCamera(GameBasicCamera);
                Run();
            };
            GameModelChanged?.Invoke(model);
            model.Run();
        }
Пример #2
0
 public BattleGameManager(MapEnemy enemy, GameMap map, Player player)
 {
     difficulty      = enemy.Difficult;
     this.map        = map;
     enemiesToCreate = leftToCreate = enemy.EnemiesCount;
     this.player     = player;
     aliveEnemies    = 0;
 }