Saturday, September 4, 2004

Saturday 4th

Got off to a good start this afternoon, and managed to get the Brush store/get functions working properly (as opposed to using test buffers and variables). You can now hold Shift and tap a number key to store the current Brush in that buffer, and then press the number at any point to recall the Brush. An appropriate message is also displayed in the Status Bar at the bottom of the screen.

I also added in some extra code to check if a defined Brush is actually stored in a buffer, to prevent the user from recalling erroneous data (error handling is an important aspect of coding, and is often overlooked). The final task remaining is to save the Brush data to disk with the current project - I'll tackle this with the rest of the I/O functionality, so for the moment I made some notes as to which variables and data require storage and intialisation.

Next, thoughts turned to the Maps and ostensibly, how I'm going to implement multiple maps. I looked through a lot of example code, and many people seem to favour the use of Types (a type is essentially an "object" which can contain a chunk of variable data - for instance, an alien name, its X and Y position, etc. - and these objects can be tweaked, modified, and manipulated in batches using some pretty simple yet powerful commands).

I'm content at the moment to keep my maps stored as arrays, as the actual data, even for a big map, is still relatively small. The problem remains, however, how do I organise the data so that I can access any map using just the one routine? Hmmm.