Exemplo n.º 1
0
        //跳跃成功后生成新cube,并改变镜头位置状态backgroundMoveIndex = 1,下个循环开始背景移动
        public void ShowNewCube()
        {
            //UcNowCubeCom = UCcubecom1;

            // UCcube1 UCcube0 = new UCcube1();
            UCcubeCompression UCcubecom1 = new UCcubeCompression();

            //Layer_Cube.Children.Add(UCcube0);
            //UCcube0.SetValue(Canvas.LeftProperty, (double)(NowCube.Position[0] + (NextCube.k * NextCube.dx)));
            //UCcube0.SetValue(Canvas.BottomProperty, (double)(NowCube.Position[1] + NextCube.dy));
            Layer_Cube.Children.Add(UCcubecom1);
            UCcubecom1.SetValue(Canvas.LeftProperty, (double)(NowCube.Position[0] + (NextCube.k * NextCube.dx)));
            UCcubecom1.SetValue(Canvas.BottomProperty, (double)(NowCube.Position[1] + NextCube.dy));

            //更新,现在的UcNowCubeCom是刚才的UcNextCubeCom,现在的UcNextCubeCom是新生成的UCcubecom1
            UcNowCubeCom        = UcNextCubeCom;
            UcNextCubeCom       = UCcubecom1;
            backgroundMoveIndex = 1;
        }
Exemplo n.º 2
0
        //******************************* Drwa *******************************//
        #region Draw

        //初始化
        public void DrawAnimationInitialize()
        {
            UcNowCubeCom  = UCcubecomZero;
            UcNextCubeCom = UCcubecomOne;
        }