Ejemplo n.º 1
0
    public void Start()
    {
        Player = GameObject.Find("Player");
        BoxCollider2D collider = GetComponent <BoxCollider2D>();

        playArea = new PlayArea(new Vector2(0, 0), new Vector2(collider.bounds.size.x, collider.bounds.size.y));
    }
Ejemplo n.º 2
0
    //IEnemyComponent

    public virtual void Initialize(Player[] players, GameplayMode gameplayMode, PlayArea playArea)
    {
        this.players      = players;
        this.gameplayMode = gameplayMode;
        this.playArea     = playArea;
        //for example initialize movement and weapons
    }
Ejemplo n.º 3
0
    public bool attemptToPlayCard()
    {
        if (isCardPlayable())
        {
            character.actions--;
            character.energy -= getEnergyPlayCost();
            character.focus  -= getFocusPlayCost();
            character.hand.removeFromHand(cardBase);
            character.refreshUI();

            cardBase.transform.parent = PlayArea.Instance().transform;
            cardBase.startLerp(PlayArea.Instance().getNextStackPosition());

            StackController.Instance().addToStack(cardBase);
            cardBase.transform.localEulerAngles = new Vector3(0, 0, 0);
            cardBase.hovered            = false;
            cardBase.hoverLerping       = false;
            cardBase.beingPlayedLerping = true;
            character.refreshUI();
            character.hand.checkHandGlow();
            cardBase.setGlow(false);
            PlayerCardProgress.Instance().cardExpGain(this);

            return(true);
        }

        return(false);
    }
Ejemplo n.º 4
0
        //Move DOWN -- @Soeed1 -- NOT used
        public bool canMoveDown(PlayArea Area, B1tTracker existingBits)
        {
            bool canMove = true;

            //Check 0; Out of bounds
            if (this.PosY + this.vSpeed >= Area.Height)
            {
                return(false);
            }

            //check 1: if row contains ANY 1s
            if (!existingBits.rowTracker[this.PosY + 1].Contains('1'))
            {
                return(true);
            }


            string toCheck = existingBits.rowTracker[this.PosY + 1].Substring(this.firstX, this.toPrint.Length);

            toCheck = toCheck.Replace(' ', '0');
            int Check = Convert.ToInt32(toCheck, 2);

            if ((Check & this.intValue) > 0)
            {
                canMove = false;
            }

            return(canMove);
        }
Ejemplo n.º 5
0
 public PlatoonPlayer(PlayArea playArea, bool isOpponent)
 {
     cardsInHand     = new List <Card>();
     this.playArea   = playArea;
     this.isOpponent = isOpponent;
     numberOfWins    = 0;
 }
Ejemplo n.º 6
0
 /*========================= Level >> CTOR ===========================*/
 public Level(PlayArea play) : base(play)
 {
     Player = new Player(this);
     Enemy  = new EnemyGenerator(this, Player);
     Objects.Add(Player);
     Objects.Add(Enemy);
 }
Ejemplo n.º 7
0
            void OnInitializePlayArea()
            {
                if (shouldPlayAreaBeApplied)
                {
                    PlayArea playAreaInstance = createPlayAreaInstance();

                    if (isMovementBoundToPlayArea == false)
                    {
                        if (HMDSimulator.isUsingSteamRig)
                        {
                            playAreaInstance.setParent(HMDSimulator.CameraRig);
                        }
                        else
                        {
                            playAreaInstance.setParent(HMDSimulator.CameraRig.root);
                        }
                    }

                    setPlayArea(playAreaInstance);

                    if (playAreaDisplayTrigger == PlayAreaDisplayTrigger.OnInputAction)
                    {
                        playArea.gameObject.SetActive(false);
                    }
                    else if (playAreaDisplayTrigger == PlayAreaDisplayTrigger.OnApproach && _playArea.getDistance() > playAreaDisplayOnApproachDistance)
                    {
                        playArea.gameObject.SetActive(false);
                    }

                    EventManager.endInitializePlayArea();
                }
            }
