public Player(Game game, Map map) : base(game) { _map = map; _gameRef = (Game1)game; Camera = new Camera(_gameRef.ScreenRectangle); game.Components.Add(this); }
public Battle(Game1 game, Trainer alliedTrainer, Trainer enemyTrainer, bool trainerBattle) : base(game) { Camera = new Camera(game.ScreenRectangle) {Zoom = 4f}; Camera.LockToCenter(game.ScreenRectangle); _trainerBattle = trainerBattle; CurrentPhase = BattlePhase.Starting; AlliedTrainer = alliedTrainer; AlliedTrainer.PrepareForCombat(RenderingPosition.Ally); EnemyTrainer = enemyTrainer; EnemyTrainer.PrepareForCombat(RenderingPosition.Enemy); foreach (var pokemon in EnemyTrainer.PokemonSet.Where(pokemon => pokemon.CurrentHealth > 0)) { ActiveEnemyPokemon = new PokemonWrapper(game, pokemon); break; } foreach (var pokemon in AlliedTrainer.PokemonSet.Where(pokemon => pokemon.CurrentHealth > 0)) { ActiveAlliedPokemon = new PokemonWrapper(game, pokemon); break; } ActiveAlliedPokemon.PokemonInstance.PrepareForCombat(RenderingPosition.Ally); ActiveEnemyPokemon.PokemonInstance.PrepareForCombat(RenderingPosition.Enemy); // Initiate state BattleConclusion = BattleConclusion.Undecided; EndStage = EndStage.DisplayResult; CurrentPlayerTurnPhase = PlayerTurnPhase.ChoosingAction; RewardState = RewardState.ExperienceToBeAwarded; LoadContent(); }