Hooray! Bigger Maps!

A project log for CSV TileMap Game

CircuitPython example game that reads the initial map state from a CSV file stored on the device.

foamyguyfoamyguy 11/29/2019 at 18:330 Comments

I've uploaded another new alternate code py file and a new map csv file to go along with it they are named "entity_system_and_camera" in the file section and the repo. 

This new example contains a re-worked world state and entity system. Namely they've been separated into two more distinct systems. This helped solve a lot of headaches around what happens when entities were located on the same tile. That's diving a bit into the nitty gritty though.  

The really cool thing about this update is that it allows for the map csv to be bigger than the screen. There is a very rudimentary camera system that will auto-follow the player as they move around the larger map. In the example code the map is wider than the screen by a few tiles and the camera will follow left and right as the player moves across a certain threshold.. Take a look at the set_camera_view() function if you are interested to see how we pull out the relevant portion of the larger map to draw onto the screen. 

Perhaps at some point I'll work on a way to load a different "zone" from a new map csv file. So the player can go in/out of buildings and between various "zones" within a larger game world without needing to have it all loaded at once.

But before I get ahead of myself I do intend to spend a bit of time cleaning this version up a bit more and documenting it much better. Once that is complete this will probably become the main code py file in the repo