コード例 #1
0
        void rotate()
        {
            Rectangle hitBox = mainBlock.BoundingBox;

            hitBox.X       = hitBox.X * 20 + 36;
            hitBox.Y       = hitBox.Y * 20 + 14;
            hitBox.Width  *= 20;
            hitBox.Height *= 20;

            //If the press is active, rotate the block
            if (controls.rotate(input, hitBox))
            {
                //If a rotation will not result in a collision
                if (!Collision.rotationCollision(mainBlock, mainGrid))
                {
                    mainBlock.rotate(mainGrid);
                }

                SoundManager.playSound("Audio/Bloop");
            }
        }