Ejemplo n.º 8
0
 public static PlayArea Instance()
 {
     if (!playArea)
     {
         playArea = FindObjectOfType <PlayArea>();
     }
     return(playArea);
 }
Ejemplo n.º 9
0
 public override void Initialize(Player[] players, GameplayMode mode, PlayArea playArea)
 {
     base.Initialize(players, mode, playArea);
     bulletDirectionScale = GetDirectionScaleVector();
     SetAppropriateBulletPool();
     chargeEffectPool = ParticleEffectPool.GetPool(ParticleEffectPool.EffectType.CHARGE_ENEMY);
     initialized      = true;
 }
Ejemplo n.º 10
0
 private void SetScripts(bool state)
 {
     Camera.main.GetComponent <CameraManager>().enabled = state;
     playAreaScript = GameObject.Find("PlayArea").GetComponent <PlayArea>();
     //playAreaScript.SetPlatformScripts(state);
     playAreaScript.enabled = state;
     playerScript.enabled   = state;
 }
Ejemplo n.º 11
0
 private void SmileGuy_MouseUp(object sender, EventArgs e)
 {
     SmileGuy.BackgroundImage = ImageLibrary[100];
     SetVariables(Rows, Columns, NumberOfMines);
     PlayArea.Dispose();
     SetMineCells();
     FlagsRemainingLabel.Text = FlagsRemaining.ToString();
     PlayArea.Invalidate();
 }
Ejemplo n.º 12
0
 public override void Initialize(Player[] players, GameplayMode gameplayMode, PlayArea playArea)
 {
     base.Initialize(players, gameplayMode, playArea);
     movement.Initialize(players, gameplayMode, playArea);
     if (weapon != null)
     {
         weapon.Initialize(players, gameplayMode, playArea);
     }
 }
Ejemplo n.º 13
0
        internal static PlayAreaVisualization Create(PlayArea playArea = null)
        {
            var visualization = new GameObject("Play Area Viszalization").AddComponent <PlayAreaVisualization>();

            if (playArea != null)
            {
                visualization.Area = playArea;
            }
            return(visualization);
        }
Ejemplo n.º 14
0
        private void MineCells_MouseDown(object sender, MouseEventArgs e)
        {
            int y = e.Y / elementLength;
            int x = e.X / elementLength;

            if (!MineCells[y, x].IsClicked && e.Button == MouseButtons.Left && !MineCells[y, x].IsMarked)
            {
                MineCells[y, x].Picture  = ImageLibrary[0];
                SmileGuy.BackgroundImage = ImageLibrary[101];
            }
            PlayArea.Invalidate();
        }
Ejemplo n.º 15
0
 private void StartPlacement()
 {
     playArea = Instantiate(PlayAreaPrefab).GetComponent <PlayArea>();
     playArea.transform.SetParent(provider.GetRoot());
     currentArea     = playArea;
     currentAreaType = AreaType.Play;
     //buildArea = BuildAreaPrefab.GetComponent<BuildArea>();
     //cookArea = CookAreaPrefab.GetComponent<CookArea>();
     //UIManager.Instance.ShowUI(HelpUI.gameObject);
     LoadingUI.SetActive(false);
     HelpUI.gameObject.SetActive(true);
 }
