You could create a big bitmap, but this has many disadvantages. Editing is complicated and for the collision detection you need to create a seperate map. I'd recommend to use tiles, much more memory efficient, edit friendly (you can store the references to your tile in an array).
I have done my own map editor for malvado, and due to the way the game works (with big bitmaps) not very straight-foreward in design.
Tilemap editing is much easier and efficient.
Hello, Thank you for the suggestion
I was aware of the big bitmap problem, I don't think the editing is complicated since applications like Tiled exist, but editing on the fly really becomes complicate when trying to build a changeable world (like terraria does for example).
I have the idea, correct me if I'm wrong, that the problem with the tiles is the flexibility of the map. So if I want do to something based on squares then the tiles is perfect, but if I want to make something more appealing like having a background and a foreground (front background ?) then I'll had to use bitmaps. Or at least share the two, using two bitmaps one for the back and one for the front (with transparency) and then use the tiles method in order to create the structure of the game.
But here is my question. I've seen that, in terms of memory, BennuGD prefers to have a huge pictures rather than a lot of small pictures. What I've noticed is that, on my Example game (on the Projects page), I have 10 bitmaps of 640x480 with the map, and then I am controlling everything by color of the position of X and Y. The total memory of the game without the FPG containing those bitmaps loaded is 3.4MB-4MB and the memory with those bitmaps loaded is 10.6Mb-11Mb. When loading a bitmap containing all of those bitmaps in one only image, the total memory size is about 4.6Mb-5.1Mb.
When using tiles however (and without any sprite, but only with 16bits colored maps of 20x20), I can fill up a full map and only take something like 0.1Mb-0.2Mb which is perfect.
But here is my two questions :
1 - Is it better to load every sprite separately into a map and then put them in an FPG and use them, or is it better to create a SpriteSheet ?
2 - What about collisions ? How can I do them if the sprites are separate from the bitmap method I was using (map_get_pixel) ? Is there a way to attribute a "color or palette" to the map in order to know, let's say, that the lava is red and the grass is white, then if it is white the user simply keeps on it without falling trough it but if it is red than it takes a hint ?
Thank you in Advance !