Ejemplo n.º 1
0
		public void timeSucccess()
		{
			casovac.Stop ();

			foreach (ButtonItem bt in ButtonItem.seznamVisibleButtons) {
				bt.killThis ();
			}

			if (gameInterval >= 100 && gameInterval < 130) 
			{
				RunOnUiThread (() => obrazekSmile.SetImageResource (Resource.Drawable.smile));
			}
			if (gameInterval < 100)
			{
				RunOnUiThread (() => obrazekSmile.SetImageResource (Resource.Drawable.lol));
			}
			if (OptionsHodnoty.Vibrace)
			{
				mvibrator = (Vibrator)this.GetSystemService (Context.VibratorService);
				mvibrator.Vibrate (10);
			}
			//System.Threading.Thread.Sleep (malaPausa);

			gameIntervalBase--;
			gameInterval = gameIntervalBase;

			casovac.Start ();

		}
Ejemplo n.º 2
0
		public void gameFail() 
		{
			RunOnUiThread (() => obrazekSmile.SetImageResource (Resource.Drawable.angry));

			if (OptionsHodnoty.Vibrace) {
				mvibrator = (Vibrator)this.GetSystemService (Context.VibratorService);
				mvibrator.Vibrate (50);
			}

			Vysledek vysledek = new Vysledek (score, DateTime.Now.ToString ());
			SeznamVysledku.seznam.Add (vysledek);
			SeznamVysledku.WriteToBinaryFile ();
			gameFailed = true;
		}
		void StartVibrating ()
		{
			if (_vibrator != null) {
				return;
			}

			_vibrator = (Vibrator) GetSystemService (Context.VibratorService);
			_vibrator.Vibrate (new long[] { 0, 1000, 1000 }, 0);
		}