}
}
-game['fn'].animate = ( scene) => {
+game['fn'].animate = (scene) => {
if(!('startTime' in game)) {
game.startTime = game.view.clock.getElapsedTime();
}
game.ui.reachedStart = true;
}, fadeDuration);
}
- if(target == 'title') {
- game.ui.cheatBuffer = '';
+ if(target == 'title' && game.view) {
+ game.view.cheatBuffer = '';
}
if(target == 'title' && (!game.ui.currentPage || ['loading', 'controls'].includes(game.ui.currentPage))) {
game['fn'].initializeGame(game.ui.root.querySelector('canvas'));
return;
}
if(game.ui.currentPage == 'title' && e.key.match(/[a-z]/)) {
- game.ui.cheatBuffer = (game.ui.cheatBuffer + e.key).slice(-25);
+ game.view.cheatBuffer = (game.view.cheatBuffer + e.key).slice(-25);
for(let len = 10; len <= 25; len++) {
- if(game.ui.cheatBuffer.length < len) {
+ if(game.view.cheatBuffer.length < len) {
break;
}
- let unlock = game['fn'].unlockWithKey(game.ui.cheatBuffer.slice(-len));
+ let unlock = game['fn'].unlockWithKey(game.view.cheatBuffer.slice(-len));
if(unlock && unlock['type'] == 'feather' && !game.settings['unlocks'].includes(unlock['name'])) {
game['fn'].playRandomSound();
game['fn'].unlockFeather(unlock['name'], unlock['url']);
}, (err) => {
console.error(err);
});
+
};
// Set up name mirrors for each function that should survive most minifiers and transpilers