Racing conditions at loading time fixed
This commit is contained in:
parent
593d323aff
commit
349792f916
|
@ -18,7 +18,7 @@
|
|||
</style>
|
||||
<link rel="shortcut icon" type="image/png" href="favicon.png">
|
||||
<link rel="stylesheet" type="text/css" href="tilorswift/style.css">
|
||||
<script type="module" src="js/module.js"></script>
|
||||
<script type="module" src="js/module.js" defer></script>
|
||||
</head>
|
||||
<body>
|
||||
<canvas id="canvas"></canvas>
|
||||
|
|
16
js/module.js
16
js/module.js
|
@ -56,13 +56,6 @@ class Game
|
|||
this.loader.addImage(Setting.GRAPHICS_LOCATION + 'gisela-left.png');
|
||||
|
||||
new FrameRateMeasurer();
|
||||
|
||||
window.addEventListener(
|
||||
'imagesloaded',
|
||||
() => {
|
||||
this.init();
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
render(timestamp)
|
||||
|
@ -293,4 +286,11 @@ const level = Level.createFromFile(
|
|||
);
|
||||
|
||||
let game = new Game(level);
|
||||
game.init(mainLoop);
|
||||
|
||||
window.addEventListener(
|
||||
'imagesloaded',
|
||||
() => {
|
||||
game.init(mainLoop);
|
||||
}
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in New Issue