void Awake() { // string[] args = System.Environment.GetCommandLineArgs(); DontDestroyOnLoad(gameObject); eventQueue = new Queue(); scoreContainer = new ScoreContainer(); Debug.Log("<color=purple>P</color><color=blue>O</color><color=cyan>L</color><color=green>Y</color><color=yellow>C</color><color=orange>R</color><color=red>U</color><color=purple>S</color><color=blue>H</color><color=cyan>E</color><color=yellow>R</color>"); // set settings if (settings != null) { buildVersion = settings.buildVersion; log = settings.log; logEvents = settings.logEvents; scriptsAddress = settings.scriptsAddress; bundleSize = settings.bundleSize; eventBuild = settings.eventBuild; } else { Debug.Log("[DataCollector] no settings loaded, using standard settings"); } }
// Use this for initialization void Start() { string highScoreKey; string playerKey; for (int i = 0; i < highScores.Length; i++) { highScoreKey = "highScore" + i; playerKey = "player" + i; //PlayerPrefs.DeleteKey(highScoreKey); //Remove this later //PlayerPrefs.DeleteKey (playerKey); playerNames[i] = PlayerPrefs.GetString(playerKey, "AAA"); highScores[i] = PlayerPrefs.GetString(highScoreKey, "0:00:00 with 0 rounds"); } player1.text = playerNames[0]; player1Time.text = highScores [0]; player2.text = playerNames[1]; player2Time.text = highScores [1]; player3.text = playerNames[2]; player3Time.text = highScores [2]; player4.text = playerNames[3]; player4Time.text = highScores [3]; player5.text = playerNames[4]; player5Time.text = highScores [4]; player6.text = playerNames[5]; player6Time.text = highScores [5]; player7.text = playerNames[6]; player7Time.text = highScores [6]; player8.text = playerNames[7]; player8Time.text = highScores [7]; if (GameObject.FindWithTag("Score") != null) { score = GameObject.FindWithTag("Score").GetComponent <ScoreContainer>(); //We don't need to make a tag and be efficient if nothing's really happening on this page } }
public YahtzeeScoreProcesses(ScoreContainer scoreContainer, YahtzeeVMData <SimpleDice> model ) { _scoreContainer = scoreContainer; _model = model; }
public YahtzeeEndRoundLogic(YahtzeeGameContainer <D> gameContainer, ScoreContainer scoreContainer ) { _gameContainer = gameContainer; _scoreContainer = scoreContainer; }
private void PerformAddition(ScoreContainer scoreContainer) { scoreContainer.health += toHealth; scoreContainer.morale += toMorale; scoreContainer.condition += toCondition; scoreContainer.fuel += toFuel; }
public string Perform(ScoreContainer scoreContainer, CharacterScreen characterScreen) { if (ending == 1) { FindObjectOfType <DialogueContainer>().first = true; } if (ending == 2) { FindObjectOfType <DialogueContainer>().first = false; } if (lines.Count == currentLineIndex) { return("+"); } string _line = lines[currentLineIndex]; if (currentLineIndex == 0) { PerformAddition(scoreContainer); } if (currentLineIndex < lines.Count) { characterScreen.Draw(characters[currentLineIndex]); } currentLineIndex++; return(_line); }
public DifficultyController( GraphicalObjectContainer graphicalObjects, ObjectGenerator objectGenerator, ScoreContainer scoreContainer) { this.graphicalObjects = graphicalObjects; this.objectGenerator = objectGenerator; this.scoreContainer = scoreContainer; }
public KismetScoreProcesses(YahtzeeGameContainer <KismetDice> gameContainer, ScoreContainer scoreContainer, YahtzeeVMData <KismetDice> model ) { _gameContainer = gameContainer; _scoreContainer = scoreContainer; _model = model; }
private void CheckGameMode() { ScoreContainer score = DataCollector.instance.getScoreContainer(); if (score.getGameMode() == GameMode.YOLOMode) { Text currentText = GetComponent <Text>(); currentText.text = yoloText; } }
public UIProfile(GameObject gameObject) : base(gameObject) { UIReferencing referencing = gameObject.GetComponent <UIReferencing>(); this.localScore = referencing.localScore; this.localScore.label.text = "YOUR SCORE"; this.enemyScore = referencing.enemyScore; this.healthContainer = referencing.healthContainer; Object.DestroyImmediate(referencing); }
public ScoreScreen(IGameScreenManager gameScreenManager, ContentManager contentManager) { _gameScreenManager = gameScreenManager; _contentManager = contentManager; _inputManager = new InputManager(_gameScreenManager); _azureStorageService = new AzureStorageService(); _globalScoreIsLoaded = false; _playerScoreContainer = new ScoreContainer(GetPlayerScores(), CommonScreenTextConstants.Score.PlayerScores, true, new Rectangle(0, 0, _gameScreenManager.GameScreenWidth, _gameScreenManager.GameScreenHeight)); }
/// <summary> /// Called when the screen is exiting /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnScreenExiting(object sender, ScreenExitingEventArgs e) { MapInformation.ClearAnimations(); MapInformation.MoveToY((int)-MapInformation.Height, Easing.OutQuint, 600); ButtonContainer.ClearAnimations(); ButtonContainer.MoveToY((int)(ScoreContainer.Y + ScoreContainer.Height + 50 + ButtonContainer.Height), Easing.OutQuint, 600); ScoreContainer.ClearAnimations(); ScoreContainer.MoveToX(ScoreContainer.Width + 100, Easing.OutQuint, 600); }
//this is all this needs to do now. public YahtzeeMove(ScoreContainer scoreContainer, IScoreLogic scoreLogic, YahtzeeVMData <D> model, IYahtzeeEndRoundLogic endRoundLogic, YahtzeeGameContainer <D> gameContainer) { _scoreContainer = scoreContainer; _scoreLogic = scoreLogic; _model = model; _endRoundLogic = endRoundLogic; _gameContainer = gameContainer; }
private void CreateScoreContainer() { ScoreContainer.Ctx scoreCtx = new ScoreContainer.Ctx { score = _rootView.Score, maxScore = _rootView.MaxScore, parent = _rootView.gameObject, playerData = _ctx.playerData, }; _scoreContainer = new ScoreContainer(scoreCtx); _rootView.OnHeroDeath += _scoreContainer.OnHeroDeath; }
void Start() { this.scoreContainer = new ScoreContainer(); Cursor.visible = false; Screen.fullScreen = true; //Screen.SetResolution(1600, 800, true); scoreText = GameObject.FindGameObjectWithTag(CustomTags.Score); Text textCompoent = scoreText.GetComponent <Text>(); textCompoent.text = "Score: 0"; }
private void Awake() { if (this.notePrefab == null) { throw new NullReferenceException("Missing Note prefab object"); } this.bars = this.gameObject.GetComponentsInChildren <BarController>(); if (this.bars.Length != 4) { throw new NullReferenceException("Missing bar object"); } this.score = new ScoreContainer(this as IMusicalScore); }
public YahtzeeScoresheetViewModel( CommandContainer commandContainer, ScoreContainer scoreContainer, IEventAggregator aggregator, YahtzeeGameContainer <D> gameContainer, IYahtzeeMove yahtzeeMove ) { CommandContainer = commandContainer; _scoreContainer = scoreContainer; _aggregator = aggregator; _gameContainer = gameContainer; _yahtzeeMove = yahtzeeMove; }
public static bool HasStraight(this ScoreContainer scoreContainer, bool smallOnly) { var tempList = scoreContainer.DiceList.OrderBy(items => items.Value).GroupBy(items => items.Value).ToCustomBasicList(); if (tempList.Count != 5 && smallOnly == false) { return(false); } if (tempList.Count < 4) { return(false); } //focus on large first. if (tempList.Count == 5) { if (tempList.First().Key == 1 && tempList.Last().Key == 6 && smallOnly == false) { return(false); } else if (smallOnly == false) { return(true); } bool rets = false; for (int x = 1; x <= 3; x++) { for (int y = x; y <= x + 3; y++) { rets = tempList.Any(Items => Items.Key == y); if (rets == false) { break; } } if (rets == true) { return(true); } } return(false); } for (int x = 1; x <= 3; x++) { if (tempList.First().Key == x && tempList.Last().Key == x + 3) { return(true); } } return(false); }
public static bool HasFullHouse(this ScoreContainer scoreContainer) { var tempList = scoreContainer.DiceList.GroupOrderDescending(items => items.Value); if (tempList.Count() != 2) { return(false); } if (tempList.First().Count() != 3) { return(false); } return(true); }
// Use this for initialization void Awake() { Debug.Log(container); if (container == null) { container = this; Debug.Log(container); DontDestroyOnLoad(gameObject); } else if (container != this) { Destroy(gameObject); } }
public KismetMissTurn( YahtzeeVMData <KismetDice> model, TestOptions thisTest, IAsyncDelayer delay, IScoreLogic scoreLogic, ScoreContainer scoreContainer, YahtzeeGameContainer <KismetDice> gameContainer ) { _model = model; _thisTest = thisTest; _delay = delay; _scoreLogic = scoreLogic; _scoreContainer = scoreContainer; _gameContainer = gameContainer; }
/* * Ends game. Returns to main menu * */ public void ExitGame() { Time.timeScale = 1.0f; Destroy(GameObject.Find("CharacterSelectManager")); Screen.lockCursor = false; Screen.showCursor = true; ScoreContainer score = Instantiate(scoreObject) as ScoreContainer; score.rounds = roundCounter; score.totalTime = totalTime; DontDestroyOnLoad(score); //Check player scores, then if they don't have a high score, go to the main menu. //Otherwise, they win! Take them to the leaderboard scene and make them type their name in Application.LoadLevel("leaderboard"); }
public static void Load() { if (!File.Exists(dataPath)) { TextAsset textAsset = (TextAsset)Resources.Load("Score"); File.WriteAllBytes(dataPath, textAsset.bytes); } var serializer = new XmlSerializer(typeof(ScoreContainer)); using (var stream = new FileStream(dataPath, FileMode.Open)) { _scoreContainer = serializer.Deserialize(stream) as ScoreContainer; } }
private void RegisterAnimationQueue(Queue <ScoreData> animationWorkQueue, ScoreContainer score) { if (score.getGameMode() == GameMode.NormalMode) { AddAnimationEntry(animationWorkQueue, HighscoreType.WaveCount, score.getWaveMultiplier(), score.getWaveScore()); } else { AddAnimationEntry(animationWorkQueue, HighscoreType.WaveCount, score.getYoloScore(), score.getYoloScore()); // Only show wave score not the multiplier -> In YOLO-Mode there should be no wave multiplier } AddAnimationEntry(animationWorkQueue, HighscoreType.PolygonTriggered, score.getPolysTriggered(), score.getPolysTriggeredScore()); AddAnimationEntry(animationWorkQueue, HighscoreType.PolyKill, score.getPolyKills(), score.getPolyKillsScore()); AddAnimationEntry(animationWorkQueue, HighscoreType.LinecutKill, score.getCutKills(), score.getCutKillsScore()); AddAnimationEntry(animationWorkQueue, HighscoreType.BossKill, score.getBossKills(), score.getBossKillsScore()); AddAnimationEntry(animationWorkQueue, HighscoreType.PowerUpsGathered, score.getPowerupsCollected(), score.getPowerupsCollectedScore()); AddAnimationEntry(animationWorkQueue, HighscoreType.RevivalExpenses, score.getPlayerRevivals(), score.getPlayerRevivalsScore()); }
public void Update(GameTime gameTime) { _playerScoreContainer.Update(gameTime); if (_globalScoreIsLoaded && _globalScoreContainer != null) { _globalScoreContainer.Update(gameTime); } if (_globalScoreIsLoaded && _globalScoreContainer == null) { _globalScoreContainer = new ScoreContainer(_globalScores, CommonScreenTextConstants.Score.GlobalScores, false, new Rectangle(0, 0, _gameScreenManager.GameScreenWidth, _gameScreenManager.GameScreenHeight)); _globalScoreContainer.LoadContent(_contentManager); _globalScoreContainer.Init(); } }
void OnTriggerEnter(Collider other) { if (other.gameObject.CompareTag("Collectable")) { Collectable = other.gameObject; ScoreContainer scoreContainer = Collectable.GetComponent <ScoreContainer>(); //otherRB = other.gameObject.GetComponent<Rigidbody>(); displayCount = displayCount + scoreContainer.count; displayScore = displayScore + scoreContainer.score; UpdateProgressbar(); otherObject = other.gameObject.transform.position; CollectablePointTrigger(); other.gameObject.SetActive(false); audioSource.PlayOneShot(collectibleClip, 1f); GameObject clone = Instantiate(shine, other.gameObject.transform.position, Quaternion.identity); Destroy(clone, 2f); } }
public void CheckInkrementalAhivements() { ScoreContainer scoreConatiner = scoreController.scoreContainer; playServices.IncrementAchievement(GPGSIds.achievement_incremental_achievement_1, (int)(scoreConatiner.BumperScore)); playServices.IncrementAchievement(GPGSIds.achievement_incremental_achievement_2, (int)(scoreConatiner.SingshotScore)); playServices.IncrementAchievement(GPGSIds.achievement_incremental_achievement_3, (int)(scoreConatiner.TriggerScore)); playServices.IncrementAchievement(GPGSIds.achievement_incremental_achievement_4, (int)(scoreConatiner.TeleportScore)); playServices.IncrementAchievement(GPGSIds.achievement_incremental_achievement_5, (int)(scoreConatiner.BlackHolerScore)); if (scoreController.levelController.score >= 5000) { playServices.UnlockAchievement(GPGSIds.achievement_achievement_3); } if (scoreController.levelController.score >= 50000) { playServices.UnlockAchievement(GPGSIds.achievement_achievement_4); } }
/// <summary> /// creates a new session, notifies server and retrieves session id /// * should be called at the beginning of game session (before level starts) /// </summary> public void startSession(GameMode mode) { if (enabled) { // if a session is still running, warn if (sessionRunning) { //endSession(); Debug.LogError("[DataCollector] starting new session when there is still one running."); } StartCoroutine(TestConnection()); // create new session currentSession = new Session(mode); currentSession.steamId = SteamManager.Instance.GetSteamID(); currentSession.steamName = SteamManager.Instance.GetSteamName(); sessionRunning = true; switch (GameManager.GameManagerInstance.CurrentGameMode) { case GameMode.NormalMode: currentSession.mode = "normal"; break; case GameMode.YOLOMode: currentSession.mode = "yolo"; break; } // upload session StartCoroutine(UploadSession()); GameManager.WaveStarted += () => { new Event(Event.TYPE.waveUp).addWave().send(); }; PlayerManager.AllPlayersDeadEventHandler += () => { endSession(); }; // reset score score = 0; intermediateScore = 0; scoreContainer = new ScoreContainer(); } }
public BasicYahtzeeGame(IGamePackageResolver mainContainer, IEventAggregator aggregator, BasicData basicData, TestOptions test, YahtzeeVMData <D> currentMod, IMultiplayerSaveState state, IAsyncDelayer delay, CommandContainer command, YahtzeeGameContainer <D> gameContainer, IScoreLogic scoreLogic, ScoreContainer scoreContainer, IYahtzeeEndRoundLogic endRoundLogic, StandardRollProcesses <D, YahtzeePlayerItem <D> > roller) : base(mainContainer, aggregator, basicData, test, currentMod, state, delay, command, gameContainer, roller) { _gameContainer = gameContainer; _scoreLogic = scoreLogic; _scoreContainer = scoreContainer; _endRoundLogic = endRoundLogic; _model = currentMod; _scoreContainer.StartTurn = (() => SingleInfo !.MissNextTurn = false); }
private void Initialize() { menuManager = GetComponent <AbstractMenuManager>(); menuManager.ComponentSelected += SkipScoreAnimation; // Resize to 0 scoreContainer.localScale = Vector3.zero; scoreText.rectTransform.localScale = Vector3.zero; InitializeWaitForSeconds(); // Event game name (Only active if this is an event build) ScoreContainer scoreData = DataCollector.instance.getScoreContainer(); if (DataCollector.instance.eventBuild) { eventGameName.gameObject.SetActive(true); eventGameName.text = string.Format(eventGameName.text, scoreData.getGameName()); } // Init highscore entries originalScoreText = scoreText.text.ToString(); foreach (Transform child in scoreContainer.transform) { Text textItem = child.GetComponent <Text>(); Text scoreNumberText = child.GetChild(0).GetComponent <Text>(); HighscoreIdentifier scoreType = child.GetComponent <HighscoreIdentifier>(); highscoreEntries.Add(scoreType.ScoreType, new ScoreData(textItem, scoreNumberText)); } // Init player count and levelname string splittedLevelName = Regex.Replace(scoreData.getLevelName(), "([a-z](?=[A-Z])|[A-Z](?=[A-Z][a-z]))", "$1 "); playerCountLevelName.text = string.Format(playerCountLevelName.text, scoreData.getPlayerCount(), scoreData.getLevelName() == "" ? "?" : splittedLevelName.ToUpper()); }