auto rotate = RotateBy::create(10, 360);
auto action = RepeatForever::create(rotate);
for(int i = 0; i < 3; i++) {
auto sprite = Sprite::create("Images/grossini.png");
sprite->setPosition(Vec2( s.width/4*(i+1), s.height/2));spa
auto point = Sprite::create("Images/r1.png");
point->setScale(0.25f);
point->setPosition(sprite->getPosition());
addChild(point, 10, 100 + i);
switch(i) {
case 0:
sprite->setAnchorPoint(Vec2::ZERO);
break;
case 1:
sprite->setAnchorPoint(Vec2(0.5f, 0.5f));
break;
case 2:
sprite->setAnchorPoint(Vec2(1,1));
break;
}
point->setPosition(sprite->getPosition());
sprite->runAction( action->clone() ); addChild(sprite, i);