private void updateTimeTarget() { timeTarget = DisplayManager.displayManager.currentScene.timeTargetXData.TimeTargetData[TimeTargetID]; PerSecondIncrease = timeTarget.add / (timeTarget.min * 60); if (title) { title.text = timeTarget.title; } if (contenttitle) { contenttitle.text = timeTarget.contentTitle; } if (content) { content.text = timeTarget.content; } card.setCard(new mmCard(timeTarget.cards), "yo"); if (!timeTarget.endTime.Contains("0000")) { Odo.gameObject.SetActive(false); cardPayed = true; } else { Odo.gameObject.SetActive(true); cardPayed = false; } card.setPayed(cardPayed); }
private void updateTimeTarget() { timeTarget = DisplayManager.displayManager.currentScene.timeTargetData; PerSecondIncrease = timeTarget.add / (timeTarget.min * 60); string[] cardsStrings = timeTarget.cards.Split(','); for (int i = 0; i < cards.Count; i++) { cards[i].spriteName = cardsStrings[i]; } }
public TimeTarget GetSystemUnderTest() { var timeTarget = new TimeTarget(_mockStopwatch); timeTarget.Original = new PanTiltSetting(50, 50); timeTarget.Target = new PanTiltSetting(80, 80); timeTarget.TimeSpan = TimeSpan.FromSeconds(4); return(timeTarget); }
private void DecideNextSmoothPursuit() { _nextSmoothPursuit = TimeSpan.FromSeconds(_random.Next(8, 20)); var nextSmoothPursuitSpeedMilliseconds = _random.Next(250, 3000); _timeSinceLastSmoothPursuit.Restart(); _timeTarget = new TimeTarget(); _timeTarget.Original = _panTiltController.CurrentSetting; _timeTarget.TimeSpan = TimeSpan.FromMilliseconds(nextSmoothPursuitSpeedMilliseconds); var nextPan = Convert.ToDecimal(_random.Next((int)PursuitBoundaryLower.PanPercent.Value, (int)PursuitBoundaryUpper.PanPercent.Value)); var nextTilt = Convert.ToDecimal(_random.Next((int)PursuitBoundaryLower.TiltPercent.Value, (int)PursuitBoundaryUpper.TiltPercent.Value)); _timeTarget.Target = new PanTiltSetting(nextPan, nextTilt); }
private void DecideNextSmoothPursuit() { _nextSmoothPursuit = TimeSpan.FromSeconds(_random.Next(60, 3 * 60)); var nextSmoothPursuitSpeedMilliseconds = _random.Next(250, 3000); _timeSinceLastSmoothPursuit.Restart(); _timeTarget = new TimeTarget(); _timeTarget.Original = _panTiltController.CurrentSetting; _timeTarget.TimeSpan = TimeSpan.FromMilliseconds(nextSmoothPursuitSpeedMilliseconds); // Handle stupid settings var minPan = Math.Min((int)PursuitBoundaryLower.PanPercent.Value, (int)PursuitBoundaryUpper.PanPercent.Value); var maxPan = Math.Max((int)PursuitBoundaryLower.PanPercent.Value, (int)PursuitBoundaryUpper.PanPercent.Value); var minTilt = Math.Min((int)PursuitBoundaryLower.TiltPercent.Value, (int)PursuitBoundaryUpper.TiltPercent.Value); var maxTilt = Math.Max((int)PursuitBoundaryLower.TiltPercent.Value, (int)PursuitBoundaryUpper.TiltPercent.Value); var nextPan = Convert.ToDecimal(_random.Next(minPan, maxPan)); var nextTilt = Convert.ToDecimal(_random.Next(minTilt, maxTilt)); _timeTarget.Target = new PanTiltSetting(nextPan, nextTilt); _screen.WriteLine($"Next pursuit in {_nextSmoothPursuit}"); }
override public void DoEffect(Arrow arrow) { if (effected) { return; } effected = true; createExplosion(); Energy e = GameObject.FindObjectOfType(typeof(Energy)) as Energy; if (e != null) { e.addEnergy(20); } GameStatus.Inst.EarnScore(arrow.Combo++, TARGET_ID); TimeTarget tt = gameObject.GetComponent(typeof(TimeTarget)) as TimeTarget; tt.createSound(); GameStatus.Inst.IncreaseTime(EXTRA_TIME); recycle(); }