Add title screen

Multi-language support
This commit is contained in:
Marcel
2017-12-17 11:58:10 +01:00
parent 3950345a04
commit 31a0d63cd0
5 changed files with 120 additions and 32 deletions

20
menu.js Normal file
View File

@@ -0,0 +1,20 @@
// const canvas = document.getElementById("tetris");
// const context = canvas.getContext('2d');
window.onresize = function (event) {
scaleWindow();
};
function scaleWindow() {
canvas.height = window.innerHeight - 40;
canvas.width = canvas.height / (5 / 3);
context.scale(canvas.width / fieldSize.x, canvas.height / fieldSize.y);
}
scaleWindow();
document.getElementById("game-play").addEventListener("click", (event) => {
document.getElementById("game-title").parentNode.removeChild(document.getElementById("game-title"));
document.getElementById("game-play").parentNode.removeChild(document.getElementById("game-play"));
startGame();
});