Ejemplo n.º 16
0
        //Move LEFT/ RIGHT
        public bool canMoveSides(PlayArea Area, B1tTracker existingBits)
        {
            bool canMove = true;

            //Check 1: Adjust speed withing Bounds
            for (int speed = Math.Abs(this.hSpeed); speed >= 0; speed--)
            {
                if (this.firstX - speed >= 1 && this.hSpeed < 0) // check left
                {
                    this.hSpeed = -speed;
                    break;
                }
                if (this.lastX + speed <= Area.Width - 2 && this.hSpeed > 0) // check right
                {
                    this.hSpeed = speed;
                    break;
                }
            }

            //Check 2: row below contains any 1s
            if (!existingBits.rowTracker[this.PosY].Contains('1'))
            {
                return(true); //if no 1s then always true
            }

            //Check3
            int newspeed = 0;

            for (int col = 0; col <= Math.Abs(this.hSpeed); col++)
            {
                if (existingBits.rowTracker[this.PosY][this.firstX - col] == '1' && this.hSpeed < 0)
                {
                    newspeed = -col + 1;
                    break;
                }
                else if (this.hSpeed < 0)
                {
                    newspeed = -col;
                }
                if (existingBits.rowTracker[this.PosY][this.lastX + col] == '1' && this.hSpeed > 0)
                {
                    newspeed = col - 1;
                    break;
                }
                else if (this.hSpeed > 0)
                {
                    newspeed = col;
                }
            }
            this.hSpeed = newspeed;

            return(canMove);
        }
Ejemplo n.º 17
0
 private void EndGame(bool isWon)
 {
     ShowAllMines(isWon);
     SmileGuy.BackgroundImage = (isWon) ? ImageLibrary[102] : ImageLibrary[103];
     if (isWon)
     {
         FlagsRemaining           = 0;
         FlagsRemainingLabel.Text = FlagsRemaining.ToString();
     }
     PlayArea.MouseUp   -= MineCells_MouseUp;
     PlayArea.MouseDown -= MineCells_MouseDown;
     PlayArea.Invalidate();
 }
Ejemplo n.º 18
0
 public void NotifyRoundEnd()
 {
     foreach (var p in ElementManager.Instance.Team(_baseIndex))
     {
         if (PlayArea.IsInsidePlayArea(p.transform.position))   // PROXIMITY CHECK
         //apply penalty (could happen twice)
         {
             TotalMoneyPenalty += MoneyPenaltyAmount;
             RoundUI.instance.ShowEndRound(p.PlayerIndex, RoundUI.EndRoundCondition.Busted);
         }
     }
     UpdateUI();
 }
Ejemplo n.º 19
0
    void Start()
    {
        activeMask = LayerMask.GetMask("ActiveZone");
        bubbleMask = LayerMask.GetMask("Bubble");
        anim       = this.GetComponent <Animator>();
        var _pa = Physics2D.OverlapCircle(this.transform.position, 0.3f, activeMask);

        if (_pa)
        {
            CurrentPa        = _pa.GetComponent <PlayArea>();
            CurrentPa.Filled = true;
            futurePa         = CurrentPa;
        }
    }
Ejemplo n.º 20
0
 private static void RegisterPlayArea(ContainerBuilder builder)
 {
     builder.Register <PlayArea>(c =>
     {
         var mapWidth     = int.Parse(Environment.GetEnvironmentVariable("MapWidth"));
         var mapHeight    = int.Parse(Environment.GetEnvironmentVariable("MapHeight"));
         var mapGenerator = c.Resolve <IMapGenerator>();
         var playArea     = new PlayArea()
         {
             GameMap = mapGenerator.Generate(mapWidth, mapHeight)
         };
         return(playArea);
     }).As <IPlayArea>().SingleInstance();
 }
Ejemplo n.º 21
0
    public override void OnInspectorGUI()
    {
        PlayArea pa         = (PlayArea)target;
        float    prevWidth  = pa.width;
        float    prevHeight = pa.height;

        GUILayout.Box(warningLabel);
        DrawDefaultInspector();

        if (prevWidth != pa.width || prevHeight != pa.height)
        {
            pa.adjustPlayArea(pa.width, pa.height);
        }
    }
Ejemplo n.º 22
0
 public void Initialize(Player[] players, PlayArea playArea)
 {
     if (autoCreateArray)
     {
         enemies = GetComponentsInChildren <GenericEnemy>();
     }
     initialPositions = new Vector3[enemies.Length];
     initialRotations = new Quaternion[enemies.Length];
     for (int i = 0; i < enemies.Length; i++)
     {
         initialPositions[i] = enemies[i].transform.position;
         initialRotations[i] = enemies[i].transform.rotation;
         enemies[i].Initialize(players, mode, playArea);
     }
 }
