This commit is contained in:
Renan LE CARO 2025-05-03 19:41:45 +02:00
parent 258d578ad3
commit 9731d694f3
8 changed files with 791 additions and 722 deletions

View file

@ -12,6 +12,7 @@ import { t } from "./i18n/i18n";
import { clamp } from "./pure_functions";
import { getSettingValue, getTotalScore } from "./settings";
import { isOptionOn } from "./options";
import {gameCanvas} from "./render";
export function describeLevel(level: Level) {
let bricks = 0,
@ -345,3 +346,14 @@ export function escapeAttribute(str: String) {
.replace(/"/gi, """)
.replace(/'/gi, "'");
}
export function canvasCenterX(gameState:GameState){
return gameState.canvasWidth/2
}
export function zoneLeftBorderX(gameState:GameState){
return gameState.offsetXRoundedDown - 1
}
export function zoneRightBorderX(gameState:GameState){
return gameCanvas.width - gameState.offsetXRoundedDown + 1
}