SFML community forums

Help => General => Topic started by: kevin0211722@gmail.com on April 20, 2021, 01:52:32 pm

Title: The way to construct 2D scene?
Post by: kevin0211722@gmail.com on April 20, 2021, 01:52:32 pm
Hi guys!
I'm about to build my first 2D game scene.
I'm wondering that what's the usual method of building scenes.
I heard some people would use textures in blocks to build when they using a game engine to develop games.
When it comes to drawing a scene, my mind comes up withdrawing an entire picture of the game level.
Does it sound unprofessional? How do you guys sort out this task?

 
Title: Re: The way to construct 2D scene?
Post by: fallahn on April 21, 2021, 10:57:33 am
A common approach is to use a scene graph (https://en.wikipedia.org/wiki/Scene_graph). There's a topic in the SFML tutorials (https://www.sfml-dev.org/tutorials/2.5/graphics-transform.php#object-hierarchies-scene-graph) which touches on implementation, and it is covered in detail in the SFML Game Development (https://www.packtpub.com/product/sfml-game-development/9781849696845) book.