This commit is contained in:
Renan LE CARO 2025-03-24 10:42:48 +01:00
parent c48b379098
commit 39cf4a4d04
8 changed files with 31 additions and 25 deletions

View file

@ -11,8 +11,8 @@ android {
applicationId = "me.lecaro.breakout" applicationId = "me.lecaro.breakout"
minSdk = 21 minSdk = 21
targetSdk = 34 targetSdk = 34
versionCode = 29046079 versionCode = 29046822
versionName = "29046079" versionName = "29046822"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables { vectorDrawables {
useSupportLibrary = true useSupportLibrary = true

File diff suppressed because one or more lines are too long

4
dist/index.html vendored
View file

@ -1368,7 +1368,7 @@ const upgrades = (0, _upgrades.rawUpgrades).map((u)=>({
})); }));
},{"./data/palette.json":"ktRBU","./data/levels.json":"8JSUc","./data/version.json":"iyP6E","./upgrades":"1u3Dx","./getLevelBackground":"7OIPf","./levelIcon":"6rQoT","@parcel/transformer-js/src/esmodule-helpers.js":"gkKU3"}],"iyP6E":[function(require,module,exports,__globalThis) { },{"./data/palette.json":"ktRBU","./data/levels.json":"8JSUc","./data/version.json":"iyP6E","./upgrades":"1u3Dx","./getLevelBackground":"7OIPf","./levelIcon":"6rQoT","@parcel/transformer-js/src/esmodule-helpers.js":"gkKU3"}],"iyP6E":[function(require,module,exports,__globalThis) {
module.exports = JSON.parse("\"29046079\""); module.exports = JSON.parse("\"29046822\"");
},{}],"1u3Dx":[function(require,module,exports,__globalThis) { },{}],"1u3Dx":[function(require,module,exports,__globalThis) {
var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js"); var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js");
@ -3551,7 +3551,7 @@ function render(gameState) {
ctx.globalAlpha = 1; ctx.globalAlpha = 1;
ctx.globalCompositeOperation = "source-over"; ctx.globalCompositeOperation = "source-over";
gameState.balls.forEach((ball)=>{ gameState.balls.forEach((ball)=>{
const drawingColor = gameState.lastPuckMove && gameState.perks.passive_income && gameState.combo > (0, _gameStateMutators.baseCombo)(gameState) && gameState.lastPuckMove > gameState.levelTime - 500 * gameState.perks.passive_income && 'red' || gameState.ballsColor; const drawingColor = gameState.lastPuckMove && gameState.perks.passive_income && gameState.combo > (0, _gameStateMutators.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 // The white border around is to distinguish colored balls from coins/bg
drawBall(ctx, drawingColor, gameState.ballSize, ball.x, ball.y, gameState.puckColor); drawBall(ctx, drawingColor, gameState.ballSize, ball.x, ball.y, gameState.puckColor);
if ((0, _gameUtils.isTelekinesisActive)(gameState, ball) || (0, _gameUtils.isYoyoActive)(gameState, ball)) { if ((0, _gameUtils.isTelekinesisActive)(gameState, ball) || (0, _gameUtils.isYoyoActive)(gameState, ball)) {

View file

@ -1,5 +1,5 @@
// The version of the cache. // The version of the cache.
const VERSION = "29046079"; const VERSION = "29046822";
// The name of the cache // The name of the cache
const CACHE_NAME = `breakout-71-${VERSION}`; const CACHE_NAME = `breakout-71-${VERSION}`;

View file

@ -1 +1 @@
"29046079" "29046822"

View file

@ -53,10 +53,8 @@ import { use } from "react";
export function setMousePos(gameState: GameState, x: number) { export function setMousePos(gameState: GameState, x: number) {
// Sets the puck position, and updates the ball position if they are supposed to follow it // Sets the puck position, and updates the ball position if they are supposed to follow it
if ( if (Math.abs(x - gameState.puckPosition) > 1) {
Math.abs(x - gameState.puckPosition) > 1 gameState.lastPuckMove = gameState.levelTime;
) {
gameState.lastPuckMove=gameState.levelTime
} }
gameState.puckPosition = x; gameState.puckPosition = x;
gameState.needsRender = true; gameState.needsRender = true;
@ -71,7 +69,7 @@ function getBallDefaultVx(gameState: GameState) {
export function resetBalls(gameState: GameState) { export function resetBalls(gameState: GameState) {
// Always compute speed first // Always compute speed first
normalizeGameState(gameState) normalizeGameState(gameState);
const count = 1 + (gameState.perks?.multiball || 0); const count = 1 + (gameState.perks?.multiball || 0);
const perBall = gameState.puckWidth / (count + 1); const perBall = gameState.puckWidth / (count + 1);
gameState.balls = []; gameState.balls = [];
@ -429,7 +427,12 @@ export function explodeBrick(
} }
} }
if(gameState.lastPuckMove && gameState.perks.passive_income && gameState.lastPuckMove>gameState.levelTime-500*gameState.perks.passive_income){ if (
gameState.lastPuckMove &&
gameState.perks.passive_income &&
gameState.lastPuckMove >
gameState.levelTime - 500 * gameState.perks.passive_income
) {
resetCombo(gameState, x, y); resetCombo(gameState, x, y);
} }

View file

@ -229,8 +229,14 @@ export function render(gameState: GameState) {
ctx.globalCompositeOperation = "source-over"; ctx.globalCompositeOperation = "source-over";
gameState.balls.forEach((ball) => { gameState.balls.forEach((ball) => {
const drawingColor =
const drawingColor = (gameState.lastPuckMove&& gameState.perks.passive_income && gameState.combo>baseCombo(gameState) && gameState.lastPuckMove>gameState.levelTime-500*gameState.perks.passive_income && 'red')||gameState.ballsColor (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 // The white border around is to distinguish colored balls from coins/bg
drawBall( drawBall(
@ -260,13 +266,9 @@ export function render(gameState: GameState) {
ctx.strokeStyle = gameState.ballsColor; ctx.strokeStyle = gameState.ballsColor;
ctx.beginPath(); ctx.beginPath();
ctx.moveTo(ball.x, ball.y); ctx.moveTo(ball.x, ball.y);
ctx.lineTo( ctx.lineTo(ball.x + ball.vx * 10, ball.y + ball.vy * 10);
ball.x+ball.vx*10,
ball.y+ball.vy*10
);
ctx.stroke(); ctx.stroke();
} }
}); });
// The puck // The puck
ctx.globalAlpha = 1; ctx.globalAlpha = 1;

View file

@ -572,7 +572,8 @@ export const rawUpgrades = [
id: "passive_income", id: "passive_income",
max: 4, max: 4,
name: t("upgrades.passive_income.name"), name: t("upgrades.passive_income.name"),
help: (lvl: number) => t("upgrades.passive_income.help",{time:lvl/2,lvl}), help: (lvl: number) =>
t("upgrades.passive_income.help", { time: lvl / 2, lvl }),
fullHelp: t("upgrades.passive_income.fullHelp"), fullHelp: t("upgrades.passive_income.fullHelp"),
}, },
{ {