// 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; }
private void RunGame(Game game, IEnumerable<int> rollScores) { foreach (var rollScore in rollScores) { game.Roll(rollScore); } }
public void TestTwentyZeroGame() { var game = new Game(); RunGame(game, Enumerable.Repeat(0, 20)); Assert.AreEqual(0, game.GetScore()); }
// 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; }
public void TestFirstScoreStrikeThenZeros() { var game = new Game(); var scores = new [] { 10 }.Concat(Enumerable.Repeat(0, 18)); RunGame(game, scores); Assert.AreEqual(10, game.GetScore()); }
public void TestPerfectGame() { var game = new Game(); var scores = Enumerable.Repeat(10, 11); }
public void TestCanRollBall() { var game = new Game(); game.Roll(8); }
public void TestCanCreateGame() { var game = new Game(); Assert.IsNotNull(game); }