And another question, is it possible to change the font? Using an appropriately sized tile set instead? That way I can just use locate and print and such for this. If not, I ask again, how should I go about moving a tile set into petit? I can't imagine moving it in by hand pixel by pixel will be very productive...
On a side note, can I mess with the brightness of a sprite or tile? I was thinking of how to go about a basic lighting system. Like how Minecraft used to do it. It would make everything very simple if I could just make everything increasingly darker the further from a light source it is. This is just for atmosphere, not particularly necessary.
I hadn't dealt with the font before, so I did a little digging. You can change the font of the console if you want. CHRED allows you to load/save fonts. Within your program, you can load a font by using the LOAD command. If the font was called TESTFONT, you'd do...
...or you can use string concatenation (with the "+"), and have it load it based on the string you give it. Understand that just like loading assets, it will affect the run-time and edit modes, so if you want your program to reset it, just use the CHRINIT command as so...
I'm not sure if you can use a different font for both the upper and lower screen, but I assume you can as long as you designate which screen is actively being worked on with BGPAGE (parameter of 0 is upper screen, and 1 is lower screen).
About lighting.....from what I can gather, the only way you can get such an effect will involve messing with the color palette of the backgrounds and sprites. Each are limited to 256 colors, but they are split into 16 sections of 16 colors (with the first being the transparent color that does not get drawn). You can access the color palettes via COLREAD and COLSET. Here is an example of taking an existing color at index 30 of the sprite palette on the upper screen, and increasing the red, green, and blue components by 1.
Code:
SPPAGE 0
COLREAD("SP",30),R,G,B
R=R+1:G=G+1:B=B+1
COL$=HEX$(R,2)+HEX$(G,2)+HEX$(B,2)
COLSET "SP",30,COL$
Off the top of my head, if you were to have one 16 color palette that all your background tiles used, you could then have 16 shades of that palette, and then assign each individual tile on the background to refer to one of the 16 shades. If you wanted 2 unique palette sets of 16 colors, that would limit you to 8 different shades. 4 unique sets? 4 different shades. See the pattern? Anyways, how you want to implement your lighting system is up to you.
Alright. That was just a flub, no actual code was in there.
SO! Now to find a way to make a 2D map for my game... Any way we can load/save simple data files?
There are two approaches to having a map. The first is the easy yet limited way. Simply LOAD a SCR file in (which you can make with SCRED) to the one of 2 backgrounds for the designated screen. The limit is that the map itself is at most 64x64 tiles (being that each tile is 8x8 pixels). If you wanted a larger map, you will then have to go the harder route, and implement your own map engine that uses the 64x64 map backgrounds in a way that makes it look like it has more by updating sections of the map that are off the screen.
If you being general in loading/saving data, well......this is where we are out of luck. The only type of resources that can be loaded/saved are of background tilesets, sprite tilesets, background screens, color palettes, and memory files. The closest thing to "data files" that we think of is the memory files,but they are limited to a single string, and strings are limited to 256 characters if I'm not mistaken. The only way to have a large amount of data to be used by the program is having that data literally placed within the program itself as DATA commands. What you can do is place all this DATA at the end of your program, and for each section that you want access to, you set a label just before it, and within your program, call the command RESTORE , with being the label that is just before that set of data. You then READ in that data, either as numbers or strings. FOR loops can help if you want to load that data into an array. Having multiple labels at the beginning of different sections of the DATA allows specifying which area to use RESTORE at, but be aware that all data is read sequentially, and can't be randomly accessed. If you wanted to get to data in the middle of a section without a label pointing to it, it would require RESTOREing fro ma label before it, and then reading in the data one by one until you get to it.