Compare commits

..

No commits in common. "f3955e971732d825788bcc90b26054cc8a0decfe" and "0e089ffb052099df9b8870dcb6c4d7651668bafa" have entirely different histories.

共有 4 個文件被更改,包括 10 次插入19 次删除

查看文件

@ -9,8 +9,6 @@ export const selectLevel = (ctx, gameState, id) => {
// TODO transfer expireFunction without a fail
// const expireFunc = () => {gameState.timer.expireFunction();};
gameState.timer.setTime(levelsBlueprint[id].time);
gameState.playable = true;
gameState.tutorial.hide();
gameState.playground.draw(ctx, gameState.width, gameState.height);
}

查看文件

@ -66,7 +66,7 @@ const level5Blueprint = {
[Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Floor, Square.Box, Square.Floor, Square.Wall, Square.Floor, Square.Wall, Square.Wall, Square.Wall, ],
[Square.Wall, Square.Destination, Square.Destination, Square.Destination, Square.Destination, Square.Floor, Square.Floor, Square.Wall, Square.Wall, Square.Floor, Square.Box, Square.Floor, Square.Floor, Square.Box, Square.Floor, Square.Floor, Square.Wall, ],
[Square.Wall, Square.Wall, Square.Destination, Square.Destination, Square.Destination, Square.Floor, Square.Floor, Square.Floor, Square.Floor, Square.Box, Square.Floor, Square.Floor, Square.Box, Square.Floor, Square.Floor, Square.Floor, Square.Wall, ],
[Square.Wall, Square.Destination, Square.Destination, Square.Destination, Square.Destination, Square.Floor, Square.Floor, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, ],
[Square.Wall, Square.Destination, Square.Destination, Square.Destination, Square.Floor, Square.Floor, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, ],
[Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, ],
],
time: 40000

查看文件

@ -11,21 +11,14 @@ export class TutorialControler {
self.messageBox = document.getElementById('tutorial-box');
self.messageId = 0;
self.messageBox.innerHTML = TutorialControler.messages[self.messageId];
self.hide = () => {
document.getElementById('tutorial-speech-bubble').style.visibility = "hidden";
self.finished = true;
}
}
hide() {
self.hide();
}
next() {
if (!self.finished) {
self.messageId++;
if (self.messageId == TutorialControler.messages.length) {
self.hide();
document.getElementById('tutorial-speech-bubble').style.visibility = "hidden";
self.finished = true;
} else {
self.messageBox.innerHTML = TutorialControler.messages[self.messageId];
}
@ -35,5 +28,4 @@ export class TutorialControler {
isFinished() {
return self.finished;
}
}

查看文件

@ -31,9 +31,10 @@ let gameState = {
gameState.timer.stop();
} ),
levelId: 0,
tutorial: new TutorialControler(),
};
let tutorial = new TutorialControler();
fillLevelsSelection(gameState, ctx);
window.ctx = ctx
window.addEventListener("keydown", (event) => {
@ -65,11 +66,11 @@ window.addEventListener("keydown", (event) => {
case "ArrowRight":
case " ":
case "Enter":
gameState.tutorial.next();
if (gameState.tutorial.isFinished()) {
gameState.playable = true;
gameState.timer.start();
}
tutorial.next();
if (tutorial.isFinished()) {
gameState.playable = true;
gameState.timer.start();
}
break;
default:
break;