Take the 2-minute tour ×  My question is quite broad and related
to the 2D game code design/architecture/structure.  Usually the
main game consists of the main loop where you update & render
your world states. However, it's recommended for many purposes
to separate rendering from the game-logic and so on.  I am kinda
confused about the whole situation. Many game engines/libs/sdks
don't follow separation schema. They propagate a way where you
define some scenes/stages and they contain some objects and the
scene/stage controls the user input and so on. For example, in
cocos2d(-x) and libgdx (stage2d) the games are usually done the
way that the update logic happens at the same time/place as
rendering. Also, the propagated way is to have a structure where
an object knows how to draw itself - which is not a separation
of updating & rendering. The same with Flash based games, they
are usually done the way when an object (class) contains a swf
or a texture and some data and holds some update logic itself,
or updated