Reorganize

This commit is contained in:
dylan 2023-05-18 19:45:49 -07:00
parent 9b48560cce
commit f652e8d20f
22 changed files with 77 additions and 81 deletions

View File

@ -1,13 +1,13 @@
import { clearScreen, fillRect } from "./window.ts"; import { clearScreen, fillRect } from "../io/window.ts";
import { CHAR, font } from "./font.ts"; import { CHAR, font } from "../data/font.ts";
import { drawText, measureText } from "./builtins.ts"; import { drawText, measureText } from "../runtime/builtins.ts";
import { COLOR } from "./colors.ts"; import { COLOR } from "../data/colors.ts";
import { getCodeSheet, setSheet } from "./sheet.ts"; import { getCodeSheet, setSheet } from "../io/sheet.ts";
import { K, ctrlKeyDown, getKeyboardString, keyPressed, shiftKeyDown } from "./keyboard.ts"; import { K, ctrlKeyDown, getKeyboardString, keyPressed, shiftKeyDown } from "../io/keyboard.ts";
import { clipboard, tokenize } from "./deps.ts"; import { clipboard, tokenize } from "../deps.ts";
import { getBuiltins } from "./runcode.ts"; import { getBuiltins } from "../runtime/runcode.ts";
import { page } from "./viewsheets.ts"; import { page } from "./viewsheets.ts";
import { mouseDown, mouseHeld, mousePos } from "./mouse.ts"; import { mouseDown, mouseHeld, mousePos } from "../io/mouse.ts";
const historyDebounceFrames = 20; const historyDebounceFrames = 20;

View File

@ -1,13 +1,13 @@
import { clearScreen, fillRect } from "./window.ts"; import { clearScreen, fillRect } from "../io/window.ts";
import { codetab } from "./codetab.ts"; import { codetab } from "./codetab.ts";
import { spritetab } from "./spritetab.ts"; import { spritetab } from "./spritetab.ts";
import { viewsheets, page } from "./viewsheets.ts"; import { viewsheets, page } from "./viewsheets.ts";
import { COLOR } from "./colors.ts"; import { COLOR } from "../data/colors.ts";
import { mouseClick, mousePos } from "./mouse.ts"; import { mouseClick, mousePos } from "../io/mouse.ts";
import { drawIcon } from "./builtins.ts"; import { drawIcon } from "../runtime/builtins.ts";
import { inRect } from "./util.ts"; import { inRect } from "../util/util.ts";
import { sheetsIcon, trashIcon } from "./icons.ts"; import { sheetsIcon, trashIcon } from "../data/icons.ts";
import { SheetType, setSheet } from "./sheet.ts"; import { SheetType, setSheet } from "../io/sheet.ts";
import { nonetab } from "./nonetab.ts"; import { nonetab } from "./nonetab.ts";
import { maptab } from "./maptab.ts"; import { maptab } from "./maptab.ts";

View File

