aboutsummaryrefslogtreecommitdiffstats
path: root/src/Images.ts
diff options
context:
space:
mode:
authorMaksymilian Jopek <maks@jopek.eu>2022-05-31 18:11:09 +0200
committerMaksymilian Jopek <maks@jopek.eu>2022-05-31 18:11:09 +0200
commit0010f2de57cfa97106432ea1849c1bb75d3d99a1 (patch)
tree41e89ff13aacfc4dc1324a365302a0867e316dc9 /src/Images.ts
parent344737031e5bbad5f24469aabf45be6535c893f3 (diff)
download1942-0010f2de57cfa97106432ea1849c1bb75d3d99a1.tar.gz
1942-0010f2de57cfa97106432ea1849c1bb75d3d99a1.tar.zst
1942-0010f2de57cfa97106432ea1849c1bb75d3d99a1.zip
All enemies movement
Diffstat (limited to 'src/Images.ts')
-rw-r--r--src/Images.ts39
1 files changed, 38 insertions, 1 deletions
diff --git a/src/Images.ts b/src/Images.ts
index a6bc1e0..fce97ea 100644
--- a/src/Images.ts
+++ b/src/Images.ts
@@ -2,7 +2,7 @@
// "/src/imgs/bg2.png",
// "/src/imgs/topbar.png",
// ];
-import { allChars } from "./consts";
+import { allChars, alphabet } from "./consts";
import { toKebabCase } from "./helpers";
export const IMGS = {
@@ -27,12 +27,42 @@ export const IMGS = {
bigCircleLeftToDown1: {} as HTMLImageElement,
bigCircleLeftToDown2: {} as HTMLImageElement,
bigCircleLeftToDown3: {} as HTMLImageElement,
+ bigStrangeUp0: {} as HTMLImageElement,
+ bigStrangeUp1: {} as HTMLImageElement,
simpleDown: {} as HTMLImageElement,
simpleRot1: {} as HTMLImageElement,
simpleRot2: {} as HTMLImageElement,
simpleRot3: {} as HTMLImageElement,
simpleRot4: {} as HTMLImageElement,
simpleUp: {} as HTMLImageElement, // po 4 klatki na sprite
+ redRight: {} as HTMLImageElement,
+ redRightToDown: {} as HTMLImageElement,
+ redRightToUp: {} as HTMLImageElement,
+ redDown: {} as HTMLImageElement,
+ redDownToLeft: {} as HTMLImageElement,
+ redDownToRight: {} as HTMLImageElement,
+ redLeft: {} as HTMLImageElement,
+ redLeftToUp: {} as HTMLImageElement,
+ redLeftToDown: {} as HTMLImageElement,
+ redUp: {} as HTMLImageElement,
+ redUpToRight: {} as HTMLImageElement,
+ redUpToLeft: {} as HTMLImageElement,
+ greenUp: {} as HTMLImageElement,
+ greenUpToRight: {} as HTMLImageElement,
+ greenUpToLeft: {} as HTMLImageElement,
+ greenRight: {} as HTMLImageElement,
+ greenRightToDown: {} as HTMLImageElement,
+ greenDown: {} as HTMLImageElement,
+ greenDownToLeft: {} as HTMLImageElement,
+ greenLeft: {} as HTMLImageElement,
+ greenLeftToUp: {} as HTMLImageElement,
+ whiteDown: {} as HTMLImageElement,
+ whiteTurnLeft: {} as HTMLImageElement,
+ whiteTurnRight: {} as HTMLImageElement,
+ whiteStrangeLeft: {} as HTMLImageElement,
+ whiteStrangeRight: {} as HTMLImageElement,
+ planeIcon: {} as HTMLImageElement,
+ rollIcon: {} as HTMLImageElement,
font: {
white: {} as any,
yellow: {} as any,
@@ -40,6 +70,9 @@ export const IMGS = {
red: {} as any,
green: {} as any,
purple: {} as any,
+ small: {
+ white: {} as any,
+ },
' ': {} as HTMLImageElement,
},
selector: {} as HTMLImageElement,
@@ -52,6 +85,7 @@ export default async function loadAllImages() {
IMGS[key as keyof typeof IMGS] = await asyncImageLoader("/src/imgs/" + toKebabCase(key) + ".png") as any
}
for (const color of ['yellow', 'white']) {
+ // for (const color of ['white']) {
for (const char of allChars) {
(((IMGS.font as any)[color] as any)[char]) = await asyncImageLoader("/src/imgs/font/" + color + "/" + encodeURIComponent(char) + ".png") as any
}
@@ -59,6 +93,9 @@ export default async function loadAllImages() {
IMGS.font[' '] = await asyncImageLoader("/src/imgs/font/ .png")
IMGS.font.yellow[' '] = await asyncImageLoader("/src/imgs/font/ .png")
IMGS.font.white[' '] = await asyncImageLoader("/src/imgs/font/ .png")
+ for (const c of allChars.filter(ch => !alphabet.includes(ch))) {
+ IMGS.font.small.white[c] = await asyncImageLoader("/src/imgs/font/small/white/" + c + ".png");
+ }
}
async function asyncImageLoader(url: string): Promise<HTMLImageElement> {
return new Promise((resolve, reject) => {