// Use this for initialization
 void Start()
 {
     creater          = this.GetComponent <PuyoCreater>();
     controller       = this.GetComponent <PuyoController>();
     puyoArr          = new Puyo[6, 13];
     puyoGroupObj     = puyoGroup;
     gameOverObj      = gameOver;
     puyoInventory    = new Queue <Puyo>();
     gameStatus       = GameStatus.GameInitializing;
     mainPuyoShinyObj = mainPuyoShiny;
 }
Exemple #2
0
    // Update is called once per frame
    void FixedUpdate()
    {
        if (gameStatus == GameStatus.GameInitializing)
        {
            puyoInventory.Enqueue(PuyoCreater.PuyoCreate(100, 175));
            puyoInventory.Enqueue(PuyoCreater.PuyoCreate(100, 143));
            puyoInventory.Enqueue(PuyoCreater.PuyoCreate(100, 50));
            puyoInventory.Enqueue(PuyoCreater.PuyoCreate(100, 18));

            gameStatus = GameStatus.PuyoCreating;
        }

        if (gameStatus == GameStatus.PuyoCreating)
        {
            PuyoController.puyoCreate();
            gameStatus = GameStatus.PuyoFalling;
        }

        if (gameStatus == GameStatus.PuyoFalling)
        {
            if (falling)
            {
                StartCoroutine("fallingGap");
                falling = false;
            }
        }

        if (gameStatus == GameStatus.PuyoArranging)
        {
            PuyoController.puyoArrange();
            gameStatus = GameStatus.PuyoLinking;
        }

        if (gameStatus == GameStatus.PuyoLinking)
        {
            PuyoController.resetPuyoStatusAndLinkPuyoList();
            PuyoController.linkSamePuyo();
            gameStatus = GameStatus.ComboCalculating;
        }

        if (gameStatus == GameStatus.ComboCalculating)
        {
            if (PuyoController.readyToEliminatePuyo())
            {
                StartCoroutine("statusChangingGap");
                gameStatus = GameStatus.GamePause;
            }
            else
            {
                gameStatus = GameStatus.PuyoCreating;
            }
        }
    }
Exemple #3
0
 void Start()
 {
     eventManager.OnRowDeleteEvent += deleteRows;
     if (singleton != null)
     {
         image_controller = singleton.GetComponent <ImageController>();
     }
     if (player_object != null)
     {
         player  = player_object.GetComponent <GameMaster>();
         creater = player_object.GetComponent <PuyoCreater>();
     }
 }
 public static void puyoCreate()
 {
     GameMaster.controlMainPuyo = GameMaster.puyoInventory.Dequeue();
     GameMaster.controlSubPuyo  = GameMaster.puyoInventory.Dequeue();
     GameMaster.puyoInventory.ElementAt(1).getPuyoObj().transform.localPosition = new Vector3(100, 175, 0);
     GameMaster.puyoInventory.ElementAt(0).getPuyoObj().transform.localPosition = new Vector3(100, 143, 0);
     GameMaster.puyoInventory.Enqueue(PuyoCreater.PuyoCreate(100, 18));
     GameMaster.puyoInventory.Enqueue(PuyoCreater.PuyoCreate(100, 50));
     GameMaster.controlMainPuyo.getPuyoObj().transform.localPosition = new Vector3(0, 208, 0);
     GameMaster.controlSubPuyo.getPuyoObj().transform.localPosition = new Vector3(0, 240, 0);
     GameMaster.controlMainPuyo.setPosition(new Vector2(3, 12));
     GameMaster.controlSubPuyo.setPosition(new Vector2(3, 13));
     GameMaster.subPuyoDirection = 0;
     GameMaster.comboNumber      = 0;
     GameMaster.mainPuyoShinyObj.transform.localPosition = new Vector3(0, 208, 0);
     GameMaster.mainPuyoShinyObj.transform.SetAsLastSibling();
     ImageController.setShinyPuyo(GameMaster.controlMainPuyo.getColor());
 }