Esempio n. 1
0
        public override IEnumerator ClearBoard(float blockDestructionDelay)
        {
            gameMode.message.ContinueAnimation();

            GameControl.Instance.CurrentPiece.gameObject.SetActive(false);
            yield return(gameMode.WaitForSecondsWrapper(1f));

            gameMode.complicationPreview.StartCrossFade = true;

            //GameObject arrow = Instantiate(controlHintPrefab, new Vector3(levelProgressIndicator.transform.position.x - 2f, levelProgressIndicator.transform.position.y, 0f), Quaternion.identity) as GameObject;
            GameObject arrow = GameMode.Instantiate(gameMode.controlHintPrefab, new Vector3(2.4f, 9.2f, 0f), Quaternion.identity) as GameObject;

            arrow.GetComponent <tk2dSprite>().SetSprite("Arrow");
            arrow.GetComponent <tk2dSprite>().scale = new Vector3(-0.75f, 0.75f);
            gameMode.controlHints.Add(arrow.GetComponent <ControlHint>());

            gameMode.message.Text = I2.Loc.ScriptLocalization.Get("Instructions/PieceComplexity"); //"Pieces will get more complex as the game goes on.";
            gameMode.message.PlayAnimation();

            gameMode.currentState = new BoardPaintingState(gameMode);
            GameControl.Instance.processNextMove = false;

            yield return(gameMode.WaitForSecondsWrapper(1f));

            var enumerator = gameMode.WaitForSecondsOrTap(2f);

            while (enumerator.MoveNext())
            {
                yield return(enumerator.Current);
            }
        }
        public override IEnumerator StartGame(float delay)
        {
            yield return(gameMode.WaitForSecondsWrapper(delay));

            gameMode.message.Text = I2.Loc.ScriptLocalization.Get("Instructions/GameGoal");
            gameMode.message.PlayAnimation();

            yield return(gameMode.WaitForSecondsWrapper(1f));

            var enumerator = gameMode.WaitForSecondsOrTap(3f);

            while (enumerator.MoveNext())
            {
                yield return(enumerator.Current);
            }

            gameMode.message.ContinueAnimation();

            yield return(gameMode.WaitForSecondsWrapper(1f));
        }
Esempio n. 3
0
        public override IEnumerator BeforeClear()
        {
            if (lifeUsageMoves == 2)
            {
                gameMode.message.ContinueAnimation();

                var position = gameMode.GameController.CurrentPiece.transform.position;
                arrow = GameMode.Instantiate(gameMode.controlHintPrefab, position, Quaternion.identity) as GameObject;
                arrow.GetComponent <tk2dSprite>().SetSprite("Arrow");
                arrow.GetComponent <tk2dSprite>().scale = new Vector3(0.75f, 0.75f);
                gameMode.controlHints.Add(arrow.GetComponent <ControlHint>());

                gameMode.message.Text = I2.Loc.ScriptLocalization.Get("Instructions/LifeTile");
                gameMode.message.PlayAnimation();

                yield return(gameMode.WaitForSecondsWrapper(2f));

                var enumerator = gameMode.WaitForSecondsOrTap(1f);
                while (enumerator.MoveNext())
                {
                    yield return(enumerator.Current);
                }
            }
        }
        public override IEnumerator ClearBoard(float blockDestructionDelay)
        {
            gameMode.message.ContinueAnimation();

            GameControl.Instance.CurrentPiece.gameObject.SetActive(false);
            yield return(gameMode.WaitForSecondsWrapper(1.1f));

            int[,] boardConfig =
            {                     { 1, 0, 1, 1, 0, 1, 1 },
                                  { 1, 1, 1, 1, 1, 1, 1 },
                                  { 1, 1, 0, 1, 1, 1, 1 },
                                  { 1, 1, 1, 1, 0, 1, 1 },
                                  { 1, 0, 1, 1, 1, 0, 1 },
                                  { 1, 1, 1, 1, 1, 1, 1 } };
            Board.Instance.SetBoard(boardConfig, GameControl.Instance.CurrentPiece.blockPrefab);
            gameMode.GameController.lifeCounter.Count = 0;
            gameMode.message.Text = I2.Loc.ScriptLocalization.Get("Instructions/GameOver"); //"No moves or lives means GAME OVER.";
            gameMode.message.PlayAnimation();

            GameUIController.Instance.noMoreMovesMessage.GetComponents <dfTweenGroup>().Single(tg => tg.TweenName == "TweenCombined").Play();
            GameUIController.Instance.gameOverMessage.GetComponents <dfTweenVector3>().Single(t => t.TweenName == "TweenIn").Play();
            yield return(gameMode.WaitForSecondsWrapper(1.75f));

            var enumerator = gameMode.WaitForSecondsOrTap(1f);

            while (enumerator.MoveNext())
            {
                yield return(enumerator.Current);
            }
            gameMode.currentState = new TutorialEndState(gameMode);
            enumerator            = gameMode.currentState.ClearBoard(blockDestructionDelay);
            while (enumerator.MoveNext())
            {
                yield return(enumerator.Current);
            }
        }
