From 44ee5b874eba2cd38435d079d01d016dc1e48358 Mon Sep 17 00:00:00 2001 From: synth-ruiner Date: Sun, 24 Dec 2017 18:12:46 +0000 Subject: [PATCH] allow for background-only ("no tile") --- includes/script.js | 7 +++++++ readme.md | 4 +--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/includes/script.js b/includes/script.js index 70814a1..b301238 100644 --- a/includes/script.js +++ b/includes/script.js @@ -123,6 +123,13 @@ $(document).ready(function() { // get tiles bitsyData.tiles = {}; + // tile 0 (background colour only) is implicit in bitsy rather than being stored in the game data + // so, make our own version + bitsyData.tiles[0] = { + name: 0, + bitmap: _.chunk(_.split(_.repeat(0, 64), ''), 8) + }; + var tiles = input.match(/TIL (.*)\n([01]{8}\n){8}/g); if (tiles.length > 0) { diff --git a/readme.md b/readme.md index c25fad5..ab88e8a 100644 --- a/readme.md +++ b/readme.md @@ -40,15 +40,13 @@ if (src.match(/^(file|https)?:\/\/|^\/\//)) { ## known bugs -* tile 0 (background colour only) is an implicit tile in Bitsy- it's not stored in the game data. so this tool ignores it. oops!! - * when importing game data, create a version of this - * when writing game data, don't write the 0 tile ## to do * allow user to save output as image, or tweet it :) *user can currently right-click -> Save As but the 128x128 size is not great* * create new tiles based on image * only add unique new tiles + * don't write the 0 tile (implicit background-only tile) * implement slider (*always use existing tiles* -> *always create new tiles*) (representing 0-64 threshold for # of common pixels) * re-style the damn thing * reorganise the page layout for a more logical workflow