Cocos2d-x 101 encounter/directory
1. Installation and environment setup-xcode
2 Scenes, Director, Layers, Sprites
3. Create an image menu
4. Create a new scenario on HelloWorld
5. Add a sprite.
5.1 scale down sprite and display it completely
6 action, mobile sprite
3.0 Click Event, CCTouchDelegate has been disabled
8 use the touch event mobile genie
5. Add a sprite.
In the second scenario, the bool CMyFirstScene: init () function is added at the end.
auto s =Sprite::create("19300001150142129966113771140.jpg");
this->addChild(s,1);
// do something
returntrue;
19300001150142129966113771140. jpg
Is a rabbit image, you must add the file to the project. (Add files to "project" in xcode ")
What Is Genie? Is it dynamic, animal? Airplane? Device (gun, bullet )? Enemies: obstacles, walls, bricks ?, Mine ,? Traps.
5.1 scale down sprite and display it completely
auto s =Sprite::create("19300001150142129966113771140.jpg");
CCSize size=CCDirector::sharedDirector()->getWinSize();
s->setPosition(ccp(size.width/2,size.height/2));
s->setScale(0.3,0.3);
this->addChild(s,1);
// do something
returntrue;
}