UI and about page in game

This commit is contained in:
2026-02-24 16:57:51 -03:00
parent fe885a9e24
commit 86d527ae51
12 changed files with 268 additions and 6 deletions
+7 -1
View File
@@ -1,4 +1,4 @@
type Asset = HTMLImageElement | HTMLAudioElement;
type Asset = HTMLImageElement | HTMLAudioElement | string;
export class AssetManager {
static instance = new AssetManager();
@@ -41,6 +41,12 @@ export class AssetManager {
audio.load();
this.assets[key] = audio;
this.loading_promises.push(promise);
} else if (src.endsWith(".txt") || src.endsWith(".md")) {
const promise = async () => {
const resp = await fetch(src);
this.assets[key] = await resp.text();
};
this.loading_promises.push(promise());
}
}