Cocos2d-x学习二:简单的动画

最近开始看别人的博客学习cocos2d-x了,但是还是遇到了一些阻碍,就是别人的代码没法直接使用,这也告诉我自己要自己看源码或者API
//Flip Animation
	CCSprite *s = CCSprite::create("ccicon.png");
	s->setPosition(ccp(200,200));
	addChild(s);

	CCActionInstant *ix = CCFlipX::create(1);
	CCActionInstant *iy = CCFlipY::create(1);

	s->runAction(ix);
	s->runAction(iy);
	//Rotate Animation
	CCActionInterval *ac = CCRotateBy::create(2,270);
	s->runAction(ac);

	//CCSequence Animation Combination
	CCActionInterval *rotate = CCRotateBy::create(2,270);
	CCActionInterval *blink = CCBlink::create(3,10);
	CCActionInterval *move = CCMoveTo::create(2, CCPoint(300,200));
	CCActionInterval *jump = CCJumpTo::create(3, CCPoint(400,400), 20,4);
	CCArray *array = CCArray::create();
	array->addObject(rotate);
	array->addObject(blink);
	array->addObject(move);
	array->addObject(jump);

	CCFiniteTimeAction *seq = CCSequence::create(array);
	s->runAction(seq);

你可能感兴趣的:(cocos2d-x)