Example #1
0
        public void Stop()
        {
            if (CurrentBlock != null)
            {
                CurrentBlock.Stop();
            }
            _dispatcherTimer.Stop();

            ButtonStartStopText       = AppResources.ButtonStart;
            ButtonStartStopBackground = Common.GreenColorBrush;

            PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Enabled;
        }
Example #2
0
        private void StartNextBlock()
        {
            if (CurrentBlock == null)
            {
                return;
            }

            if (CurrentBlock.IsRunning)
            {
                CurrentBlock.Stop();
                var oldBlock = CurrentBlock;
                Blocks.RemoveAt(0);
                Blocks.Add(oldBlock);
            }
            CurrentBlock.Start();
        }
Example #3
0
    //This method is calling the Stop() method when the startingblock collides with the stack
    //onTrigger the Stop() method will be called and the block will be trimmed, aswell as the verticalmovement will be set to 0

    private void OnTriggerEnter2D(Collider2D other)
    {
        //calls upon the currentBlock and calls the stop method onto it
        if (other.gameObject.tag == "WallRight" || other.gameObject.tag == "WallLeft")
        {
            return; //Do nothing
        }
        if (other.gameObject.tag == "Obstacle")
        {
            return; //Do nothing
        }
        if (other.gameObject.tag == "Floor")
        {
            GameManager.gameManager.gameOver = true;
        }
        if (other.gameObject.tag == "Spike")
        {
            GameManager.gameManager.playDestroySound     = true;
            GameManager.gameManager.collidedWithObstacle = true;
            GameManager.gameManager.ResetCombo();
        }
        if (other.gameObject.tag == "Stack")
        {
            //this is done so that it checks for a single collision, and doesnt let more happen
            if (colliding == 0)
            {
                CurrentBlock.Stop();
                _verticalMovement = 0;

                //makes the currentblock into the lastblock after it is placed so that we can switch between the blocks
                //gives the block the tag 'Stack' after it is placed
                gameObject.tag = "Stack";
                LastBlock      = CurrentBlock;
                gameManager.ComboLifeSystem();
                gameManager.DifficultyProgression();
                //sets the hasStacked boolean to true
                hasStacked = true;
                colliding++;
                StartCoroutine(Reset());
                //calls the coroutine to reset the colliding integer to zero
            }
        }
    }