public void LoadLevel() { _level = _gameIsOver || _level == null ? _levelsCollection.LoadFirstLevel() : _levelsCollection.LoadNextLevel(); _level.Create(_window); _ball = _level.Ball; _platform = _level.Platform; _bricks = _level.Bricks; if (_gameIsOver) { _score = 0; } _ball.GameOver += (sender, args) => _gameIsOver = true; }
public void Create(Rectangle window) { Ball = new Ball(BallSize, BallBottomOffset, BallMaxAcceleration); Platform = new Platform(PlatformWidth, PlatformHeight, PlatformBottomOffset, PlatformMaxAcceleration); Bricks = GenerateBricks(window).ToList(); }