Saturday 15 December 2007

Text-based level loader working

I finally got that level loader I started work on last week to work with the block sprite - now it loads actual functioning blocks from the text files! For example, behold this magical transformation.
From this:
0000000000000000000000000
0000000000000000000000000
0000100000000000000000000
0000000000000000000001000
0001000000000100000000000
0000010000000000000000000
0000000000000000000000000
0000000000000000000000000
0000000000000000000000000
0000000000000000000000000
0000000000000000000000000
0000000000000000000100000
0000000010000000000010000
0000000101000010000000000
0000000101000000000000000
0000000000000000000000000
0000000000000000000000000
0000000000000000000010000
0000000000000000000000000
0000000000000000000000000


To this:
I know it may look like a lot of faffing to write out these text files, but it's much faster than adding in all the sprites myself (I'd need to write out several lines of code for every single "1" you see in the text). As you might have guessed, it's replacing the ones in the text file with block sprites and zeroes with empty space. The background and character still have to be added in manually, but that only requires about six extra lines per level as the character class that I created does absolutely all its own position, drawing, animation and sound management.

So, with but ten days left until Christmas, I've decided that the best way to test out what I've made so far is by doing a short Christmassy level to be released as an 0.1 alpha version. Therefore I'm going to need to get on with some sprites - I'm thinking maybe Christmas trees as blocks, and... Santa as a character?

No comments:

Post a Comment