Skip to content

Commit 2286ef0

Browse files
committed
Added a download of the level
1 parent 46f3825 commit 2286ef0

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

game.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,4 +308,19 @@ class Player extends Actor{
308308
get type() {
309309
return 'player';
310310
}
311-
}
311+
}
312+
313+
const actorDict = {
314+
'@': Player,
315+
'v': FireRain,
316+
'=': HorizontalFireball,
317+
'|': VerticalFireball,
318+
'o': Coin
319+
};
320+
321+
const parser = new LevelParser(actorDict);
322+
323+
loadLevels()
324+
.then(schemas => runGame(JSON.parse(schemas), parser, DOMDisplay))
325+
.then(() => alert('Вы выиграли приз!'))
326+
.catch(err => alert(err));

0 commit comments

Comments
 (0)