public void TestPositionCalculation() { Game.Start(1); var obstacle = Game.Obstacles.First(); var oldLocation = obstacle.Location; Game.CalculateObstaclePoisiton(obstacle); Assert.AreNotEqual(oldLocation, obstacle.Location); }
public static void PaintObstacles(Graphics g, GameModel game) { foreach (var obs in game.Obstacles) { obs.GotOutOfScreen += () => { game.CalculateObstaclePoisiton(obs); }; g.DrawImage(Textures.Collection["obstacle1"], obs.X, obs.Y, obs.Width, obs.Height); g.RotateTransform(0.8f); } }