Fix collision detection

This commit is contained in:
schmelczerandras 2020-08-17 18:55:47 +02:00
parent 006ab3c4e6
commit 5b4e67cbf0
9 changed files with 169 additions and 49 deletions

View file

@ -12,9 +12,9 @@ import { createCharacter } from './objects/world/create-character';
import { createDungeon } from './objects/world/create-dungeon';
import { RenderCommand } from './drawing/commands/render';
import { Physics } from './physics/physics';
import { MoveToCommand } from './physics/commands/move-to';
import { TeleportToCommand } from './physics/commands/teleport-to';
import { IRenderer } from './drawing/i-renderer';
import { Random } from './helper/random';
export class Game {
private previousTime?: DOMHighResTimeStamp = null;
@ -28,6 +28,8 @@ export class Game {
const canvas: HTMLCanvasElement = document.querySelector('canvas#main');
const overlay: HTMLElement = document.querySelector('#overlay');
Random.seed = 42;
document.addEventListener(
'visibilitychange',
this.handleVisibilityChange.bind(this)