示例#1
0
        void AssemblePeace(Peace p)
        {
            CCAudioEngine.SharedEngine.PlayEffect(filename: "success_partial");
            var easeMove = _factory(new CCMoveTo(0.3f, p.AssembledPos));

            p.Sprite.RunAction(easeMove);
            StarsFireworks(p.AssembledPos);
            var grouped = _peaces.All(s => isPeaceCloseToHome(s));

            if (grouped)
            {
                ScheduleAction(OnImageAssembled, 500);
            }
        }
示例#2
0
 public DraggingSpite(Peace p, CCPoint s)
 {
     Peace         = p;
     StartPosition = p.Sprite.Position;
     DragStart     = s;
 }
示例#3
0
        bool isPeaceCloseToHome(Peace peace)
        {
            const int MIN_DISTANCE = 20;

            return(CCPoint.Distance(peace.Sprite.Position, peace.AssembledPos) < MIN_DISTANCE);
        }
示例#4
0
 bool isPeaceAtHome(Peace peace)
 {
     return(peace.Sprite.Position == peace.AssembledPos);
 }
示例#5
0
        void DisassemblePease(Peace p)
        {
            var easeMove = _factory(new CCMoveTo(1, p.DisassembledPos));

            p.Sprite.RunAction(easeMove);
        }