Christmas animations are preloaded now
This commit is contained in:
parent
b70d327f89
commit
ae0c61282b
@ -34,6 +34,7 @@ function mainLoop(timestamp)
|
||||
|
||||
if (game.KeyLoad.isPressed()) {
|
||||
const dialog = new LoadLevelDialog();
|
||||
|
||||
dialog.onClose = () => {
|
||||
dialog.close();
|
||||
game.isPaused = false;
|
||||
@ -41,6 +42,11 @@ function mainLoop(timestamp)
|
||||
}
|
||||
dialog.onLoad = (data) => {
|
||||
EventBus.clear();
|
||||
|
||||
for (const effect of game.level.fullscreenEffects) {
|
||||
effect.destroy();
|
||||
}
|
||||
|
||||
loadLevel(Level.createFromJson(data));
|
||||
}
|
||||
|
||||
@ -55,6 +61,8 @@ function loadLevel(level)
|
||||
const loader = new ImageLoader();
|
||||
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-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-left.png');
|
||||
loader.addImage(Setting.GRAPHICS_LOCATION + 'gisela-left.png');
|
||||
|
Loading…
Reference in New Issue
Block a user