Christmas animations are preloaded now
This commit is contained in:
parent
b70d327f89
commit
ae0c61282b
10
js/module.js
10
js/module.js
@ -34,13 +34,19 @@ function mainLoop(timestamp)
|
|||||||
|
|
||||||
if (game.KeyLoad.isPressed()) {
|
if (game.KeyLoad.isPressed()) {
|
||||||
const dialog = new LoadLevelDialog();
|
const dialog = new LoadLevelDialog();
|
||||||
dialog.onClose = () => {
|
|
||||||
|
dialog.onClose = () => {
|
||||||
dialog.close();
|
dialog.close();
|
||||||
game.isPaused = false;
|
game.isPaused = false;
|
||||||
window.requestAnimationFrame(mainLoop);
|
window.requestAnimationFrame(mainLoop);
|
||||||
}
|
}
|
||||||
dialog.onLoad = (data) => {
|
dialog.onLoad = (data) => {
|
||||||
EventBus.clear();
|
EventBus.clear();
|
||||||
|
|
||||||
|
for (const effect of game.level.fullscreenEffects) {
|
||||||
|
effect.destroy();
|
||||||
|
}
|
||||||
|
|
||||||
loadLevel(Level.createFromJson(data));
|
loadLevel(Level.createFromJson(data));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -55,6 +61,8 @@ function loadLevel(level)
|
|||||||
const loader = new ImageLoader();
|
const loader = new ImageLoader();
|
||||||
loader.addImage(Setting.GRAPHICS_LOCATION + 'mr-croc-walk-right.png');
|
loader.addImage(Setting.GRAPHICS_LOCATION + 'mr-croc-walk-right.png');
|
||||||
loader.addImage(Setting.GRAPHICS_LOCATION + 'mr-croc-walk-left.png');
|
loader.addImage(Setting.GRAPHICS_LOCATION + 'mr-croc-walk-left.png');
|
||||||
|
loader.addImage(Setting.GRAPHICS_LOCATION + 'mr-croc-walk-right-christmas.png');
|
||||||
|
loader.addImage(Setting.GRAPHICS_LOCATION + 'mr-croc-walk-left-christmas.png');
|
||||||
loader.addImage(Setting.GRAPHICS_LOCATION + 'gisela-right.png');
|
loader.addImage(Setting.GRAPHICS_LOCATION + 'gisela-right.png');
|
||||||
loader.addImage(Setting.GRAPHICS_LOCATION + 'gisela-left.png');
|
loader.addImage(Setting.GRAPHICS_LOCATION + 'gisela-left.png');
|
||||||
loader.addImage(Setting.GRAPHICS_LOCATION + 'gisela-left.png');
|
loader.addImage(Setting.GRAPHICS_LOCATION + 'gisela-left.png');
|
||||||
|
Loading…
Reference in New Issue
Block a user