Exemplo n.º 1
0
    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");
        }
    }
Exemplo n.º 2
0
    // 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
        }
    }
Exemplo n.º 3
0
 public YahtzeeScoreProcesses(ScoreContainer scoreContainer,
                              YahtzeeVMData <SimpleDice> model
                              )
 {
     _scoreContainer = scoreContainer;
     _model          = model;
 }
Exemplo n.º 4
0
 public YahtzeeEndRoundLogic(YahtzeeGameContainer <D> gameContainer,
                             ScoreContainer scoreContainer
                             )
 {
     _gameContainer  = gameContainer;
     _scoreContainer = scoreContainer;
 }
Exemplo n.º 5
0
 private void PerformAddition(ScoreContainer scoreContainer)
 {
     scoreContainer.health    += toHealth;
     scoreContainer.morale    += toMorale;
     scoreContainer.condition += toCondition;
     scoreContainer.fuel      += toFuel;
 }
Exemplo n.º 6
0
    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);
    }
Exemplo n.º 7
0
 public DifficultyController(
     GraphicalObjectContainer graphicalObjects,
     ObjectGenerator objectGenerator,
     ScoreContainer scoreContainer)
 {
     this.graphicalObjects = graphicalObjects;
     this.objectGenerator  = objectGenerator;
     this.scoreContainer   = scoreContainer;
 }
Exemplo n.º 8
0
 public KismetScoreProcesses(YahtzeeGameContainer <KismetDice> gameContainer,
                             ScoreContainer scoreContainer,
                             YahtzeeVMData <KismetDice> model
                             )
 {
     _gameContainer  = gameContainer;
     _scoreContainer = scoreContainer;
     _model          = model;
 }
Exemplo n.º 9
0
    private void CheckGameMode()
    {
        ScoreContainer score = DataCollector.instance.getScoreContainer();

        if (score.getGameMode() == GameMode.YOLOMode)
        {
            Text currentText = GetComponent <Text>();
            currentText.text = yoloText;
        }
    }
Exemplo n.º 10
0
    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);
    }
Exemplo n.º 11
0
        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));
        }
Exemplo n.º 12
0
        /// <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;
        }
Exemplo n.º 14
0
 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;
 }
Exemplo n.º 15
0
    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";
    }
Exemplo n.º 16
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;
 }
Exemplo n.º 18
0
        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);
        }
Exemplo n.º 19
0
        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);
        }
Exemplo n.º 20
0
 // 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);
     }
 }
Exemplo n.º 21
0
 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;
 }
Exemplo n.º 22
0
    /*
     * 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");
    }
Exemplo n.º 23
0
    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;
        }
    }
Exemplo n.º 24
0
 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());
 }
Exemplo n.º 25
0
        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();
            }
        }
Exemplo n.º 26
0
 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);
     }
 }
Exemplo n.º 27
0
    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);
        }
    }
Exemplo n.º 28
0
    /// <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);
 }
Exemplo n.º 30
0
    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());
    }
Exemplo n.º 31
0
    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;
        }
    }