Ejemplo n.º 23
0
	public void Spawn (PlayArea playArea)
	{
		hasLanded = false;
		this.playArea = playArea;
		Vector2 spawnPoint = new Vector2 (PlayArea.spawnX, PlayArea.NumberOfRows - 1);

		for (int i = 0; i < blocks.Length; i++) {
			blocks[i] = spawnPoint - blocks[i];

			if (playArea.GetBlockType (blocks[i]) != 0) {
				hasLanded = true;
			}
			playArea.SetBlockType (Mathf.FloorToInt(blocks[i].x), Mathf.FloorToInt(blocks[i].y), spriteType);
		}
	}
Ejemplo n.º 24
0
 public void GetBestMoveTest()
 {
     PlayArea playArea = new PlayArea(new Image<Bgr, byte>("testplayarea.png"), new SimpleGemClassifier());
     IMoveFinder moveFinder = new IdiotMoveFinder();
     int counter = 0;
     while(true)
     {
         Move bestMove = moveFinder.GetBestMove(playArea.ToGemArray(), 1,null);
         if (bestMove.ValidMove)
         {
             counter++;
             playArea.GemSlots[bestMove.From.Row, bestMove.From.Column].Gem.Color = GemColor.Unknown;
         }
         else
             break;
     }
 }
Ejemplo n.º 25
0
    public void Spawn(PlayArea playArea)
    {
        hasLanded     = false;
        this.playArea = playArea;
        Vector2 spawnPoint = new Vector2(PlayArea.spawnX, PlayArea.NumberOfRows - 1);

        for (int i = 0; i < blocks.Length; i++)
        {
            blocks[i] = spawnPoint - blocks[i];

            if (playArea.GetBlockType(blocks[i]) != 0)
            {
                hasLanded = true;
            }
            playArea.SetBlockType(Mathf.FloorToInt(blocks[i].x), Mathf.FloorToInt(blocks[i].y), spriteType);
        }
    }
Ejemplo n.º 26
0
    protected virtual void Start()
    {
        playArea = GetComponentInParent <PlayArea>();
        catData  = Data as CatData;

        AddState <SitState>();
        AddState <WalkState>();
        AddState <TutorialSitState>();
        AddState <TutorialWalkState>();
        AddState <EatState>();
        AddState <PetState>();
        AddState <PlayState>();
        AddState <ChaseState>();
        AddState <ChasePlayState>();

        CatManager.Instance.MarkFound(catData);
        moodValue     = CatManager.Instance.GetMoodValue(catData);
        mood          = CatManager.Instance.GetMood(catData);
        moodMat.color = CatManager.Instance.MoodColors[mood];

        if (HelpManager.Instance.CurrentStep == TutorialStep.Start)
        {
            targetPos = Vector3.zero;
            SetState <TutorialWalkState>();
        }
        else if (HelpManager.Instance.CurrentStep == TutorialStep.Mail)
        {
            targetPos = MailboxManager.Instance.transform.localPosition;
            SetState <TutorialWalkState>();
        }
        else if (HelpManager.Instance.CurrentStep == TutorialStep.GrabBook)
        {
            targetPos = BookController.Instance.transform.localPosition;
            SetState <TutorialWalkState>();
        }
        else
        {
            SetState <SitState>();
        }

        if (StayForever)
        {
            HelpManager.Instance.onCompleteTutorialStep += OnCompleteTutorialStep;
        }
    }
Ejemplo n.º 27
0
 private void OnRightMouseClick(int y, int x)
 {
     if (MineCells[y, x].IsMarked)
     {
         MineCells[y, x].IsMarked = false;
         MineCells[y, x].Picture  = ImageLibrary[-1];
         FlagsRemaining++;
         FlagsRemainingLabel.Text = FlagsRemaining.ToString();
     }
     else if (!MineCells[y, x].IsClicked)
     {
         MineCells[y, x].IsMarked = true;
         MineCells[y, x].Picture  = ImageLibrary[11];
         FlagsRemaining--;
         FlagsRemainingLabel.Text = FlagsRemaining.ToString();
     }
     PlayArea.Invalidate(new Rectangle(Points[y, x], MineCellSize));
 }