Esempio n. 5
0
        public override IEnumerator ClearBoard(float blockDestructionDelay)
        {
            int[,] boardConfig0 =
            {        { 0, 0, 0, 0, 0, 0 },
                     { 0, 0, 0, 0, 0, 0 },
                     { 0, 0, 0, 0, 0, 0 },
                     { 0, 0, 0, 0, 0, 0 },
                     { 0, 0, 0, 0, 0, 0 },
                     { 0, 0, 0, 0, 0, 0 } };
            Board.Instance.SetBoard(boardConfig0, GameControl.Instance.CurrentPiece.blockPrefab);

            gameMode.message.ContinueAnimation();
            gameMode.controlHints.ForEach(c => c.FadeOut());
            gameMode.controlHints.RemoveAll(x => true);
            yield return(gameMode.WaitForSecondsWrapper(1f));

            gameMode.message.Text = I2.Loc.ScriptLocalization.Get("Instructions/BoardPainting");
            gameMode.message.PlayAnimation();
            GameObject arrow = GameMode.Instantiate(gameMode.controlHintPrefab, new Vector3(9.6f, 5.4f, 0f), Quaternion.identity) as GameObject;

            arrow.GetComponent <tk2dSprite>().SetSprite("Arrow");
            arrow.GetComponent <tk2dSprite>().scale        = new Vector3(-0.75f, 0.75f);
            arrow.GetComponent <tk2dSprite>().SortingOrder = 4;

            yield return(gameMode.WaitForSecondsWrapper(1f));

            var enumerator = gameMode.WaitForSecondsOrTap(3f);

            while (enumerator.MoveNext())
            {
                yield return(enumerator.Current);
            }

            arrow.GetComponent <ControlHint>().FadeOut();
            gameMode.message.ContinueAnimation();
            yield return(gameMode.WaitForSecondsWrapper(1f));

            int[,] boardConfig =
            {    { 0, 0, 0, 0, 0, 0 },
                 { 0, 1, 0, 1, 1, 0 },
                 { 0, 1, 0, 0, 1, 0 },
                 { 0, 0, 0, 0, 1, 0 },
                 { 0, 1, 1, 1, 1, 0 },
                 { 0, 0, 0, 0, 0, 0 } };
            Board.Instance.SetBoard(boardConfig, GameControl.Instance.CurrentPiece.blockPrefab);

            //Unpainting the center
            for (int i = 0; i < Board.Instance.SlotGrid.Width; i++)
            {
                for (int j = 0; j < Board.Instance.SlotGrid.Height; j++)
                {
                    Board.Instance.SlotGrid[i, j].GlowEnd();
                }
            }

            //Painting the borders
            var boardWidth  = Board.Instance.SlotGrid.Width;
            var boardHeight = Board.Instance.SlotGrid.Height;

            for (int i = 0; i < boardWidth; i++)
            {
                for (int j = 0; j < boardHeight; j++)
                {
                    if (i == 0 || i == boardWidth - 1 || j == 0 || j == boardHeight - 1)
                    {
                        Board.Instance.SlotGrid[i, j].GlowStart();
                    }
                }
            }

            yield return(gameMode.WaitForSecondsWrapper(1f));

            gameMode.message.Text = I2.Loc.ScriptLocalization.Get("Instructions/BoardClear"); //"Clearing blocks on the whole board\r\nawards lots of points and a life.";
            gameMode.message.PlayAnimation();
            GameControl.Instance.CurrentPiece.gameObject.SetActive(true);

            gameMode.currentState = new BoardExpansionState(gameMode);
        }