mirror of
https://gitlab.com/lecarore/breakout71.git
synced 2025-04-20 04:05:06 -04:00
Passive income and clairvoyant adjusments
This commit is contained in:
parent
41b3e6f00b
commit
5a10f7d768
10 changed files with 68 additions and 57 deletions
|
@ -227,11 +227,15 @@ export function render(gameState: GameState) {
|
|||
|
||||
ctx.globalAlpha = 1;
|
||||
ctx.globalCompositeOperation = "source-over";
|
||||
|
||||
gameState.balls.forEach((ball) => {
|
||||
|
||||
const drawingColor = (gameState.lastPuckMove&& gameState.perks.passive_income && gameState.combo>baseCombo(gameState) && gameState.lastPuckMove>gameState.levelTime-500*gameState.perks.passive_income && 'red')||gameState.ballsColor
|
||||
|
||||
// The white border around is to distinguish colored balls from coins/bg
|
||||
drawBall(
|
||||
ctx,
|
||||
gameState.ballsColor,
|
||||
drawingColor,
|
||||
gameState.ballSize,
|
||||
ball.x,
|
||||
ball.y,
|
||||
|
@ -252,6 +256,17 @@ export function render(gameState: GameState) {
|
|||
);
|
||||
ctx.stroke();
|
||||
}
|
||||
if(gameState.perks.clairvoyant && gameState.ballStickToPuck){
|
||||
ctx.strokeStyle = gameState.ballsColor;
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(ball.x,ball.y);
|
||||
ctx.lineTo(
|
||||
ball.x+ball.vx*10,
|
||||
ball.y+ball.vy*10
|
||||
);
|
||||
ctx.stroke();
|
||||
}
|
||||
|
||||
});
|
||||
// The puck
|
||||
ctx.globalAlpha = 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue