Beispiel #1
0
        /// <summary>
        /// 떨어지는 블럭이 다내려오게 되면 그위치에서 스테이지블럭정보에
        /// 해당 블럭에 대한 정보를 복사하기위한 함수
        /// </summary>
        void CopyBlockData()
        {
            BlockTypeData blocktypedata = AllBlockTypeDataArray[m_CurrentBlockType];

            int widthsize  = 4; // BlockArray.GetLength(2);
            int heightsize = 4; //BlockArray.GetLength(1);
            int tempy      = m_BlockPosY;
            int tempx      = m_BlockPosX;

            int[,] blockdata = blocktypedata.GetBlockRotData(m_RotType);

            for (int y = 0; y < heightsize; y++)
            {
                for (int x = 0; x < widthsize; x++)
                {
                    if (1 == blocktypedata.GetBlockRotData(m_RotType, x, y))
                    {
                        //MyBuffer.Draw("A", (x + tempx) * 2
                        //    , y + tempy);

                        StageArray[y + tempy, (x + tempx)] = (int)E_BLOCKTYPE.BLOCK;
                    }
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// 스테이지와 현재 블럭이 부딪히는지에 대한 처리
        /// </summary>
        /// <returns></returns>
        bool StageNBlockCollision()
        {
            BlockTypeData blocktypedata = AllBlockTypeDataArray[m_CurrentBlockType];
            int           widthsize     = 4;
            int           heightsize    = 4;
            int           tempy         = m_BlockPosY;
            int           tempx         = m_BlockPosX;

            int[,] blockdata = blocktypedata.GetBlockRotData(m_RotType);

            for (int y = 0; y < heightsize; y++)
            {
                for (int x = 0; x < widthsize; x++)
                {
                    if (1 == blocktypedata.GetBlockRotData(m_RotType, x, y) &&
                        (StageArray[y + tempy, x + tempx] == (int)E_BLOCKTYPE.BLOCK ||
                         StageArray[y + tempy, x + tempx] == (int)E_BLOCKTYPE.WALL
                        )
                        )
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
Beispiel #3
0
        /// <summary>
        /// 현재 블럭에 대한 정보를 이용한 화면에 블럭 드로잉
        /// </summary>
        void BlockDraw()
        {
            BlockTypeData blocktypedata = AllBlockTypeDataArray[m_CurrentBlockType];

            int widthsize  = 4; // BlockArray.GetLength(2);
            int heightsize = 4; //BlockArray.GetLength(1);
            int tempy      = m_BlockPosY;
            int tempx      = m_BlockPosX;

            int[,] blockdata = blocktypedata.GetBlockRotData(m_RotType);

            int attributeval = BlockTypeAttribute[m_CurrentBlockType];

            for (int y = 0; y < heightsize; y++)
            {
                for (int x = 0; x < widthsize; x++)
                {
                    if (1 == blocktypedata.GetBlockRotData(m_RotType, x, y))
                    {
                        MyBuffer.Draw("A", (x + tempx) * 2
                                      , y + tempy
                                      , (short)attributeval);
                    }
                }
            }
        }