private void GetNextPopulation(int maxPopGenerationNumber) { Player = new Player(new Vector2(300, 600), new Vector2(20, 20), "2D\\Player"); ScoreSprite = new ScoreSprite(Player, maxPopGenerationNumber); Enemies = EnemyRepository.GetEnemiesFromDb(); CurrentPopulation = Population.First(x => x.AfterGame == false); }
private void SetDefaultValues() { Player = new Player(new Vector2(300, 600), new Vector2(19, 19), "2D\\Player"); ScoreSprite = new ScoreSprite(Player, PopulationRepository.MaxPopGenerationNumber); Population = PopulationMapper.MapEntirePopDbToPop(PopulationRepository.GetPopulationFromDb()); Enemies = EnemyRepository.GetEnemiesFromDb(); CurrentPopulation = Population.First(x => x.AfterGame == false); }
public virtual void Draw() { Player.Draw(); ScoreSprite.Draw(); foreach (var enemy in Enemies) { enemy.Draw(); } }
private void SetDefaultTest() { Player = new Player(new Vector2(300, 600), new Vector2(19, 19), "2D\\Player"); ScoreSprite = new ScoreSprite(Player, 0); Population = PopulationMapper.MapEntirePopDbToPop(PopulationRepository.GetPopulationFromDb()); Enemies = EnemyRepository.GetEnemiesFromDb(); var best = PopulationRepository.GetBestPopulation(); CurrentPopulation = PopulationMapper.MapPopDbToPop(best, best.IdObject); }
public virtual void Update() { if (GlobalVariables.KeyboardController.GetPress("R")) { Restart(); } Player.Update(); ScoreSprite.Update(); CheckIfCurrentPopulationWon(); CheckIfCurrentPopulationLost(); if (CurrentPopulation != null && !Player.LoadedAiData) { LoadAiData(Player); } foreach (var enemy in Enemies) { enemy.Update(); } }