Each brick can either be dead or alive, has a color and the bounding
rectangle for rendering and collision detection.
View code on GitHub
Inheritance Hierarchy
Breakout Score
Namespace: Breakout
Assembly: Breakout (in Breakout.exe) Version: 1.1.1.0 (1.1.1)
Syntax
The Score type exposes the following members.
Constructors
Name | Description | |
---|---|---|
Score | Initializes a new instance of the Score class |
Methods
Name | Description | |
---|---|---|
IncreasePoints | ||
LifeLost | ||
NextLevel | ||
ToString | (Overrides Object ToString .) |
Properties
Name | Description | |
---|---|---|
Level |
Events
Name | Description | |
---|---|---|
GameOver |
Remarks
Examples
[Test] public void IncreasePoints() { Assert.IsTrue(score.ToString().Contains("Score: 0"), score.ToString()); score.IncreasePoints(); }
[Test] public void NextLevelWithoutInitialization() { bool isGameOver = false; score.GameOver += () => isGameOver = true; Assert.AreEqual(1, score.Level); score.NextLevel(); Assert.AreEqual(2, score.Level); Assert.IsFalse(isGameOver); }
[Test] public void NextLevelWithLevelInitialization() { Resolve<Level>(); bool isGameOver = false; score.GameOver += () => isGameOver = true; Assert.AreEqual(1, score.Level); score.NextLevel(); Assert.AreEqual(2, score.Level); Assert.IsFalse(isGameOver); }
See Also