Ejemplo n.º 28
0
 // Use this for initialization
 void Awake()
 {
     _gamePlaying      = false;
     _score            = 0;
     _hiScore          = ReadHighScore();
     _hiScoreMesh.text = "Hi: " + _hiScore.ToString();
     if (FindObjectOfType <WheelScoreBoard>())
     {
         FindObjectOfType <WheelScoreBoard> ().UpdateScoreboard(this);
     }
     _scoreMesh.text = "Score: 0";
     _audioPlayer    = GetComponent <AudioSource> ();
     if (_playArea == null)
     {
         _playArea = FindObjectOfType <PlayArea> ();
     }
     _quadrant = -1;
 }
Ejemplo n.º 29
0
        //MOVE DOWN with SPEED
        public bool canMoveDownSpeed(PlayArea Area, B1tTracker existingBits)
        {
            bool canMove = true;

            //Check 0; Out of bounds

            for (int speed = this.vSpeed; speed >= 0; speed--)
            {
                if (this.PosY + speed < Area.Height)
                {
                    this.vSpeed = speed;
                    break;
                }
            }

            int newspeed = 0;

            for (int speed = 0; speed <= this.vSpeed; speed++)
            {
                string toCheck = existingBits.rowTracker[this.PosY + speed].Substring(this.firstX, this.toPrint.Length);
                toCheck = toCheck.Replace(' ', '0');
                int Check = Convert.ToInt32(toCheck, 2);

                if ((Check & this.intValue) != 0) // can NOT pass
                {
                    newspeed = speed - 1;
                    break;
                }
                else
                {
                    newspeed = speed;
                }
            }

            if (newspeed == 0)
            {
                return(false);
            }
            else
            {
                this.vSpeed = newspeed;
                return(canMove);
            }
        }
Ejemplo n.º 30
0
        public GameEngine(CancellableReceiver <GameProgress> channel, int randomSeed, Ability[] playerAbilities)
        {
            _random = new Random(randomSeed);

            var num = playerAbilities.Length;

            _area    = new PlayArea(randomSeed, num);
            _players = new Player[num];

            for (int i = 0; i < _players.Length; i++)
            {
                // とりあえずサンプルだし、ID = インデックスにしてしまう。
                _players[i] = new Player(i, (byte)i, playerAbilities[i], _area.Players[i]);
            }

            Boss = new Boss();

            channel.Execute(Execute);
        }
Ejemplo n.º 31
0
        public Square(PlayArea pPlayArea, int pRow, int pColumn, Color pDefaultColor)
        {
            Padding         = 3;
            mEmergingSquare = false;
            mDefaultColor   = pDefaultColor;
            BackgroundColor = mDefaultColor;
            mStatus         = new Grid
            {
                BackgroundColor = mDefaultColor,
                Padding         = 3
            };
            mContent = new Grid
            {
                BackgroundColor = mDefaultColor,
                Padding         = 3
            };
            mHighlightType = HighlightType.None;
            mStatuses      = new HashSet <SquareStatus>();
            mLabel         = new Label
            {
                HorizontalOptions = LayoutOptions.CenterAndExpand,
                VerticalOptions   = LayoutOptions.CenterAndExpand
            };
            mContent.Children.Add(mLabel);
            mStatus.Children.Add(mContent);
            Children.Add(mStatus);
            mPlayArea = pPlayArea;
            mRow      = pRow;
            mColumn   = pColumn;

            TapGestureRecognizer singleTap = new TapGestureRecognizer();

            singleTap.Tapped += SingleTap;
            singleTap.NumberOfTapsRequired = 1;
            GestureRecognizers.Add(singleTap);

            TapGestureRecognizer doubleTap = new TapGestureRecognizer();

            doubleTap.Tapped += DoubleTap;
            doubleTap.NumberOfTapsRequired = 2;
            GestureRecognizers.Add(doubleTap);
        }
