private void replayLevel() { numLives -= 1; LevelView curr = (LevelView)currentView; curr.resetBalls(this.Width, this.Height); curr.numLives = numLives; if (numLives > 0) { startGame(); } }
public void startGame() { this.Shot = new Shot(); this.Balls = new List <Ball>(); this.playerId = playerId; LevelView currentLevel = (LevelView)currentView; player = new Player(this.Width / 2, this.Height - currentLevel.statusBarImg.Height - 91, playerId); player.IsWalking = false; currentLevel.resetBalls(this.Width, this.Height); foreach (Ball b in currentLevel.Balls) { Balls.Add(b); } pbTime = new ProgressBar(10, 412, this.Width - 5, 5); finScore.Visible = false; this.timer1.Interval = INTERVAL; this.timer1.Enabled = true; this.timer1.Start(); }