Basic map editor!
This commit is contained in:
@@ -6,7 +6,7 @@ import { mouseClick, mousePos } from "./mouse.ts";
|
||||
import { reGridWithGap } from "./util.ts";
|
||||
import { page } from "./viewsheets.ts";
|
||||
import { useSpritesheet } from "./builtins.ts";
|
||||
import { codeIcon, spriteIcon } from "./icons.ts";
|
||||
import { codeIcon, mapIcon, spriteIcon } from "./icons.ts";
|
||||
|
||||
const gridX = 8;
|
||||
const gridY = 40;
|
||||
@@ -15,10 +15,11 @@ const cellH = 8;
|
||||
const gapX = 8;
|
||||
const gapY = 8;
|
||||
|
||||
const sheetTypes = ["code", "spritesheet"] as const;
|
||||
const sheetTypes = ["code", "spritesheet", "map"] as const;
|
||||
const defaultSheetVal = {
|
||||
code: () => "",
|
||||
spritesheet: () => Array(64).fill(0).map(() => Array(64).fill(0)),
|
||||
map: () => Array(64*64).fill(0).map(() => [0, 0]),
|
||||
none: () =>null,
|
||||
}
|
||||
|
||||
@@ -49,6 +50,7 @@ const draw = () => {
|
||||
const icon = {
|
||||
code: codeIcon,
|
||||
spritesheet: spriteIcon,
|
||||
map: mapIcon,
|
||||
none: null,
|
||||
}[sheetType];
|
||||
drawIcon(sx, sy, icon, COLOR.BLUE);
|
||||
|
||||
Reference in New Issue
Block a user