aboutsummaryrefslogtreecommitdiffstats
path: root/src/consts.ts
diff options
context:
space:
mode:
authorMaksymilian Jopek <maks@jopek.eu>2022-05-24 18:25:43 +0200
committerMaksymilian Jopek <maks@jopek.eu>2022-05-24 18:25:43 +0200
commit2f8b8c87fb2062313afea7b625ccb20d1bea95b9 (patch)
tree973e20986e4b9279b9322a9fd140e6f989eaf492 /src/consts.ts
download1942-2f8b8c87fb2062313afea7b625ccb20d1bea95b9.tar.gz
1942-2f8b8c87fb2062313afea7b625ccb20d1bea95b9.tar.zst
1942-2f8b8c87fb2062313afea7b625ccb20d1bea95b9.zip
Initial commit
Diffstat (limited to 'src/consts.ts')
-rw-r--r--src/consts.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/consts.ts b/src/consts.ts
new file mode 100644
index 0000000..5893b85
--- /dev/null
+++ b/src/consts.ts
@@ -0,0 +1,12 @@
+export const canvas = document.querySelector<HTMLCanvasElement>('canvas')!
+export const ctx = canvas.getContext("2d")!
+ctx.imageSmoothingEnabled = false;
+
+export const PLAYER_SIZE = 20; // canvas-dot
+export const PLAYER_VEL = 3.5; // canvas-dot / frame
+export const BULLET_VEL = 4.5; // canvas-dot / frame
+export const FIRE_DELAY = 300; // ms
+export const TOPBAR_HEIGHT = 24; // ms
+
+export const FPS = 1;
+export const alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '.', '-', '&', '?', '!', 'man', 'woman', 'heart', 'rv', 'ed']