Ejemplo n.º 32
0
        // Set up Initial game State.
        private void InitializeBoard()
        {
            Graphics Graphics = PlayArea.CreateGraphics();
            int      SpacerX  = 1;
            int      SpacerY  = 1;

            // Set Ball Position
            int X = (PlayArea.Width / 2) - (Ball.Radius / 2);
            int Y = (PlayArea.Height / 2) - (Ball.Radius / 2);

            Ball.Position  = new Position(X, Y);
            Ball.Direction = new Direction(0, 2);

            // Set Paddle Position
            X = (PlayArea.Bounds.Width / 2) - (Paddle.Width / 2);
            Y = PlayArea.Bounds.Height - Paddle.Height;
            Paddle.Position = new Position(X, Y);

            // Draw
            Ball.Draw(Graphics);
            Paddle.Draw(Graphics);

            // X & Y Boundaries For Blocks
            int XLimit = PlayArea.Bounds.Width - PrototypeBlock.Width - SpacerX;
            int YLimit = (PlayArea.Bounds.Height / 2) - PrototypeBlock.Height - SpacerY;

            // Fill Top Of PlayArea With Blocks
            for (X = SpacerX; X < XLimit; X += (SpacerX + PrototypeBlock.Width))
            {
                for (Y = SpacerY; Y < YLimit; Y += (SpacerY + PrototypeBlock.Height))
                {
                    Block Block = new Block(new Position(X, Y));
                    Blocks.Add(Block);
                    Block.Draw(Graphics);
                }
            }

            // Set up Text labels.
            Result.Text       = "Ball: " + BallCount;
            Instructions.Text = "Move paddle with arrow, or A and D Keys.";
        }
Ejemplo n.º 33
0
 void Start()
 {
     PlayAreas = new List<PlayArea>() { new PlayArea(GameObject.Find("Top Bar"), GameObject.Find("Bottom Bar"), GameObject.Find("Left Bar"), GameObject.Find("Right Bar")) };
     InitPlayArea = new PlayArea(GameObject.Find("Top Bar"), GameObject.Find("Bottom Bar"), GameObject.Find("Left Bar"), GameObject.Find("Right Bar"));
 }
Ejemplo n.º 34
0
    public void SplitPlayArea(PlayArea playArea, GameObject splitBar, bool isHorizontal)
    {
        PlayArea p1 = new PlayArea();
        PlayArea p2 = new PlayArea();
        if(isHorizontal)
        {
            p1.TopBar = playArea.TopBar;
            p1.BottomBar = new Vector2(splitBar.GetComponent<Renderer>().bounds.min.x, (splitBar.GetComponent<Renderer>().bounds.min.y));
            p1.LeftBar = playArea.LeftBar;
            p1.RightBar = playArea.RightBar;

            p2.TopBar = new Vector2(splitBar.GetComponent<Renderer>().bounds.min.x, (splitBar.GetComponent<Renderer>().bounds.min.y));
            p2.BottomBar = playArea.BottomBar;
            p2.LeftBar = playArea.LeftBar;
            p2.RightBar = playArea.RightBar;
        }
        // Vertical
        else
        {
            p1.TopBar = playArea.TopBar;
            p1.BottomBar = playArea.BottomBar;
            p1.LeftBar = playArea.LeftBar;
            p1.RightBar = new Vector2(splitBar.GetComponent<Renderer>().bounds.min.x, splitBar.GetComponent<Renderer>().bounds.max.y);

            p2.TopBar = playArea.TopBar;
            p2.BottomBar = playArea.BottomBar;
            p2.LeftBar = new Vector2(splitBar.GetComponent<Renderer>().bounds.min.x, splitBar.GetComponent<Renderer>().bounds.max.y);
            p2.RightBar = playArea.RightBar;
        }
        Debug.Log("Splitting play area.");
        Debug.Log(p1.ToString());
        Debug.Log(p2.ToString());
        PlayAreas.Remove(playArea);
        PlayAreas.Add(p1);
        PlayAreas.Add(p2);
    }
