void Start() { if (onScoreChangedCallback != null) { onScoreChangedCallback.Invoke(); } }
internal void Score(int lane) { lanes[lane].Chime(); score += 1 + Mathf.FloorToInt(comboCount / 5f); if ((comboCount + 1) % 5 == 0) { ComboUp(); } onScoreChanged?.Invoke(score); }
private void InitialiseUI() { OnScoreChanged?.Invoke(newText: _currentGameStats.Score.ToString()); OnCountDown?.Invoke(newText: ""); StartPauseWatch?.Invoke(""); OnAmmoChange?.Invoke(newText: _currentGameStats.Ammo.ToString()); }
public void AddScore(int score) { var newScore = statisticModel.Score + score; statisticModel.Score = newScore; OnScoreChanged?.Invoke(newScore); }
public void LoadGame() { if (LoadGameString != null) { PlayerState state = null; NewGameString = LoadGameString?.Invoke(); if (!string.IsNullOrEmpty(NewGameString)) { state = JsonConvert.DeserializeObject <PlayerState>(NewGameString); Player.LocationName = state.Location; Player.Score = state.Score; Player.Moves = state.Moves; OnLocationChanged?.Invoke(this, Player.LocationName); OnScoreChanged?.Invoke(this, Player.Score); OnMovesChanged?.Invoke(this, Player.Moves); } else { Output.WriteLine("Restore failed. No save file exists yet."); return; } } else { Output.WriteLine("Restore failed. This game is not setup to load games."); } }
public void AddScore(int points) { //add points earned to the player score score += points; Debug.Log("Score player " + PlayerNumber + " = " + score); onScoreChanged.Invoke(score); }
// Called whenever a scoring event occurs public void AddScore(int scoreToAdd, Transform player) { var thisPlayer = playerData.Where(x => x.player == player).SingleOrDefault(); thisPlayer.score += scoreToAdd; onScoreChangedCallback?.Invoke(thisPlayer.score, player); }
private void InitNewGame() // Инициализация новой игры { _score = 0; _livesLeft = _data.Lives; OnScoreChanged?.Invoke(_score); OnLivesLeftChanged?.Invoke(_livesLeft); }
public void AddPoints(int points) { _currentScore += points; OnScoreChanged?.Invoke(this, new OnScoreChangedEventArgs { score = _currentScore }); }
public static void AddScore(int value) { if (GameController.GameStarted) { score += value; OnScoreChanged?.Invoke(score); } }
public bool TryFindMatchesAndDestroyThem() { List <List <GemGridPosition> > allLinkedGemGridPositionList = GetAllMatch3Links(); bool foundMatch = false; List <Vector2Int> explosionGridPositionList = new List <Vector2Int>(); foreach (List <GemGridPosition> linkedGemGridPositionList in allLinkedGemGridPositionList) { foreach (GemGridPosition gemGridPosition in linkedGemGridPositionList) { TryDestroyGemGridPosition(gemGridPosition); } if (linkedGemGridPositionList.Count >= 4) { // More than 4 linked score += 200; // Special Explosion Gem GemGridPosition explosionOriginGemGridPosition = linkedGemGridPositionList[0]; int explosionX = explosionOriginGemGridPosition.GetX(); int explosionY = explosionOriginGemGridPosition.GetY(); // Explode all 8 neighbours explosionGridPositionList.Add(new Vector2Int(explosionX - 1, explosionY - 1)); explosionGridPositionList.Add(new Vector2Int(explosionX + 0, explosionY - 1)); explosionGridPositionList.Add(new Vector2Int(explosionX + 1, explosionY - 1)); explosionGridPositionList.Add(new Vector2Int(explosionX - 1, explosionY + 0)); explosionGridPositionList.Add(new Vector2Int(explosionX + 1, explosionY + 0)); explosionGridPositionList.Add(new Vector2Int(explosionX - 1, explosionY + 1)); explosionGridPositionList.Add(new Vector2Int(explosionX + 0, explosionY + 1)); explosionGridPositionList.Add(new Vector2Int(explosionX + 1, explosionY + 1)); } foundMatch = true; } bool spawnExplosion = match4Explosions; if (spawnExplosion) { foreach (Vector2Int explosionGridPosition in explosionGridPositionList) { if (IsValidPosition(explosionGridPosition.x, explosionGridPosition.y)) { GemGridPosition gemGridPosition = grid.GetGridObject(explosionGridPosition.x, explosionGridPosition.y); TryDestroyGemGridPosition(gemGridPosition); } } } OnScoreChanged?.Invoke(this, EventArgs.Empty); return(foundMatch); }
public virtual void UpdateScore(int score) { OnScoreChangedEventArgs args = new OnScoreChangedEventArgs() { NewScore = score }; OnScoreChanged.Invoke(this, args); }
void CountScore(int ballsCount) { score += ballsCount * (increaseCOunt + 1) + (hitsCount + 1) * (increaseCOunt + 1); if (levelParams.BestScore < score) { levelParams.BestScore = score; } OnScoreChanged?.Invoke(score, levelParams.BestScore); }
private IEnumerator AddScoreCoroutine() { while (true) { yield return(new WaitForSecondsRealtime(1f)); score++; OnScoreChanged?.Invoke(score); } }
public void AddScore(int value) { Score += value; if (Score > highScore) { PlayerPrefs.SetInt(SaveKey, Score); } OnScoreChanged?.Invoke(Score); }
public void UpdateScore() { score++; Debug.Log("Score: " + score); OnScoreChanged?.Invoke(score); if (score >= 10) { OnScoreReachedBoundary?.Invoke(); } }
internal void AddScores(int inc) { CurrentScores += inc; if (CurrentScores > TopScores) { TopScores = CurrentScores; _topScoresUpdated = true; } OnScoreChanged?.Invoke(); }
public void SetScore(int newScore) { var oldScore = _score; _score = newScore; OnScoreChanged?.Invoke(new ScoreChangedEvent { OldScore = oldScore, NewScore = newScore, }); }
public void Restart() { //IsRunning = false; //mIsRestarting = true; Output.Clear(); Player.LocationName = World.GetStartingLocation(); Player.Score = 0; Player.Moves = 0; OnLocationChanged?.Invoke(this, Player.LocationName); OnScoreChanged?.Invoke(this, 0); OnMovesChanged?.Invoke(this, 0); }
private void OnTriggerEnter(Collider other) { MinigameItem item = other.GetComponent <MinigameItem>(); if (item.scored) { return; } goals++; score += (int)((transform.position - player.transform.position).magnitude * 2 + (transform.position - other.transform.position).magnitude * 10); OnScoreChanged?.Invoke(score); item.scored = true; }
public void AddScore(float value) { Score += value; comboTimer.Reset(); if (!comboTimer.IsAwake) { comboTimer.Start(); } Combo += value; OnScoreChanged?.Invoke(); }
public void OnChipClicked(Word w) { GameScoreClientService.ValidateWord(w); var newScore = GetPoints(); var diff = newScore - _score; _score = newScore; Score = _score.ToString(); OnScoreChanged?.Invoke(newScore, diff); StateHasChanged(); }
public void Reset() { Score = 0; if (PlayerPrefs.HasKey(SaveKey)) { highScore = PlayerPrefs.GetInt(SaveKey); } else { highScore = 0; } OnScoreChanged?.Invoke(Score); }
public void ChangeScore(int value) { if (value < 0) { value = _pointsToLose; } Score += value; if (Score <= 0) { Score = 0; } Save(); OnScoreChanged?.Invoke(); }
public void Initialize() { scoreCanvas.Initialized(); Score = 0; if (PlayerPrefs.HasKey(SaveKey)) { highScore = PlayerPrefs.GetInt(SaveKey); } else { highScore = 0; } OnScoreChanged?.Invoke(Score); }
/// <summary> /// Añade o resta puntos a un equipo. /// </summary> /// <param name="Team">Color del equipo.</param> /// <param name="Points">Puntos que va a dar/quitar.</param> public void AddPointsToTeam(Team Team, int Points, RoomUser User) { int TeamId = (int)Team; teamPoints[TeamId] += Points; if (teamPoints[TeamId] < 0) { teamPoints[TeamId] = 0; } List <RoomItem> Items = teamItems[TeamId]; foreach (RoomItem Item in Items) { if (IsScoreboard(Item.GetBaseItem().InteractionType)) { Item.ExtraData = teamPoints[TeamId].ToString(); Item.UpdateState(); } } OnScoreChanged?.Invoke(null, new TeamScoreChangedArgs(teamPoints[TeamId], Team, User)); }
public void CallOnScoreChanged(EventData ob = null) => OnScoreChanged?.Invoke(ob);
public void AddScore(int count) // Изменение кол-ва очков { _score += count; OnScoreChanged?.Invoke(_score); }
private void Start() { Score = 0f; OnScoreChanged?.Invoke(); }
private void ChageScore(int newScore) { _value = newScore; OnScoreChanged?.Invoke(_value); }