Cocos2dx engine development is now the most popular mobile game engine development, which is the climax of students' learning. Seven of the top 10 games that are currently running are developed using the cocos2dx engine, so developers are proud to be involved.
Today's learning content: cocos2dx is used to achieve the card flop effect. cocos2dx has an action to achieve this effect. Let's take a look at it!
650) this. width = 650; "title =" 1.png" src = "http://www.bkjia.com/uploads/allimg/131229/121H36122-0.png" alt = "150153236.png"/>
For an ipad simulator, the frame rate is 30, and the actual frame rate is 60.
The following actions can be used to flip the cards: CCOrbitCamera
650) this. width = 650; "title =" 2.jpg" src = "http://www.bkjia.com/uploads/allimg/131229/121H3H17-1.jpg" alt = "150209706.jpg"/>
For example, the parameters are respectively the rotation time, start radius, radius difference, start z angle, rotation z angle difference, start x angle, rotation x angle difference, if the encapsulation is cardSprite, add it to your project.
Usage:
650) this. width = 650; "title =" Usage:. jpg "src =" http://www.bkjia.com/uploads/allimg/131229/121H32255-2.jpg "width =" 505 "height =" 123 "alt =" 150222640.jpg"/>
CardSprite. h
650) this. width = 650; "title =" CardSprite.h.jpg "src =" http://www.bkjia.com/uploads/allimg/131229/121H3I39-3.jpg "width =" 508 "height =" 493 "alt =" 1501_855.jpg"/> 650) this. width = 650; "title =" CardSprite.h1.h.jpg "src =" http://www.bkjia.com/uploads/allimg/131229/121H3DJ-4.jpg "alt =" 150434131.jpg"/>
CardSprite. cpp
650) this. width = 650; "title =" CardSprite.cpp.jpg "src =" http://www.bkjia.com/uploads/allimg/131229/121H31134-5.jpg "alt =" 150448858.jpg"/> 650) this. width = 650; "title =" CardSprite.cpp1.cpp.jpg "src =" http://www.bkjia.com/uploads/allimg/131229/121H311X-6.jpg "alt =" 150459278.jpg"/> 650) this. width = 650; "title =" CardSprite.cpp2.cpp.jpg "src =" http://www.bkjia.com/uploads/allimg/131229/121H32634-7.jpg "alt =" 150524880.jpg"/> 650) this. width = 650; "title =" CardSprite.cpp3.cpp.jpg "src =" http://www.bkjia.com/uploads/allimg/131229/121H31X5-8.jpg "alt =" 150535617.jpg"/> 650) this. width = 650; "title =" CardSprite.cpp4.cpp.jpg "src =" http://www.bkjia.com/uploads/allimg/131229/121H32U4-9.jpg "alt =" 150546163.jpg"/>
The above is all the content of this lesson, and the program is a bit messy. If you do not understand anything, you can break through the O at any time.