Example #1
0
 // Ensures that all objects are being rendered from a consistent viewpoint
 public Camera(Game game)
 {
     pos = new Vector3(0, 0, -10);
     View = Matrix.LookAtLH(pos, new Vector3(0, 0, 0), Vector3.UnitY);
     Projection = Matrix.PerspectiveFovLH((float)Math.PI / 4.0f, (float)game.GraphicsDevice.BackBuffer.Width / game.GraphicsDevice.BackBuffer.Height, 0.01f, 1000.0f);
     this.game = game;
 }
Example #2
0
 private void RunGame(Game game, IEnumerable<int> rollScores)
 {
     foreach (var rollScore in rollScores)
     {
         game.Roll(rollScore);
     }
 }
Example #3
0
        public void TestTwentyZeroGame()
        {
            var game = new Game();

            RunGame(game, Enumerable.Repeat(0, 20));

            Assert.AreEqual(0, game.GetScore());
        }
Example #4
0
        // Set the intil values for the camera
        public Camera(ProjectGame game)
        {
            cameraPos = new Vector3(0, y_camera_position, 0);
            cameraTarget = new Vector3(-platform_midpoint, 0, 0);
            cameraUp = Vector3.UnitY;

            View = Matrix.LookAtRH(cameraPos, cameraTarget, cameraUp);
            Projection = Matrix.PerspectiveFovRH((float)Math.PI / 4.0f, (float)game.GraphicsDevice.BackBuffer.Width / game.GraphicsDevice.BackBuffer.Height, 0.1f, 1000.0f);
            this.game = game;
        }
Example #5
0
        public void TestFirstScoreStrikeThenZeros()
        {
            var game = new Game();

            var scores = new [] { 10 }.Concat(Enumerable.Repeat(0, 18));

            RunGame(game, scores);

            Assert.AreEqual(10, game.GetScore());
        }
Example #6
0
        public void TestPerfectGame()
        {
            var game = new Game();

            var scores = Enumerable.Repeat(10, 11);
        }
Example #7
0
 public void TestCanRollBall()
 {
     var game = new Game();
     game.Roll(8);
 }
Example #8
0
 public void TestCanCreateGame()
 {
     var game = new Game();
     Assert.IsNotNull(game);
 }