VASTLY improved how I generate tiles and tiledata

This commit is contained in:
2022-05-07 21:57:15 -07:00
parent bee024c3e1
commit 4ff43893d0
66 changed files with 3472 additions and 3186 deletions

View File

@@ -1,21 +1,21 @@
const arrayToString = arr => {
const b = arr.map(n => {
return '0x' + (n.toString(16).padStart(2, '0').toUpperCase());
});
let str = '';
for(let i = 0; i < b.length; i += 16) {
str += ' ';
for(let x = i; x < Math.min(i+16, b.length); x++) {
str += b[x];
str += ',';
}
str += '\n';
}
return str;
}
module.exports = {
arrayToString
const arrayToString = arr => {
const b = arr.map(n => {
return '0x' + (n.toString(16).padStart(2, '0').toUpperCase());
});
let str = '';
for(let i = 0; i < b.length; i += 16) {
str += ' ';
for(let x = i; x < Math.min(i+16, b.length); x++) {
str += b[x];
str += ',';
}
str += '\n';
}
return str;
}
module.exports = {
arrayToString
}