コード例 #1
0
ファイル: Camera.cs プロジェクト: georgecai904/mazeball
 // 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;
 }
コード例 #2
0
 private void RunGame(Game game, IEnumerable<int> rollScores)
 {
     foreach (var rollScore in rollScores)
     {
         game.Roll(rollScore);
     }
 }
コード例 #3
0
        public void TestTwentyZeroGame()
        {
            var game = new Game();

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

            Assert.AreEqual(0, game.GetScore());
        }
コード例 #4
0
ファイル: Camera.cs プロジェクト: asix7/GraphicsProject
        // 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;
        }
コード例 #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());
        }
コード例 #6
0
        public void TestPerfectGame()
        {
            var game = new Game();

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