From 013fb0bce7fbe5f89f62b7d5f7aca79893156625 Mon Sep 17 00:00:00 2001 From: adrien Date: Sat, 8 Jul 2023 12:34:35 +0200 Subject: [PATCH] pause style --- app.js | 1 + index.html | 2 +- jsm/TetraGUI.js | 1 + jsm/gamelogic.js | 2 +- style.css | 5 +++-- 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app.js b/app.js index 87cfc54..09091ec 100644 --- a/app.js +++ b/app.js @@ -110,6 +110,7 @@ let game = { document.onkeydown = onkeydown document.onkeyup = onkeyup window.onblur = game.pause + gui.domElement.onfocus = game.pause document.body.classList.remove("pause") gui.resumeButton.hide() diff --git a/index.html b/index.html index d709fb4..bca5ffd 100644 --- a/index.html +++ b/index.html @@ -31,7 +31,7 @@ - PAUSE + II diff --git a/jsm/TetraGUI.js b/jsm/TetraGUI.js index ecda494..d2b304f 100644 --- a/jsm/TetraGUI.js +++ b/jsm/TetraGUI.js @@ -6,6 +6,7 @@ import { I, J, L, O, S, T, Z } from './gamelogic.js' class TetraGUI extends GUI { constructor(game, settings, stats, scene) { super({title: "teTra"}) + this.domElement.tabIndex = 1 this.startButton = this.add(game, "start").name("Jouer").hide() this.pauseButton = this.add(game, "pause").name("Pause").hide() diff --git a/jsm/gamelogic.js b/jsm/gamelogic.js index 120c1d7..43e383c 100644 --- a/jsm/gamelogic.js +++ b/jsm/gamelogic.js @@ -425,7 +425,7 @@ class Matrix extends THREE.Group { updateUnlockedMinoes(delta) { this.unlockedMinoes.forEach(mino => { mino.update(delta) - if (Math.sqrt(mino.position.x * mino.position.x + mino.position.z * mino.position.z) > 40) { + if (Math.sqrt(mino.position.x * mino.position.x + mino.position.z * mino.position.z) > 40 || mino.position.y < -50) { this.remove(mino) this.unlockedMinoes.delete(mino) } diff --git a/style.css b/style.css index 31cc99e..b32c01c 100644 --- a/style.css +++ b/style.css @@ -176,8 +176,9 @@ h1 { height: 100%; z-index: 10; color: rgba(255, 255, 255, 20%); - text-align: center; justify-content: center; align-items: center; - font-size: 10vh; + font-size: 20vh; + font-weight: 800; + letter-spacing: .1em; } \ No newline at end of file