Game structure (scenes, layers ...)

Hi there, I’m totally new in game development. I’m looking for best practices about organizing scenes/layers etc.

As far as I understand the examples, which are all level based, I use scenes for each level (or use the create call with parameters). But how about games like Stardew Vallew, where I have a “world like” game. Is this one scene with many layers?

If someone can point me into the right direction, I would be really happy.

I think of a Scene being a single ‘aspect’ of a game - so I might have a scene for the level selection, a scene for the high score table and a scene for the game itself.
Layers are more simply graphical elements - like layers in Photoshop - so you might have background images in one layer, sprites on another and current score/lives on another.

I don’t know Stardew Valley - but I’m guessing from screenshots that it would be programmed in cocos2d-x using a couple of layers as I describe above.

As a total noob I’d strongly suggest start with one scene and one layer - then maybe add a HUD layer when you need one. Don’t worry about scene changes and transitions until you need them (which you may never do)

and we have docs and samples

2 Likes

I read the docs, but I didn’t know about the samples. Thanks.