How to controller every sprite

Hi everybody

My question is the following

I programmed in another framework (in java), in which i can manually draw sprites like this:

       Gdx.gl.glClearColor(1f, 1f, 1f, 1);

        Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);

        m_SpriteBatch.begin();

        Iterator It = m_vActors.iterator();
        while( It.hasNext() )
        {
            Sprite spr = It.next();
            spr.draw(m_SpriteBatch);
        }
        m_Field.Draw(m_SpriteBatch, stateTime);
        m_SpriteBatch.end();

I need to draw sprite like a tilemap (I have a file to map positions on the screen, i called it “mapfile”), but not adding it as a child.
as side note, in the “map file” there are other tags for effects, timing and other behaviour (that move sprites individually) that make the difference between tilemap and my concept, it’s like a music game, and the movement of the sprites depends strictly of “music beat”, which can vary, and make that the sprites change their positions according it in every frame.

In few words, i want to draw one state of the game per frame.

It’s posible to do this?

best regards.

PS: sorry if my english is misspelled xD

It looks you use libgdx before.
if you want to draw some thing per frame,May be you can override the draw function.

thanks for the response.

There is some method for do this more cleanly with cocos2d-x?

Why you don’t want to add the sprites as children? It seems from your code that you have a container for all your tiles.
So you would still have access to them, and you can change their behaviour/position/looks in an update method - you add an `void update(float deltaTime);` method to your class and you call `scheduleUpdate()` in init(), and then this method gets called between every frame, so you get frame by frame controll over what and how will be drawn on your scene.

as you say, I have a container, but for some children (static children),
I’m calling a m_Field.Draw(m_SpriteBatch, stateTime), and what’s going on inside this method?:
I have the current_time and select a range of sprites to draw regarding this range, like this:

NOT DRAWING HERE
------------ upper bound to draw (in pixels)

draw range

current_time -> MID (some calculation for translate time -> positions)

draw range

------------ lower bound to draw (in pixels)
NOT DRAWING HERE

I have a predefined sprites declared in m_Field, for clone and draw.
But what’s happens inbetween lower and upper bound?. some pseudocode:

calling once per draw

music_note_in_range = getRange( lowerbound, upperbound )
for each music_note_in_range
    spr_To_Draw = predefined_and_loaded_sprite_texture().clone()
    spr_To_Draw.setPosition( ... );
    spr_To_Draw.draw(spriteBatch);
end

That’s the idea of what I want to do with cocos2d-x.
I think, controlling a random number of sprites in a range, it’s hard to add and removing as a child.
I guess that in this case is not strictly necessary add sprites as a child.