billyb2 / game

GNU Affero General Public License v3.0
2 stars 0 forks source link

Add support for multiple and custom maps #36

Closed billyb2 closed 3 years ago

billyb2 commented 3 years ago

Currently, the game uses the single baked in map1.custom, which is great and all, but there's no support for player built maps. There's also currently no infrastructure in place to support multiple maps.

The second should be very easy to do. We could store all the maps in a struct, with the name of the map as one part, and the actual data of the map as the other part. It'd probably be best to have this as a Bundle (see the Player bundle as an example) so that we can access the separate parts of the map without having to copy a few 100+ bytes every time we access certain parts of it, which would add up to speed decreases over time. We would probably want to get map metadata working (#12) first, and though we don't strictly need the entire issue to be completed, it would make custom maps more useful.

As for the first part of this issue, once we have #34 working, it would be fairly trivial to just have folders specially made to store custom maps, and then have some instructions for map makers as to how to setup Tiled and custom.js, and then the specific folder used per platform.

I consider this issue separate from #12 since, while that issue is for the map format specification in and of itself, this issue is more about how to store and load these maps.