void Start() { body = GetComponent <Rigidbody2D>(); flappyAnim = GetComponent <FlappyAnim>(); currentScore = GetComponent <CurrentScore>(); showGameOver = GetComponent <GameOver>(); }
void UpdateScoreUI() { if (ScoreText != null) { ScoreText.text = CurrentScore.ToString(); } }
public void EndInvasion() { Region.SendRegionMessage(1152530); // Cora's forces have destroyed the Void Pool walls. The battle is lost! VoidPoolStats.OnInvasionEnd(this /*CurrentScore, Wave*/); NextStart = DateTime.UtcNow + TimeSpan.FromMinutes(RestartSpan); Region.SendRegionMessage(1152526, RestartSpan.ToString()); // The battle for the Void Pool will begin in ~1_VALUE~ minutes. List <Mobile> list = Region.GetPlayers(); foreach (Mobile m in list.Where(m => GetCurrentPoints(m) > 0)) { PointsSystem.VoidPool.AwardPoints(m, GetCurrentPoints(m)); } foreach (Mobile m in list.Where(m => CurrentScore.ContainsKey(m))) { m.SendLocalizedMessage(1152650, String.Format("{0}\t{1}\t{2}\t{3}", GetTotalWaves(m), Wave.ToString(), Wave.ToString(), CurrentScore[m])); // During the battle, you helped fight back ~1_COUNT~ out of ~2_TOTAL~ waves of enemy forces. Your final wave was ~3_MAX~. Your total score for the battle was ~4_SCORE~ points. } list.Clear(); list.TrimExcess(); ClearSpawn(true); }
// Use this for initialization void Start() { currentScore = GameObject.Find("CurrentScore").GetComponent<CurrentScore>(); fullScore = GameObject.FindObjectOfType<FullScore>(); score = GetComponent<Score>(); energy = GetComponent<Energy>(); energyLine = GameObject.FindObjectOfType<EnergyLine>(); inputController = GameObject.FindObjectOfType<InputController>(); timerScript = GameObject.FindObjectOfType<TimerScript>(); timerUI = GameObject.FindObjectOfType<TimerUI>(); info = GetComponent<Info>(); taskStrings = GetComponent<TaskStrings>(); pauseButton = GameObject.FindObjectOfType<PauseButton>().gameObject; pauseMenu = GameObject.Find("Canvas").GetComponentInChildren<PauseMenu>(); // endMenu = GameObject.FindObjectOfType<EndMenu>(); taskHelper = GameObject.FindObjectOfType<TaskHelper>(); globalController = GetComponent<GlobalController>(); cam = GameObject.Find("MainCamera"); secondCamera = GameObject.Find("SecondCamera"); wordRideCanvas = GameObject.FindObjectOfType<WordRideCanvas>(); metalSparksPrefab = Resources.Load("Prefabs/Particles/MetalSpark") as GameObject; carUserParametres = GetComponent<CarUserParametres>(); gameUI = GameObject.FindObjectOfType<GameUI>(); canvasController = GameObject.FindObjectOfType<CanvasController>(); particleCanvas = GameObject.Find("ParticleCanvas"); carCreator = GameObject.FindObjectOfType<CarCreator>(); mainBonus = GameObject.FindObjectOfType<MainBonus>(); waitBackground = GameObject.FindObjectOfType<WaitBackground>(); }
private void Update() { MoveInput = CrossPlatformInputManager.GetAxis("Horizontal"); RB.velocity = new Vector2(MoveInput * Speed, RB.velocity.y); if (!FacingLeft && MoveInput < 0) { flip(); } else if (FacingLeft && MoveInput > 0) { flip(); } if ((OnGround || ExtraJumps > 0) && CrossPlatformInputManager.GetButtonDown("Jump")) { RB.velocity = new Vector2(RB.velocity.x, JumpForce); ExtraJumps--; OnGround = false; } else if (OnGround) { ExtraJumps = NumberOfJumps; } if (PlatformsSpeed <= 4f) { PlatformsSpeed += 0.01f * Time.deltaTime; } if (Health <= 0) { SceneManager.LoadScene("GameOver"); } LivesRemaning.GetComponent <Text>().text = "Lives: " + Health; CurrentScore.GetComponent <Text>().text = "Score: " + Score; }
internal override void UpdateFlashlight() { if (s_Flashlight.Texture == null || spriteManagerFlashlight.SpriteList.Count == 0 || !s_Flashlight.Texture.TextureGl.Loaded) { if (AllowSubmission) { CurrentScore.InvalidateSubmission(); player.AddFlashlightFlag(); ConfigManager.PurgeHashCache(); GameBase.ChangeMode(OsuModes.Update); } return; } s_Flashlight.Position = GameBase.GameField.FieldToDisplay(catcher1.Position) / GameBase.WindowManager.Ratio; if (!Player.Paused) { SliderOsu s = player.ActiveHitObject as SliderOsu; if (s != null && s.IsSliding) { if (!s_LightsOut.IsVisible) { s_LightsOut.Alpha = 0.8f; } } else if (s_LightsOut.IsVisible) { s_LightsOut.Alpha = 0; } float targetScale = 8.0f; if (!EventManager.BreakMode) { if (ComboCounter.HitCombo < 100) { targetScale = 5.2f; } else if (ComboCounter.HitCombo < 200) { targetScale = 4.6f; } else { targetScale = 4.0f; } } if (s_Flashlight.Scale > targetScale) { s_Flashlight.Scale = (float)Math.Max(s_Flashlight.Scale - 0.1 * GameBase.FrameRatio, targetScale); } else if (s_Flashlight.Scale < targetScale) { s_Flashlight.Scale = (float)Math.Min(s_Flashlight.Scale + 0.1 * GameBase.FrameRatio, targetScale); } } }
// Use this for initialization private void Start() { _anim = GetComponent <Animator>(); _scoreScript = GameObject.FindWithTag(Tags.UITag).GetComponent <Score>(); gameObject.tag = Tags.PlayerTag; _currentScoreScript = GameObject.FindWithTag(Tags.CurrentScoreTag).GetComponent <CurrentScore>(); }
public CurrentScore() { if (inst == null) { inst = this; } }
// Use this for initialization void Start() { currentScore = GameObject.Find("CurrentScore").GetComponent <CurrentScore>(); fullScore = GameObject.FindObjectOfType <FullScore>(); score = GetComponent <Score>(); energy = GetComponent <Energy>(); energyLine = GameObject.FindObjectOfType <EnergyLine>(); inputController = GameObject.FindObjectOfType <InputController>(); timerScript = GameObject.FindObjectOfType <TimerScript>(); timerUI = GameObject.FindObjectOfType <TimerUI>(); info = GetComponent <Info>(); taskStrings = GetComponent <TaskStrings>(); pauseButton = GameObject.FindObjectOfType <PauseButton>().gameObject; pauseMenu = GameObject.Find("Canvas").GetComponentInChildren <PauseMenu>(); // endMenu = GameObject.FindObjectOfType<EndMenu>(); taskHelper = GameObject.FindObjectOfType <TaskHelper>(); globalController = GetComponent <GlobalController>(); cam = GameObject.Find("MainCamera"); secondCamera = GameObject.Find("SecondCamera"); wordRideCanvas = GameObject.FindObjectOfType <WordRideCanvas>(); metalSparksPrefab = Resources.Load("Prefabs/Particles/MetalSpark") as GameObject; carUserParametres = GetComponent <CarUserParametres>(); gameUI = GameObject.FindObjectOfType <GameUI>(); canvasController = GameObject.FindObjectOfType <CanvasController>(); particleCanvas = GameObject.Find("ParticleCanvas"); carCreator = GameObject.FindObjectOfType <CarCreator>(); mainBonus = GameObject.FindObjectOfType <MainBonus>(); waitBackground = GameObject.FindObjectOfType <WaitBackground>(); }
void Start() { GetHighscore(); _currentScoreScript = GameObject.FindWithTag(Tags.currentScoreTag).GetComponent<CurrentScore>(); _anim = GameObject.FindWithTag("Victory").GetComponent<Animator>(); SetCurrentScore(); CheckForVictory(); }
private void Start() { GetHighscore(); _currentScoreScript = GameObject.FindWithTag(Tags.CurrentScoreTag).GetComponent <CurrentScore>(); _anim = GameObject.FindWithTag("Victory").GetComponent <Animator>(); SetCurrentScore(); CheckForVictory(); }
private void OnTick() { if (!OnGoing && DateTime.UtcNow > NextStart && Region != null && Region.GetPlayerCount() > 0) { NextStart = DateTime.MaxValue; OnGoing = true; VoidType = (VoidType)Utility.Random(5); PoolHits = PoolStartHits; Wave = 0; if (CurrentScore != null) { CurrentScore.Clear(); } if (Waves != null) { Waves.Clear(); Waves.TrimExcess(); } CurrentScore = new Dictionary <Mobile, long>(); Waves = new List <WaveInfo>(); Region.SendRegionMessage(1152527, 0x2B); // The battle for the Void Pool is beginning now! if (WaypointACount != WaypointsA.Count || WaypointBCount != WaypointsB.Count) { Generate.AddWaypoints(); } SpawnWave(); } else if (OnGoing) { if (DateTime.UtcNow > NextWave) { SpawnWave(); } IPooledEnumerable eable = this.Map.GetMobilesInBounds(PoolWalls); foreach (Mobile m in eable) { if (!OnGoing) { break; } if (m is BaseCreature && !((BaseCreature)m).Controlled && !((BaseCreature)m).Summoned && Utility.RandomDouble() > 0.25) { OnVoidWallDamaged(m); } } eable.Free(); } }
private void SetText() { if (_currentScoreText == null || _totalScoreText == null) { return; } _currentScoreText.text = CurrentScore.ToString(); _totalScoreText.text = TotalScore.ToString(); }
public override Dictionary <string, string> GetGameSummary() { return(new Dictionary <string, string>() { { "Final Score", CurrentScore.ToString() }, { "Highest Combo", HighestCombo.ToString() }, { "Good Hits", GoodHits.ToString() }, { "Bad Hits", BadHits.ToString() }, { "Accuracy", ((float)GoodHits / (GoodHits + BadHits)).ToString("P") } }); }
private void FirstJump(PlayerController obj) { animator.SetInteger(stateParam, 1); player.OnJump -= FirstJump; CurrentScore = 0; HighestScore = 0; HighestScoreTime = 0; scoreText.text = CurrentScore.ToString(); startTime = Time.time; started = true; }
public override int GetHashCode() { unchecked { var hashCode = CurrentTime.GetHashCode(); hashCode = CurrentScore.Aggregate(hashCode, (current, x) => (current * 397) ^ x.GetHashCode()); hashCode = ScoresByPeriod.Aggregate(hashCode, (current, x) => (current * 397) ^ x.GetHashCode()); return(hashCode); } }
void SaveHighScore() { if (CurrentScore > Prefs.GetInt(PrefTypeInt.LevelBestScore, currentLevelNumber)) { highScoreText.text = CurrentScore.ToString(); Prefs.SetInt(PrefTypeInt.LevelBestScore, currentLevelNumber, CurrentScore); } if (currentDistance > Prefs.GetFloat(PrefTypeFloat.LevelBestDistance, currentLevelNumber)) { Prefs.SetFloat(PrefTypeFloat.LevelBestDistance, currentLevelNumber, currentDistance); } }
public bool Equals(ScoreboardData other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(CurrentTime.Equals(other.CurrentTime) && CurrentScore.SequenceEqual(other.CurrentScore) && ScoresByPeriod.SequenceEqual(other.ScoresByPeriod)); }
private void SetScore() { if (txtUserName.Text == string.Empty) { MessageBox.Show("You must fill in the user name field to continue"); return; } var rand = new RandomNumbers.RandomNumber(); var number = rand.GenerateRandomInteger(1, 100); txtRandomNumber.Text = number.ToString(); if (CurrentValue > 0) { if (CorrectAnswer(CurrentValue, number)) { CurrentScore += 1; if (CurrentScore == 10) { MessageBox.Show("Well done! You have completed the game."); txtHighScores.Text = DisplayHighScores(HighScores); } } else { if ((CurrentScore > 0) && IsHighScore(HighScores, CurrentScore)) { //if (!HasEqualHighScore(HighScores, CurrentScore)) //{ HighScores.Add(new HighScoreViewModel() { Score = CurrentScore, UserName = txtUserName.Text, ElapsedTimeInMilliseconds = Watch.ElapsedMilliseconds }); //} } btnGenerateNumber.Enabled = false; Watch.Stop(); txtHighScores.Text = DisplayHighScores(HighScores); } } txtScore.Text = CurrentScore == 0 ? string.Empty : CurrentScore.ToString(); CurrentValue = number; }
private void LateUpdate() { MoveHandler?.Invoke(); //current scene score textCamPos.GetComponent <Text>().text = CurrentScore.ToString(); List <Direction> moveDir = CustomController.PositionCompair(previousPos, currentRoundPos, sconfig.gap); foreach (Direction s in moveDir) { previousPos = currentRoundPos; ObserverUpate(s); } }
private void UpdateScoreText() { //Updates the score display + plays the score animation (coroutine) if (pointsTextField) { pointsTextField.text = CurrentScore.ToString(); if (_scoreAnimCoroutine != null) { StopCoroutine(_scoreAnimCoroutine); multiplierTextField.transform.localScale = Vector3.one; } _scoreAnimCoroutine = StartCoroutine(ScoreAnim(0.3f, 2f, pointsTextField)); } }
public void ResetPlayer() { //resets the player state to start a new round UpdatePlayerValues(); StartCoroutine(DelayPlayerControl(0.3f)); transform.position = _startPosition; CurrentHealth = _maxHealth; healthBar.fillAmount = CurrentHealth / _maxHealth; CurrentScore = 0; CurrentCoins = 0; CurrentXp = 0; pointsTextField.text = CurrentScore.ToString(); //Projectile Upgrade StartCoroutine(SpawnProjectiles()); }
private void Update() { if (started == false) { return; } float time = Time.time - startTime; float score = player.transform.position.y; if (score > CurrentScore) { HighestScore = score; HighestScoreTime = time; CurrentScore = (int)score - (int)time; scoreText.text = CurrentScore.ToString(); } }
public static void DetermineWinnerOfRound(PieceType type) { if (LevelManager._isPlayer1Red) { if (_isPlayerTurn == PieceType.RED) { _Player1Points++; } else { _Player2Points++; } } else { if (_isPlayerTurn == PieceType.RED) { _Player2Points++; } else { _Player1Points++; } } CurrentScore.UpdateScoreText(GetCurrentPlayerName()); int winningScore = (int)(((float)LevelManager.GetNumberOfRounds() / 2) + 1); if (winningScore <= _Player1Points || winningScore <= _Player2Points)//Game is won { UltimateWinner.UpdateUltimateWinnerText(GetCurrentPlayerName()); Results.UpdateResultsText(); SaveMatch(); WinScreen.TriggerWinScreen(); _IsGameOver = true; } else//round won { RoundScreen.TriggerRoundWinScreen(); RoundWinner.UpdateRoundWinnerText(GetCurrentPlayerName()); _IsGameOver = true; } }
private void Awake() { #region References buttonScoreText = GameObject.Find("ButtonScore").GetComponent <Text>(); startPositionOfButtonText = buttonScoreText.transform.position; gameManager = FindObjectOfType <GameManager>(); sbangButton = FindObjectOfType <RemoveCard>(); currentScoreText = FindObjectOfType <CurrentScore>(); multiplierText = FindObjectOfType <Multiplier>(); timeBarText = FindObjectOfType <TimeBar>(); totalScoreText = FindObjectOfType <TotalScore>(); #endregion }
internal override void UpdateFlashlight() { if (s_Flashlight.Texture == null || !s_Flashlight.Texture.TextureGl.Loaded) { if (CurrentScore.AllowSubmission) { CurrentScore.InvalidateSubmission(); NotificationManager.ShowMessageMassive("Couldn't draw Flashlight texture - disabling ranking.", 2000); ConfigManager.PurgeHashCache(); GameBase.ChangeMode(OsuModes.Update); } return; } if (spriteManagerFlashlight.SpriteList.Count == 0) { player.AddFlashlightFlag(); } }
public IActionResult GetScore(CurrentScore currentScore) { if (String.IsNullOrEmpty(HttpContext.Session.GetString("UserId"))) { return(RedirectToAction("Login", "UserEntry")); } var thisScore = new ScoreDto { ScoreId = Guid.NewGuid(), ScoreNumber = currentScore.ScoreNumber, ToGame = 1, RegistrationTime = DateTime.Now, UserId = new Guid(HttpContext.Session.GetString("UserId")) }; scoreService.Create(thisScore); if (currentScore.PlayAgain == true) { return(View("Play")); } return(RedirectToAction("ShowGames", "Home")); }
private void EndGame() { PauseGame(showMenu: false); string gameOverText = Profile.DefaultGameOverText; for (int i = 0; i < Profile.EndResults.Length; i++) { var result = Profile.EndResults[i]; if (CurrentScore.CompareValues(result.ScoreCondition.Comparison, result.ScoreCondition.Value)) { gameOverText = result.GameOverText; break; } } // Subscribe to when the player clicks the close button to go back to the main menu. Dialogue.OnSecondaryClick.AddListener(ReturnToMenu); // Show end dialogue. OnPopupTrigger(Profile.PlayerName, gameOverText, Profile.PlayerAvatar, gameObject); }
public void OnCreatureKilled(BaseCreature killed) { if (Waves == null) { return; } Waves.ForEach(info => { if (info.Creatures.Contains(killed)) { List <DamageStore> list = killed.GetLootingRights(); list.Sort(); for (int i = 0; i < list.Count; i++) { DamageStore ds = list[i]; Mobile m = ds.m_Mobile; if (ds.m_Mobile is BaseCreature && ((BaseCreature)ds.m_Mobile).GetMaster() is PlayerMobile) { m = ((BaseCreature)ds.m_Mobile).GetMaster(); } if (!info.Credit.Contains(m)) { info.Credit.Add(m); } if (!CurrentScore.ContainsKey(m)) { CurrentScore[m] = killed.Fame / 998; } else { CurrentScore[m] += killed.Fame / 998; } } list.Clear(); list.TrimExcess(); info.Creatures.Remove(killed); if (info.Creatures.Count == 0) { foreach (Mobile m in info.Credit.Where(m => m.Region == this.Region && m is PlayerMobile)) { double award = Math.Max(0, this.Map == Map.Felucca ? Stage * 2 : Stage); if (award > 0) { //Score Bonus if (!CurrentScore.ContainsKey(m)) { CurrentScore[m] = Stage * 125; } else { CurrentScore[m] += Stage * 125; } } } } if (killed.Corpse != null && !killed.Corpse.Deleted) { ((Corpse)killed.Corpse).BeginDecay(TimeSpan.FromMinutes(1)); } } }); }
public override void LoadContent() { base.LoadContent(); SetText("Your current score is " + CurrentScore.ToString()); }
// Use this for initialization void Start() { _anim = GetComponent<Animator>(); flashingScreen = GameObject.FindWithTag(Tags.flashingScreenObjectTag).GetComponent<FlashingScreen>(); _scoreScript = GameObject.FindWithTag(Tags.UITag).GetComponent<Score>(); _slowTimeScript = GameObject.FindWithTag(Tags.UITag).GetComponent<SlowTime>(); _rb2D = this.GetComponent<Rigidbody2D>(); this.gameObject.tag = Tags.playerTag; _currentScoreScript = GameObject.FindWithTag(Tags.currentScoreTag).GetComponent<CurrentScore>(); }
internal override void UpdateInput() { if (!IsInitialized || Player.Paused) { return; } int frameCheck = 0; if (!InputManager.ReplayMode) { InputManager.leftButton1 |= KeyboardHandler.IsKeyDown(BindingManager.For(Bindings.FruitsDash)); InputManager.leftButton1 |= JoystickHandler.IsKeyDown(BindingManager.For(Bindings.FruitsDash)); InputManager.leftButton1i |= InputManager.leftButton1; if (InputManager.leftButton1i) { InputManager.leftButton = ButtonState.Pressed; } } Dashing = InputManager.leftButton == ButtonState.Pressed; if (Dashing) { frameCheck += 4; } float currentMovementSpeed = baseMovementSpeed * specialMovementModifier; if (!Dashing) { currentMovementSpeed /= 2; } if (InputManager.ReplayMode || Player.Relaxing) { float newPos = InputManager.ReplayGamefieldCursor.X; if (InputManager.NewReplayFrame) { LeftPressed = catcher1.Position.X > newPos; RightPressed = catcher1.Position.X < newPos; } if (catcher1.Position.X != newPos) { #if DEBUG if (!ModManager.CheckActive(Mods.Autoplay) && (Math.Abs(catcher1.Position.X - newPos) > currentMovementSpeed * GameBase.SIXTY_FRAME_TIME)) { NotificationManager.ShowMessageMassive("Impossible movement (" + Math.Abs(catcher1.Position.X - newPos) + " vs " + (currentMovementSpeed * GameBase.SIXTY_FRAME_TIME) + ")", 1000); } #endif catcher1.FlipHorizontal = catcher1.Position.X > newPos; catcher1.Position.X = newPos; } } else { if (GameBase.ElapsedMilliseconds > 33) { return; } if (Math.Abs(catcher1.Position.X - checkPosition) > 0.01f) { catcher1.Position.X = checkPosition; CurrentScore.InvalidateSubmission(); } if ((RightPressed = KeyboardHandler.IsKeyDown(BindingManager.For(Bindings.FruitsRight)) || JoystickHandler.IsKeyDown(BindingManager.For(Bindings.FruitsRight)))) { frameCheck += 1; catcher1.Position.X = (float)(catcher1.Position.X + currentMovementSpeed * GameBase.ElapsedMilliseconds); catcher1.FlipHorizontal = false; } if ((LeftPressed = KeyboardHandler.IsKeyDown(BindingManager.For(Bindings.FruitsLeft)) || JoystickHandler.IsKeyDown(BindingManager.For(Bindings.FruitsLeft)))) { frameCheck += 2; catcher1.Position.X = (float)(catcher1.Position.X - currentMovementSpeed * GameBase.ElapsedMilliseconds); catcher1.FlipHorizontal = true; } } checkSpecialWaitingState(); importantFrame = frameCheck != importantFrameCheck; importantFrameCheck = frameCheck; catcher1.Position.X = OsuMathHelper.Clamp(catcher1.Position.X, 0, 512); checkPosition = catcher1.Position.X; }
public void UpdateBarStartTimes() { CurrentScore.UpdateAllStartTimes(); }