public override void Update(GameTime gameTime) { if (ball.CollidesWith(can1)) { can1.Color = ball.Color; ball.Reset(); } if (ball.CollidesWith(can2)) { can2.Color = ball.Color; ball.Reset(); } if (ball.CollidesWith(can3)) { can3.Color = ball.Color; ball.Reset(); } if (lives <= 0) { Painter.GameStateManager.SwitchTo("GameOverState"); lives = 5; livesSprites.Reset(); Score = 0; } base.Update(gameTime); }
public override void Update(GameTime gameTime) { if (ball.CollidesWith(can1)) { can1.Color = ball.Color; ball.Reset(); } if (ball.CollidesWith(can2)) { can2.Color = ball.Color; ball.Reset(); } if (ball.CollidesWith(can3)) { can3.Color = ball.Color; ball.Reset(); } if (this.lives <= 0) { this.Reset(); PainterFramework.GameStateManager.SwitchTo("gameoverState"); } base.Update(gameTime); }
public override void Update(GameTime gameTime) { if (ball.CollidesWith(paintCan1)) { paintCan1.Color = ball.Color; ball.Reset(); } if (ball.CollidesWith(paintCan2)) { paintCan2.Color = ball.Color; ball.Reset(); } if (ball.CollidesWith(paintCan3)) { paintCan3.Color = ball.Color; ball.Reset(); } base.Update(gameTime); }