Copy utils

This commit is contained in:
Andras Schmelczer 2023-04-29 21:18:27 +01:00
commit a3f76f5c77
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
14 changed files with 141 additions and 3 deletions

View file

@ -1,10 +1,36 @@
import GameLoop from './game-loop/game-loop';
import './styles/index.scss';
import { applyArrayPlugins } from './utils/array';
declare global {
interface Array<T> {
x: T;
y: T;
}
interface ReadonlyArray<T> {
x: T;
y: T;
}
interface Float32Array {
x: number;
y: number;
}
}
applyArrayPlugins();
const errorContainer = document.querySelector('.errors');
const main = () => {
const canvas = document.querySelector('canvas');
const game = new GameLoop(canvas);
game.start();
try {
const canvas = document.querySelector('canvas');
const game = new GameLoop(canvas);
game.start();
} catch (e) {
errorContainer.innerHTML = e.message;
}
};
main();