Exemple #1
0
 // checks if it is time to spawn a "drift" piece
 void UpdateDriftSpawn()
 {
     driftTimer -= Time.deltaTime;
     if (driftTimer <= 0)
     {
         Piece p;
         if (isForTitleScreen)
         {
             p = TitlePieceFactory.CreateDriftingPiece();
         }
         else
         {
             p = PieceFactory.CreateDriftingPiece();
         }
         // show the tutorial when the first piece appears onscreen
         if (!isForTitleScreen && isFirstDriftingPiece && Globals.ShowTutorial)
         {
             // make the first piece uncatchable until the tutorial has shown
             if (p != null)
             {
                 p.isUncatchable = true;
                 tutorialPiece   = p;
             }
             SjTutorialMenu.ShowTutorial(.6f);
         }
         isFirstDriftingPiece = false;
         driftTimer           = currentDriftRate;
     }
 }
Exemple #2
0
        void OnGridCleared()
        {
            // we need to destory any dropping pieces before building a new grid,
            // as it can cause some buggy behavior if they collide while the grid is expanding
            Piece.DestroyAllDroppingPieces();
            GameMode.IncrementTimeAttack();

            // show the tutorial for the first grid cleared
            if (Globals.ShowTutorial && isFirstGridCleared)
            {
                SjTutorialMenu.ShowTutorial();
            }
            isFirstGridCleared = false;

            snd.PlaySound(SjSounds.gridClear, .5f);
        }
Exemple #3
0
        void CatchPiece(Piece p)
        {
            // add the piece to the queue, assuming it is not full
            if (shootQueue.AddPieceToQueue(p.color))
            {
                UpdateNextPiece();
                shootQueueHUD.UpdateHUD(ref shootQueue);
                snd.PlaySound(SjSounds.pieceClick01);
                p.QueueToDestroy();
                Globals.cursor.PlayShootAnim();
                Globals.score.AddPointsForCatch(shootQueue.Count);
            }

            if (isFirstPieceCaught && Globals.ShowTutorial)
                SjTutorialMenu.ShowTutorial();
            isFirstPieceCaught = false;
        }