@ -1,13 +1,11 @@
import { clearScreen, fillRect } from "./window.ts"; import { clearScreen, fillRect } from "../io/window.ts";
import { drawSprite, drawText } from "./builtins.ts"; import { drawSprite, drawText, useSpritesheet } from "../runtime/builtins.ts";
import { COLOR } from "./colors.ts"; import { COLOR } from "../data/colors.ts";
import { getMapSheet, getSheet, setSheet } from "./sheet.ts"; import { getMapSheet, getSheet, setSheet } from "../io/sheet.ts";
import { M, mouseClick, mouseDown, mouseHeld, mousePos } from "./mouse.ts"; import { M, mouseClick, mouseDown, mouseHeld, mousePos } from "../io/mouse.ts";
import { drawTransparentRect, drawVoidRect, inRect, reGrid } from "./util.ts"; import { drawTransparentRect, drawVoidRect, inRect, reGrid } from "../util/util.ts";
import { page } from "./viewsheets.ts"; import { page } from "./viewsheets.ts";
import { useSpritesheet } from "./builtins.ts"; import { keyPressed, K } from "../io/keyboard.ts";
import { keyPressed } from "./keyboard.ts";
import { K } from "./keyboard.ts";
const state = { const state = {
selectedSpriteSheet: 0, selectedSpriteSheet: 0,

View File

@ -1,12 +1,11 @@
import { clearScreen, fillRect } from "./window.ts"; import { clearScreen, fillRect } from "../io/window.ts";
import { drawIcon, drawText } from "./builtins.ts"; import { drawIcon, drawText, useSpritesheet } from "../runtime/builtins.ts";
import { COLOR } from "./colors.ts"; import { COLOR } from "../data/colors.ts";
import { getSheet, setSheet } from "./sheet.ts"; import { getSheet, setSheet } from "../io/sheet.ts";
import { mouseClick, mousePos } from "./mouse.ts"; import { mouseClick, mousePos } from "../io/mouse.ts";
import { reGridWithGap } from "./util.ts"; import { reGridWithGap } from "../util/util.ts";
import { page } from "./viewsheets.ts"; import { page } from "./viewsheets.ts";
import { useSpritesheet } from "./builtins.ts"; import { codeIcon, mapIcon, spriteIcon } from "../data/icons.ts";
import { codeIcon, mapIcon, spriteIcon } from "./icons.ts";
const gridX = 8; const gridX = 8;
const gridY = 40; const gridY = 40;

View File

@ -1,11 +1,10 @@
import { clearScreen, fillRect } from "./window.ts"; import { clearScreen, fillRect } from "../io/window.ts";
import { drawSprite, drawText } from "./builtins.ts"; import { drawSprite, drawText, useSpritesheet } from "../runtime/builtins.ts";
import { COLOR } from "./colors.ts"; import { COLOR } from "../data/colors.ts";
import { getSpriteSheet, setSheet } from "./sheet.ts"; import { getSpriteSheet, setSheet } from "../io/sheet.ts";
import { mouseClick, mouseHeld, mousePos } from "./mouse.ts"; import { mouseClick, mouseHeld, mousePos } from "../io/mouse.ts";
import { drawTransparentRect, inRect, outlineRect, reGrid } from "./util.ts"; import { drawTransparentRect, inRect, outlineRect, reGrid } from "../util/util.ts";
import { page } from "./viewsheets.ts"; import { page } from "./viewsheets.ts";
import { useSpritesheet } from "./builtins.ts";
const state = { const state = {
selectedSprite: 0, selectedSprite: 0,

View File

@ -1,12 +1,12 @@
import { clearScreen, fillRect } from "./window.ts"; import { clearScreen, fillRect } from "../io/window.ts";
import { drawIcon, drawText } from "./builtins.ts"; import { drawIcon, drawText } from "../runtime/builtins.ts";
import { COLOR } from "./colors.ts"; import { COLOR } from "../data/colors.ts";
import { getSheet } from "./sheet.ts"; import { getSheet } from "../io/sheet.ts";
import { mouseClick, mousePos } from "./mouse.ts"; import { mouseClick, mousePos } from "../io/mouse.ts";
import { getCart } from "./cart.ts"; import { getCart } from "../io/cart.ts";
import { font } from "./font.ts"; import { font } from "../data/font.ts";
import { codeIcon, spriteIcon, mapIcon } from "./icons.ts"; import { codeIcon, spriteIcon, mapIcon } from "../data/icons.ts";
import { reGridWithGap } from "./util.ts"; import { reGridWithGap } from "../util/util.ts";
const fontHeight = font.height; const fontHeight = font.height;

View File

@ -2,15 +2,15 @@ import {
mainloop, mainloop,
frame, frame,
clearScreen, clearScreen,
} from "./window.ts"; } from "./io/window.ts";
import { runCode } from "./runcode.ts"; import { runCode } from "./runtime/runcode.ts";
import { getCodeSheet } from "./sheet.ts"; import { getCodeSheet } from "./io/sheet.ts";
import { refreshKeyboard, keyPressed, K } from "./keyboard.ts"; import { refreshKeyboard, keyPressed, K } from "./io/keyboard.ts";
import { repl, resetRepl } from "./repl.ts"; import { repl, resetRepl } from "./repl/repl.ts";
import { addToContext } from "./runcode.ts"; import { addToContext } from "./runtime/runcode.ts";
import { editmode } from "./editmode.ts"; import { editmode } from "./editor/editmode.ts";
import { refreshMouse } from "./mouse.ts"; import { refreshMouse } from "./io/mouse.ts";
import { camera } from "./builtins.ts"; import { camera } from "./runtime/builtins.ts";
// deno-lint-ignore no-explicit-any // deno-lint-ignore no-explicit-any
let game: any = null; let game: any = null;

View File

@ -1,5 +1,5 @@
import { path } from "./deps.ts"; import { path } from "../deps.ts";
import initialCart from "./initialCart.json" assert { type: "json" }; import initialCart from "../data/initialCart.json" assert { type: "json" };
import { Sheet } from "./sheet.ts"; import { Sheet } from "./sheet.ts";
const extension = ".faux"; const extension = ".faux";

View File

@ -1,4 +1,4 @@
import { font, CHAR } from "./font.ts"; import { font, CHAR } from "../data/font.ts";
const keyboard = new Map<number, {first: boolean, repeat: boolean, held: boolean}>(); const keyboard = new Map<number, {first: boolean, repeat: boolean, held: boolean}>();

View File

@ -1,5 +1,5 @@
import { getCart } from "./cart.ts"; import { getCart } from "./cart.ts";
import { LinearGrid } from "./util.ts"; import { LinearGrid } from "../util/util.ts";
// import { runCode, addToContext } from "./runcode.ts"; // import { runCode, addToContext } from "./runcode.ts";
// "code" | "spritesheet" | "map" | "sfx" | "patterns" | "fonts" // "code" | "spritesheet" | "map" | "sfx" | "patterns" | "fonts"

View File

@ -2,9 +2,9 @@ import {
createWindow, createWindow,
getProcAddress, getProcAddress,
gl, gl,
} from "./deps.ts"; } from "../deps.ts";
export {mainloop} from "./deps.ts"; export {mainloop} from "../deps.ts";
import { COLOR, palette } from "./colors.ts"; import { COLOR, palette } from "../data/colors.ts";
export const gameWindow = createWindow({ export const gameWindow = createWindow({
title: "Faux", title: "Faux",

View File

@ -1,9 +1,9 @@
import { drawText} from "./builtins.ts"; import { drawText} from "../runtime/builtins.ts";
import { getKeysPressed, shiftKeyDown, shiftMap, K } from "./keyboard.ts"; import { getKeysPressed, shiftKeyDown, shiftMap, K } from "../io/keyboard.ts";
import { font } from "./font.ts"; import { font } from "../data/font.ts";
import { addToContext, evalCode } from "./runcode.ts"; import { addToContext, evalCode } from "../runtime/runcode.ts";
import { clearScreen, fillRect } from "./window.ts"; import { clearScreen, fillRect } from "../io/window.ts";
import { COLOR } from "./colors.ts"; import { COLOR } from "../data/colors.ts";
const lineHeight = 6; const lineHeight = 6;

View File

@ -8,15 +8,15 @@ outlineCircle,
fillEllipse, fillEllipse,
outlineEllipse, outlineEllipse,
setPixelColor, setPixelColor,
} from "./window.ts"; } from "../io/window.ts";
import { CHAR, Font, font } from "./font.ts"; import { CHAR, Font, font } from "../data/font.ts";
import { K, keyDown, keyPressed, keyReleased } from "./keyboard.ts"; import { K, keyDown, keyPressed, keyReleased } from "../io/keyboard.ts";
import { addToContext, runCode } from "./runcode.ts"; import { addToContext, runCode } from "./runcode.ts";
import { resetRepl } from "./repl.ts"; import { resetRepl } from "../repl/repl.ts";
import { COLOR } from "./colors.ts"; import { COLOR } from "../data/colors.ts";
import { getSheet, getCodeSheet, getMapSheet } from "./sheet.ts"; import { getSheet, getCodeSheet, getMapSheet } from "../io/sheet.ts";
import { saveCart, loadCart } from "./cart.ts"; import { saveCart, loadCart } from "../io/cart.ts";
import { outlineRect } from "./util.ts"; import { outlineRect } from "../util/util.ts";
let spritesheet: number | null = null; let spritesheet: number | null = null;

View File

@ -1,5 +1,5 @@
import { COLOR } from "./colors.ts"; import { COLOR } from "../data/colors.ts";
import { fillRect, setPixelColor } from "./window.ts"; import { fillRect, setPixelColor } from "../io/window.ts";
export const inRect = (x: number, y: number, rectX: number, rectY: number, rectW: number, rectH: number) => { export const inRect = (x: number, y: number, rectX: number, rectY: number, rectW: number, rectH: number) => {
return ( return (