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(); } }