Add pi and directions
This commit is contained in:
parent
ae3fa89a8b
commit
04f206814c
@ -9,8 +9,8 @@ fillEllipse,
|
||||
outlineEllipse,
|
||||
setPixelColor,
|
||||
} from "./window.ts";
|
||||
import { Font, font } from "./font.ts";
|
||||
import { keyDown, keyPressed, keyReleased } from "./keyboard.ts";
|
||||
import { CHAR, Font, font } from "./font.ts";
|
||||
import { K, keyDown, keyPressed, keyReleased } from "./keyboard.ts";
|
||||
import { addToContext, runCode } from "./runcode.ts";
|
||||
import { resetRepl } from "./repl.ts";
|
||||
import { COLOR } from "./colors.ts";
|
||||
@ -134,6 +134,10 @@ const faux = {
|
||||
getMapSheet(mapSheet)[y*64+x] = [sprSheet, spr];
|
||||
},
|
||||
// Input
|
||||
[CHAR.UP]: K.ARROW_UP,
|
||||
[CHAR.DOWN]: K.ARROW_DOWN,
|
||||
[CHAR.LEFT]: K.ARROW_LEFT,
|
||||
[CHAR.RIGHT]: K.ARROW_RIGHT,
|
||||
btn: keyDown,
|
||||
btnp: keyPressed,
|
||||
btnr: keyReleased,
|
||||
@ -176,6 +180,7 @@ const faux = {
|
||||
sqrt: Math.sqrt,
|
||||
abs: Math.abs,
|
||||
rand: Math.random,
|
||||
[CHAR.PI]: Math.PI,
|
||||
// Other
|
||||
code: (n: number) => {
|
||||
return runCode(getCodeSheet(n));
|
||||
|
@ -66,6 +66,7 @@ const values = [
|
||||
"undefined",
|
||||
"NaN",
|
||||
"Infinity",
|
||||
CHAR.PI,
|
||||
];
|
||||
const operator = [
|
||||
"&&",
|
||||
|
9
font.ts
9
font.ts
@ -22,6 +22,7 @@ export const CHAR = {
|
||||
LEFT: "Á",
|
||||
DOWN: "Â",
|
||||
RIGHT: "Ã",
|
||||
PI: "π"
|
||||
}
|
||||
|
||||
export type Font = {
|
||||
@ -841,5 +842,13 @@ export const font: Font = {
|
||||
0, 1, 1, 1, 1, 1, 0,
|
||||
0, 0, 0, 0, 0, 0, 0,
|
||||
],
|
||||
[CHAR.PI]: [
|
||||
0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0,
|
||||
1, 1, 1, 1, 1,
|
||||
0, 1, 0, 1, 0,
|
||||
0, 1, 0, 1, 0,
|
||||
0, 0, 0, 0, 0,
|
||||
],
|
||||
}
|
||||
};
|
@ -67,6 +67,7 @@ export const altMap = {
|
||||
"a": CHAR.LEFT,
|
||||
"s": CHAR.DOWN,
|
||||
"d": CHAR.RIGHT,
|
||||
"p": CHAR.PI,
|
||||
}
|
||||
|
||||
addEventListener("keydown", (evt) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user