Ccpoint stleftbegin, stleftend, strightbegin, strightend;
// Set the start and end points on the left
Stleftbegin. setpoint (-4360000f,-60 );
Stleftend. setpoint (visiblesize. width/2.0f + stleftbegin. X,-601_f );
// Set the start and end points on the right
Strightbegin. setpoint (visiblesize. Width,-601_f );
Strightend. setpoint (visiblesize. width/2.0f,-601_f );
// Load the animation sequence
Ccspriteframecache * pcache = ccspriteframecache: sharedspriteframecache ();
Pcache-> addspriteframeswithfile ("middle_ani_1.plist ");
Pcache-> addspriteframeswithfile ("middle_ani_2.plist ");
// Generate a list of animated images and animated objects
Ccarray * panimframes = ccarray: createwithcapacity (69 );
Xansistring straniname;
For (INT I = 1; I <70; I ++)
{
Straniname. printf ("light000004d.png", I );
Panimframes-> addobject (pcache-> spriteframebyname (straniname. c_str ()));
}
Ccanimation * animation = ccanimation: createwithspriteframes (panimframes, this-> m_fduration * 2.0f/3.0f/6920.f );
Ccnode * pnode = ccnode: Create (); // There are two subnodes, one is the left side of the SWAp image, the other is the middle of the animation, used for moving together action
Ccsprite * pleft = ccsprite: createwithspriteframename ("swap_left.png ");
Pleft-> setanchorpoint (ccpointzero );
Pnode-> addchild (pleft );
// Swap image on the right
Ccsprite * pright = ccsprite: createwithspriteframename ("swap_right.png ");
Pright-> setposition (strightbegin );
Pright-> setanchorpoint (ccpointzero );
This-> addchild (pright, 0 );
// Define action
// Move the activity to the right on the left
Ccmoveto * pactionleft = ccmoveto: Create (m_fduration/3, stleftend );
// Move the activity to the left on the right
Ccmoveto * pactionright = ccmoveto: Create (m_fduration/3, strightend );
// Remain unchanged
Ccmoveto * pactionleft1 = ccmoveto: Create (m_fduration/3, stleftend );
Ccmoveto * pactionright1 = ccmoveto: Create (m_fduration/3, strightend );
Void cctransitiongame: lrfinish (void)
{
// After the activity is completed, execute the finish of the field line.
M_finishcnt ++;
If (m_finishcnt> = 2)
{
Cctransitionscene: Finish ();
}
}
Void cctransitiongame: onfirstactionfinish (void)
{
// Display the first scenario and the second scenario before opening the door
M_pinscene-> setvisible (true );
M_poutscene-> setvisible (false );
}
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service