Exemplo n.º 1
0
        public void runmove(int move)
        {
            //Console.WriteLine("runmove field");
            //Board.console_print(true, Board.piece);
            switch (move)
            {
            case 0: Board.piece.left_move(ref Board); break;

            case 1: Board.piece.right_move(ref Board); break;

            case 2: Board.piece.left_rotation(ref Board); break;

            case 3: Board.piece.right_rotation(ref Board); break;

            case 4: Board.piece.soft_drop_floor(ref Board); break;

            case 5: atkcnt = lock_piece_calc(); break;

            case 6: Board.use_hold(); break;

            case 7: Board.piece.soft_drop(ref Board); break;

            default:
                /*Board.piece.soft_drop_floor(ref Board);*/ break;
            }
        }
Exemplo n.º 2
0
        public void runmove(int move)
        {
            switch (move)
            {
            case 0: Board.piece.left_move(ref Board); break;

            case 1: Board.piece.right_move(ref Board); break;

            case 2: Board.piece.left_rotation(ref Board); break;

            case 3: Board.piece.right_rotation(ref Board); break;

            case 5: atkcnt = lock_piece_calc(); break;

            case 6: Board.use_hold(); break;

            default:
                Board.piece.soft_drop_floor(ref Board); break;
            }
        }
Exemplo n.º 3
0
        public void Gamestart()
        {
            init();
            int atk = 0;

            for (int i = 0; i < 5; ++i)
            {
                F.add_next_piece(Minorule.genebag7int());
            }
            while (!F.isdead)
            {
                //F.add_garbage(2);
                F.add_next_piece(Minorule.genebag7int());
                F.Spawn_piece();
                //b.setpos(18, 3);
                //F.console_print(true, F.piece);
                //F.piece = b;

                while (!F.piece.locked)
                {
                    Console.Clear();

                    F.console_print(true, F.piece);
                    if (F.holdpiece != null)
                    {
                        F.holdpiece.console_print();
                    }
                    Console.Write(atk);
                    atk = 0;
                    if (F.piece.Tspin)
                    {
                        Console.WriteLine("tspin");
                        //if (F.piece.mini && row == 1)
                        //    Console.WriteLine("mini");
                    }

                    char a = Console.ReadKey().KeyChar;

                    switch (a)
                    {
                    case 'a':
                        F.piece.left_move(ref F);
                        break;

                    case 'd':
                        F.piece.right_move(ref F);
                        break;

                    case 's':
                        F.piece.soft_drop(ref F);
                        break;

                    case 'w':
                        //F.piece.mino_lock(ref F);
                        atk = lock_piece_calc();
                        //F.add_garbage(1);
                        break;

                    case 'l':
                        F.piece.right_rotation(ref F);

                        break;

                    case 'k':
                        F.piece.left_rotation(ref F);
                        break;

                    case 'j':

                        F.use_hold();
                        break;

                    default:
                        break;
                    }
                }
            }
        }