Advice for 2d level design in SFML

Started by
10 comments, last by Servant of the Lord 12 years, 1 month ago
I haven't used sfml but I don't see why you couldn't use Tiled to layout your maps. If you save a map as .tmx and open it in a text editor you can copy the array of tiles it created and use that in your code.

So you visually can make a map in tiled by drawing your tiles based off your sprite sheet, save it as .tmx, copy the array, load the original sprite sheet in your program, loop through the array and draw corresponding tile from sprite sheet based off array entry.

Here's a visual example using just basic javascript and html5 that loads 500x300, 64-pixel tiles based off a sprite image http://simplehotkey.com/Tiles/main.html if you could reproduce that in c++ you'd have it made.
Advertisement

Can I use tiled with sfml?

Certainly. But like all programming, you have to make the 'glue' between piece one (SFML) and piece two (Tiled's maps).
It will take some work, and you'll face some challenges, but without difficulties to overcome, we don't grow as programmers.

If that's too daunting a task, someone else has already made some glue between those pieces that you can re-purpose for your project, and you'll still have to figure out how to use it, and how it will work within the structure of your game.

This topic is closed to new replies.

Advertisement