mirror of
https://gitlab.com/lecarore/breakout71.git
synced 2025-04-22 04:56:15 -04:00
Fixed : combo display on small pucks
This commit is contained in:
parent
af02565bf1
commit
f49da76667
3 changed files with 13 additions and 7 deletions
|
@ -281,7 +281,6 @@ export function render(gameState: GameState) {
|
|||
const comboTextWidth = (comboText.length * gameState.puckHeight) / 1.8;
|
||||
const totalWidth = comboTextWidth + gameState.coinSize * 2;
|
||||
const left = gameState.puckPosition - totalWidth / 2;
|
||||
|
||||
if (totalWidth < gameState.puckWidth) {
|
||||
drawCoin(
|
||||
ctx,
|
||||
|
@ -302,11 +301,12 @@ export function render(gameState: GameState) {
|
|||
true,
|
||||
);
|
||||
} else {
|
||||
console.log({comboTextWidth,pw:gameState.puckWidth,combo:gameState.combo, comboText})
|
||||
drawText(
|
||||
ctx,
|
||||
comboText,
|
||||
"#FFF",
|
||||
gameState.puckHeight,
|
||||
comboTextWidth > gameState.puckWidth ? gameState.combo.toString() : comboText,
|
||||
"#000",
|
||||
comboTextWidth > gameState.puckWidth ? 12:20,
|
||||
gameState.puckPosition,
|
||||
gameState.gameZoneHeight - gameState.puckHeight / 2,
|
||||
false,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue