示例#1
0
        //Rotation layer selection
        internal static void Start(bool Clockwise)
        {
            if (!rotaStatus)
            {
                //Top @ X > 45°
                if (Camera.camRota.X > 45)
                {
                    layerRotation = Cube.Layer.layerTop;
                }
                //Bottom @ X < (-45)°
                else if (Camera.camRota.X < -45)
                {
                    layerRotation = Cube.Layer.layerBottom;
                }
                //Front @ Y ]-45,45[
                else if (Camera.camRota.Y > -45 && Camera.camRota.Y < 45)
                {
                    layerRotation = Cube.Layer.layerFront;
                }
                //Right @ ]-135,-45[
                else if (Camera.camRota.Y > -135 && Camera.camRota.Y < -45)
                {
                    layerRotation = Cube.Layer.layerRight;
                }
                //Left @ ]45,135[
                else if (Camera.camRota.Y < 135 && Camera.camRota.Y > 45)
                {
                    layerRotation = Cube.Layer.layerLeft;
                }
                //Back
                else
                {
                    layerRotation = Cube.Layer.layerBack;
                }

                rotaClockwise = Clockwise;
                rotaStatus = true;
                rotaCounter = 90;
            }
        }
示例#2
0
        internal static void Shuffle()
        {
            if (!rotaStatus && counter > 0)
            {
                animationSpeed = 750;
                rotaStatus = true;
                rotaCounter = 90;

                Array values = Enum.GetValues(typeof(Cube.Layer));
                Random random = new Random();
                Cube.Layer randomLayer = (Cube.Layer)values.GetValue(random.Next(values.Length));

                layerRotation = randomLayer;

                counter--;
            }
            else if (counter == 0)
            {
                animationSpeed = 250;
                Settings.time.Restart();
                counter--;
            }
        }