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); } }
public DraggingSpite(Peace p, CCPoint s) { Peace = p; StartPosition = p.Sprite.Position; DragStart = s; }
bool isPeaceCloseToHome(Peace peace) { const int MIN_DISTANCE = 20; return(CCPoint.Distance(peace.Sprite.Position, peace.AssembledPos) < MIN_DISTANCE); }
bool isPeaceAtHome(Peace peace) { return(peace.Sprite.Position == peace.AssembledPos); }
void DisassemblePease(Peace p) { var easeMove = _factory(new CCMoveTo(1, p.DisassembledPos)); p.Sprite.RunAction(easeMove); }