From 254e318f8641eb9b4796f5e75d94a804d8c40744 Mon Sep 17 00:00:00 2001 From: adjoly Date: Thu, 23 Oct 2025 22:44:47 +0200 Subject: [PATCH] =?UTF-8?q?=E3=80=8C=F0=9F=94=A8=E3=80=8D=20fix:=20now=20l?= =?UTF-8?q?ess=20shitty?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/front/static/ts/oneko.ts | 5 ++++- src/front/static/ts/views/TetrisVersus.ts | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/front/static/ts/oneko.ts b/src/front/static/ts/oneko.ts index 57670eb..01d3453 100644 --- a/src/front/static/ts/oneko.ts +++ b/src/front/static/ts/oneko.ts @@ -186,7 +186,10 @@ export function oneko() { idleTime += 1; // every ~ 20 seconds - if ( + if (oneko_state === 2) { + idleAnimation = "sleeping"; + } + else if ( idleTime > 10 && Math.floor(Math.random() * 200) == 0 && idleAnimation == null diff --git a/src/front/static/ts/views/TetrisVersus.ts b/src/front/static/ts/views/TetrisVersus.ts index f9debac..68f40e8 100644 --- a/src/front/static/ts/views/TetrisVersus.ts +++ b/src/front/static/ts/views/TetrisVersus.ts @@ -1,7 +1,7 @@ import Aview from "./Aview.ts"; import { isLogged } from "../main.js"; import { dragElement } from "./drag.js"; -import { setOnekoState, setBallPos, setOnekoOffset } from "../oneko.ts"; +import { setOnekoState, setBallPos, setOnekoOffset, setSleepPos } from "../oneko.ts"; export default class extends Aview { running: boolean; @@ -53,6 +53,7 @@ export default class extends Aview { } async run() { + setSleepPos(); dragElement(document.getElementById("window")); const COLS = 10; const ROWS = 20; @@ -920,6 +921,7 @@ export default class extends Aview { this.drawPiece(); this.drawHUD(); this.drawQueue(); + setSleepPos(); } }