public void CheckWin(SandTile tile) { if(tile.DigStatus == DiggingGame.SandBoard.SandTile.DigDepth.DugThrice){ if (tile.DigObject is Schelp) { nrGoodObjectsFound++; } else { nrBadObjectsFound++; } } if (nrGoodObjectsFound == 8) { //WIN StateManager.GetInstance().SetState(StateManager.State.Victory); return; } else if(nrBadObjectsFound == 3) { //LOSS StateManager.GetInstance().SetState(StateManager.State.Loss); } }
public DigEmitter(SandTile tile) : base(tile.DrawRectangle.X + tile.DrawRectangle.Width / 2, tile.DrawRectangle.Y + tile.DrawRectangle.Height / 2, 0.0001f) { this.particleScale = 2f; this.particlesPerTick = 50; this.lifespanMS = 900; this.ticksPerSecond = 1; this.particleSpeedX = -2f; this.particleSpeedY = -1.77f; this.particleRandomSpeedX = 6f; this.particleRandomSpeedY = 6f; this.particleLifespanMS = 500; this.particleColor = Color.SandyBrown; this.fadeAccordingToLifespan = true; }