Saturday, August 8, 2015

Abiathar Online - Byte Crunching JavaScript

Since the setup UI for Abiathar Online is done, it's time to start on the map loading code. I added two XMLHttpRequest usages to confirmSetup(), both of which call levelResReady() when complete. The duty of that latter function is to process the maps files and populate the levels array. Writing that function is very difficult because JavaScript doesn't seem to have a nice binary processing API. I'm making do with typed arrays (Uint8Array and Uint16Array). So far I've written the level header processing code (to get the level name and data pointers); next I'll finish the Carmack decompressor. Hopefully it won't be terribly slow.

No comments:

Post a Comment