Exemple #1
0
            public void TestPositionCalculation()
            {
                Game.Start(1);

                var obstacle    = Game.Obstacles.First();
                var oldLocation = obstacle.Location;

                Game.CalculateObstaclePoisiton(obstacle);

                Assert.AreNotEqual(oldLocation, obstacle.Location);
            }
Exemple #2
0
        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);
            }
        }