Ejemplo n.º 35
0
    public void SpawnWall(Vector3 point, PlayArea playArea)
    {
        Quaternion rotation;

        if (IsHorizontal)
        {
            // Sets horizontal rotation
            rotation = Quaternion.identity;
        }
        else
        {
            // Sets vertical rotation
            rotation = Quaternion.Euler(0, 0, 90);
        }
        GameObject spanwedWally = Instantiate(prefab, point, rotation) as GameObject;
        spanwedWally.FindChild("Left Wallyer").GetComponent<WallGrower>().parentPlayArea = playArea;
        spanwedWally.FindChild("Right Wallyer").GetComponent<WallGrower>().parentPlayArea = playArea;
        expandyerWallyList.Add(spanwedWally);
    }
Ejemplo n.º 36
0
	protected void SetBlockTypeToRandomBlock(PlayArea playArea, int x, int y)
	{
		playArea.SetBlockType (x, y, Random.Range (1, PlayArea.totalBlocksCount));// 1 because 0 is empty, we don't want to spawn an empty block
	}
Ejemplo n.º 37
0
	void Awake()
	{
		playArea = GetComponent<PlayArea> ();
	}
Ejemplo n.º 38
0
        static void Main()
        {
            //settings
            Console.Clear();
            Console.OutputEncoding = Encoding.UTF8;

            PlayArea playField = new PlayArea();

            Console.BufferWidth = Console.WindowWidth = playField.CanvasWidth;
            Console.BufferHeight = Console.WindowHeight = playField.CanvasHeight;

            Console.Title = "B1tTris: The Game";

            Console.BackgroundColor = playField.BackgroundColor;
            Console.CursorVisible = false;

            Console.Clear();

            int difficultyMin = 1;
            int difficultyMax = 63;

            int initialAppSpeed = 400; // lower is faster + to increment
            int curAppSpeed = initialAppSpeed;
            bool appIsRunning = true;

            Random mainRandomizer = new Random();
            //end settings

            //variables
            // empty playing field
            B1tTracker playB1ts = new B1tTracker();

            for (int row = 0; row < playField.Height; row++)
            {
                string toAdd = "";
                toAdd = toAdd.PadLeft(playField.Width - 2, ' ');
                playB1ts.rowTracker.Add(toAdd);
                playB1ts.rowTracker[row] = "+" + playB1ts.rowTracker[row] + "+";
                playB1ts.scoreTracker.Add(0);
            }
            //
            Player player1 = new Player();

            //Pre Print Borders
            playField.printSideBorder();
            playField.PrintBottomBorder();

            while (appIsRunning)
            {
                //create a new piece
                player1.B1t = new B1ts(mainRandomizer.Next(difficultyMin, difficultyMax),
                    mainRandomizer.Next(1, 15)); //change to 20
                player1.B1t.firstX = (playField.Width - player1.B1t.toPrint.Length + 1) / 2;

                while (player1.B1t.isMoving)
                {

                    //read Input
                    while (Console.KeyAvailable)
                    {
                        player1.Input = Console.ReadKey();
                        switch (player1.Input.Key)
                        {
                            case ConsoleKey.LeftArrow:
                                player1.B1t.hSpeed += -1;
                                if (player1.B1t.hSpeed <= -B1ts.MAXSPEED)
                                {
                                    player1.B1t.hSpeed = -3;
                                }
                                player1.Input = new ConsoleKeyInfo();
                                break;
                            case ConsoleKey.RightArrow:
                                player1.B1t.hSpeed += 1;
                                if (player1.B1t.hSpeed >= B1ts.MAXSPEED)
                                {
                                    player1.B1t.hSpeed = 3;
                                }
                                player1.Input = new ConsoleKeyInfo();
                                break;
                            case ConsoleKey.DownArrow:
                                player1.B1t.vSpeed += 1;
                                if (player1.B1t.vSpeed >= B1ts.MAXSPEED)
                                {
                                    player1.B1t.vSpeed = 3;
                                }
                                player1.Input = new ConsoleKeyInfo();
                                break;
                        }
                    }
                    //Move Left or Right
                    if (player1.B1t.canMoveSides(playField, playB1ts))
                    {
                        player1.B1t.prevX = player1.B1t.firstX;
                        player1.B1t.firstX += player1.B1t.hSpeed;
                    }
                    player1.B1t.hSpeed = 0;

                    //Move Down
                    if (player1.B1t.canMoveDownSpeed(playField, playB1ts))
                    {
                        player1.B1t.prevY = player1.B1t.PosY;
                        player1.B1t.PosY += player1.B1t.vSpeed;
                        player1.B1t.vSpeed = 1;
                        //guideline
                        playField.PrintBottomBorder(player1.B1t.Color,
                            player1.B1t.firstX, player1.B1t.toPrint.Length);
                    }
                    else
                    {
                        //GAME OVER
                        if (player1.B1t.PosY == 0)
                        {
                            appIsRunning = false;
                            break;
                        }

                        //stop the current B1t
                        player1.B1t.isMoving = false;
                        player1.B1t.vSpeed = 0;
                        //update score
                        player1.Score += player1.B1t.Score;
                        playB1ts.scoreTracker[player1.B1t.PosY] += player1.B1t.Score;

                        //action based on color
                        //green -> fill as many 0s as possible
                        if (player1.B1t.Color == ConsoleColor.Green &&
                            player1.B1t.PosY < playField.Height - 1)
                        {
                            playB1ts.isGreen(player1.B1t);
                        }
                        else
                        {
                            //Update the current row string
                            playB1ts.UpdateRow(player1.B1t);
                        }

                        //red -> destroy current row
                        if (player1.B1t.Color == ConsoleColor.Red)
                        {
                            player1.Score += playB1ts.isRed(player1.B1t);
                        }

                        //CheckFullRow return int
                        player1.Score += playB1ts.isFullRow(player1.B1t);

                        playB1ts.PrintAll(playField.playAreaSideBorderWidth); // print Rows
                    }

                    //print player b1t
                    if (appIsRunning)
                    {
                        if (player1.B1t.isMoving)
                        {
                            player1.B1t.PrintOne();
                            //Re-Draw Previous Line
                            playB1ts.PrintOne(playField.playAreaSideBorderWidth, player1.B1t.prevY);
                        }
                        //print score
                        playField.PrintScore(player1.Score, player1.Name,
                            curAppSpeed, player1.B1t.intValue);
                    }

                    //adjust speed
                    curAppSpeed = initialAppSpeed - (player1.Score / 50) > 100 ?
                         initialAppSpeed - (player1.Score / 50) : 100;
                    Thread.Sleep(curAppSpeed);
                }
            }

            //GAME OVER
            if (!appIsRunning)
            {
                string PrintGO = "GAME OVER";
                Console.ForegroundColor = ConsoleColor.Red;
                Console.SetCursorPosition((playField.Width - PrintGO.Length) / 2 + 1, 0);
                Console.Write(PrintGO);

                string Continue = "Enter:Continue ESC:Exit";
                Console.SetCursorPosition((playField.Width - Continue.Length) / 2 + 1,
                    playField.CanvasHeight - 3);
                Console.Write(Continue);

                while (player1.Input.Key != ConsoleKey.Escape ||
                    player1.Input.Key != ConsoleKey.Enter)
                {
                    player1.Input = new ConsoleKeyInfo();
                    player1.Input = Console.ReadKey();

                    if (player1.Input.Key == ConsoleKey.Enter)
                    {
                        B1trisV2.B1trisv2.Main();
                    }
                    else if (player1.Input.Key == ConsoleKey.Escape)
                    {
                        return;
                    }
                }
            }
        }