Create sprite after period :(

Create sprite after period :(


I have the code

    bl = Sprite::create("bl.png");
	auto moveBy = MoveBy::create(2, Vec2(0, 500));

How to make the following code repeated after a period of time ??.
I would like to have a sprite like this one after each period.
sorry for my english :frowning:
thank you. !!!


You could create an scheduler like this:

Director::getInstance()->getScheduler()->schedule(SEL_SCHEDULE(&Game::moveAutoMethod), Game::getInstance(), 0.45f, false);

0.45f is the period time.
And Game::moveAutoMethod is the method that should contain the MoveBy.
Advice: Make sure to configure different names in each sprite… using bl->setName


Or use Repeat or RepeatForever

General docs on Actions: