Help with class design?

Hi all, I’ve just started using Cocos2D-x.

I’m familiar with C++ and have developed some games using
different frameworks/APIs and I’m trying to understand how everything is
called, mainly where the equivalent of an update loop is.

So far, I have a basic main menu with a button and a background image. I’m looking to
expand on this with another class for a different scene. But in previous experiences
my scene class would have an Update() method called every frame. Where would I go about for example,
moving a sprite continuously to the left? As it doesn’t make sense for me to make that call
in the Init() method for my scene class. Below is a code snippet of my MenuScene

class MenuScene : public cocos2d::Scene
{
public:
    static cocos2d::Scene* createScene();

    virtual bool init();
    
    // a selector callback
    void menuCloseCallback(cocos2d::Ref* pSender);
    
    // implement the "static create()" method manually
    CREATE_FUNC(MenuScene);
};

Sorry if I’ve asked a question that is explained somewhere in a resource I haven’t seen. Any help is appreciated,
Thanks.

Hi.
You can move sprite (rotate , fade , scale , etc) by actions. Actions is a powerful system implemented in cocos2d-x.

auto myAction = MoveBy::create(10.f,Vec2(100.f,200.f));
auto mySprite = Sprite::create("someImage.png");
mySprite->runAction(myAction);

you can search actions in cocos documentations and forum.

http://cocos2d-x.org/docs/programmers-guide/actions/index.html