mirror of
https://gitlab.com/lecarore/breakout71.git
synced 2025-04-22 13:06:15 -04:00
Build 29046079
This commit is contained in:
parent
f3790b3334
commit
a3ad3686f3
11 changed files with 121 additions and 102 deletions
|
@ -11,8 +11,8 @@ android {
|
|||
applicationId = "me.lecaro.breakout"
|
||||
minSdk = 21
|
||||
targetSdk = 34
|
||||
versionCode = 29045721
|
||||
versionName = "29045721"
|
||||
versionCode = 29046079
|
||||
versionName = "29046079"
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
vectorDrawables {
|
||||
useSupportLibrary = true
|
||||
|
|
File diff suppressed because one or more lines are too long
12
dist/index.html
vendored
12
dist/index.html
vendored
|
@ -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) {
|
||||
module.exports = JSON.parse("\"29045721\"");
|
||||
module.exports = JSON.parse("\"29046079\"");
|
||||
|
||||
},{}],"1u3Dx":[function(require,module,exports,__globalThis) {
|
||||
var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js");
|
||||
|
@ -2426,10 +2426,10 @@ function pickedUpgradesHTMl(gameState) {
|
|||
return list;
|
||||
}
|
||||
function levelsListHTMl(gameState) {
|
||||
if (!gameState.perks.clairvoyant) return '';
|
||||
if (!gameState.perks.clairvoyant) return "";
|
||||
let list = "";
|
||||
for(let i = 0; i < max_levels(gameState); i++)list += `<span style="opacity: ${i >= gameState.currentLevel ? 1 : 0.2}">${(0, _loadGameData.icons)[gameState.runLevels[i].name]}</span>`;
|
||||
return `<p>${(0, _i18N.t)('score_panel.upcoming_levels')}</p><p>${list}</p>`;
|
||||
return `<p>${(0, _i18N.t)("score_panel.upcoming_levels")}</p><p>${list}</p>`;
|
||||
}
|
||||
function currentLevelInfo(gameState) {
|
||||
return gameState.runLevels[gameState.currentLevel % gameState.runLevels.length];
|
||||
|
@ -2711,7 +2711,7 @@ function explodeBrick(gameState, index, ball, isExplosion) {
|
|||
if (!color) return;
|
||||
if (color === "black") {
|
||||
const x = (0, _gameUtils.brickCenterX)(gameState, index), y = (0, _gameUtils.brickCenterY)(gameState, index);
|
||||
setBrick(gameState, index, '');
|
||||
setBrick(gameState, index, "");
|
||||
explosionAt(gameState, index, x, y, ball);
|
||||
} else if (color) {
|
||||
// Even if it bounces we don't want to count that as a miss
|
||||
|
@ -2855,8 +2855,8 @@ async function setLevel(gameState, l) {
|
|||
(0, _render.background).src = "data:image/svg+xml;UTF8," + lvl.svg;
|
||||
}
|
||||
function setBrick(gameState, index, color) {
|
||||
gameState.bricks[index] = color || '';
|
||||
gameState.brickHP[index] = color === 'black' && 1 || color && 1 + gameState.perks.sturdy_bricks || 0;
|
||||
gameState.bricks[index] = color || "";
|
||||
gameState.brickHP[index] = color === "black" && 1 || color && 1 + gameState.perks.sturdy_bricks || 0;
|
||||
}
|
||||
function rainbowColor() {
|
||||
return `hsl(${Math.round((0, _game.gameState).levelTime / 4) * 2 % 360},100%,70%)`;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// The version of the cache.
|
||||
const VERSION = "29045721";
|
||||
const VERSION = "29046079";
|
||||
|
||||
// The name of the cache
|
||||
const CACHE_NAME = `breakout-71-${VERSION}`;
|
||||
|
|
|
@ -1 +1 @@
|
|||
"29045721"
|
||||
"29046079"
|
||||
|
|
|
@ -14,7 +14,8 @@ import {
|
|||
import { getAudioContext, playPendingSounds } from "./sounds";
|
||||
import {
|
||||
currentLevelInfo,
|
||||
getRowColIndex, levelsListHTMl,
|
||||
getRowColIndex,
|
||||
levelsListHTMl,
|
||||
max_levels,
|
||||
pickedUpgradesHTMl,
|
||||
} from "./game_utils";
|
||||
|
@ -992,7 +993,7 @@ restart(
|
|||
telekinesis: 2,
|
||||
yoyo: 2,
|
||||
metamorphosis: 1,
|
||||
implosions:1
|
||||
implosions: 1,
|
||||
},
|
||||
}
|
||||
: {},
|
||||
|
|
|
@ -149,15 +149,21 @@ export function normalizeGameState(gameState: GameState) {
|
|||
(gameState.gameZoneWidth / 12) *
|
||||
(3 - gameState.perks.smaller_puck + gameState.perks.bigger_puck);
|
||||
|
||||
let minX = gameState.perks.corner_shot && gameState.levelTime? gameState.offsetXRoundedDown - gameState.puckWidth / 2 : gameState.offsetXRoundedDown + gameState.puckWidth / 2
|
||||
let minX =
|
||||
gameState.perks.corner_shot && gameState.levelTime
|
||||
? gameState.offsetXRoundedDown - gameState.puckWidth / 2
|
||||
: gameState.offsetXRoundedDown + gameState.puckWidth / 2;
|
||||
|
||||
let maxX = gameState.perks.corner_shot && gameState.levelTime? gameState.offsetXRoundedDown +
|
||||
let maxX =
|
||||
gameState.perks.corner_shot && gameState.levelTime
|
||||
? gameState.offsetXRoundedDown +
|
||||
gameState.gameZoneWidthRoundedUp +
|
||||
gameState.puckWidth / 2 : gameState.offsetXRoundedDown +
|
||||
gameState.gameZoneWidthRoundedUp -
|
||||
gameState.puckWidth / 2
|
||||
: gameState.offsetXRoundedDown +
|
||||
gameState.gameZoneWidthRoundedUp -
|
||||
gameState.puckWidth / 2;
|
||||
|
||||
gameState.puckPosition = clamp(gameState.puckPosition,minX,maxX)
|
||||
gameState.puckPosition = clamp(gameState.puckPosition, minX, maxX);
|
||||
|
||||
if (gameState.ballStickToPuck) {
|
||||
putBallsAtPuck(gameState);
|
||||
|
@ -254,17 +260,9 @@ export function spawnImplosion(
|
|||
count = 1;
|
||||
}
|
||||
for (let i = 0; i < count; i++) {
|
||||
const dx=((Math.random() - 0.5) * gameState.brickWidth) / 2
|
||||
const dy=((Math.random() - 0.5) * gameState.brickWidth) / 2
|
||||
makeParticle(
|
||||
gameState,
|
||||
x -dx*10 ,
|
||||
y -dy*10,
|
||||
dx,
|
||||
dy,
|
||||
color,
|
||||
false,
|
||||
);
|
||||
const dx = ((Math.random() - 0.5) * gameState.brickWidth) / 2;
|
||||
const dy = ((Math.random() - 0.5) * gameState.brickWidth) / 2;
|
||||
makeParticle(gameState, x - dx * 10, y - dy * 10, dx, dy, color, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -286,7 +284,7 @@ export function explosionAt(
|
|||
const i = getRowColIndex(gameState, row + dy, col + dx);
|
||||
if (gameState.bricks[i] && i !== -1) {
|
||||
// Study bricks resist explosions too
|
||||
gameState.brickHP[i]--
|
||||
gameState.brickHP[i]--;
|
||||
if (gameState.brickHP <= 0) {
|
||||
explodeBrick(gameState, i, ball, true);
|
||||
}
|
||||
|
@ -295,14 +293,14 @@ export function explosionAt(
|
|||
}
|
||||
}
|
||||
|
||||
const factor = gameState.perks.implosions ? -1:1
|
||||
const factor = gameState.perks.implosions ? -1 : 1;
|
||||
// Blow nearby coins
|
||||
forEachLiveOne(gameState.coins, (c) => {
|
||||
const dx = c.x - x;
|
||||
const dy = c.y - y;
|
||||
const d2 = Math.max(gameState.brickWidth, Math.abs(dx) + Math.abs(dy));
|
||||
c.vx += ((dx / d2) * 10 * size) / c.weight * factor;
|
||||
c.vy += ((dy / d2) * 10 * size) / c.weight* factor;
|
||||
c.vx += (((dx / d2) * 10 * size) / c.weight) * factor;
|
||||
c.vy += (((dy / d2) * 10 * size) / c.weight) * factor;
|
||||
});
|
||||
gameState.lastExplosion = Date.now();
|
||||
|
||||
|
@ -313,9 +311,9 @@ export function explosionAt(
|
|||
7 * (1 + gameState.perks.bigger_explosions),
|
||||
x,
|
||||
y,
|
||||
"white")
|
||||
"white",
|
||||
);
|
||||
} else {
|
||||
|
||||
spawnExplosion(
|
||||
gameState,
|
||||
7 * (1 + gameState.perks.bigger_explosions),
|
||||
|
@ -336,7 +334,7 @@ export function explodeBrick(
|
|||
gameState: GameState,
|
||||
index: number,
|
||||
ball: Ball,
|
||||
isExplosion: boolean
|
||||
isExplosion: boolean,
|
||||
) {
|
||||
const color = gameState.bricks[index];
|
||||
if (!color) return;
|
||||
|
@ -344,7 +342,7 @@ export function explodeBrick(
|
|||
if (color === "black") {
|
||||
const x = brickCenterX(gameState, index),
|
||||
y = brickCenterY(gameState, index);
|
||||
setBrick(gameState, index, '')
|
||||
setBrick(gameState, index, "");
|
||||
explosionAt(gameState, index, x, y, ball);
|
||||
} else if (color) {
|
||||
// Even if it bounces we don't want to count that as a miss
|
||||
|
@ -415,9 +413,9 @@ export function explodeBrick(
|
|||
|
||||
if (gameState.perks.side_kick) {
|
||||
if (Math.abs(ball.vx) > Math.abs(ball.vy)) {
|
||||
gameState.combo += gameState.perks.side_kick
|
||||
gameState.combo += gameState.perks.side_kick;
|
||||
} else {
|
||||
decreaseCombo(gameState, gameState.perks.side_kick, ball.x,ball.y)
|
||||
decreaseCombo(gameState, gameState.perks.side_kick, ball.x, ball.y);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -593,9 +591,9 @@ export async function setLevel(gameState: GameState, l: number) {
|
|||
empty(gameState.particles);
|
||||
empty(gameState.lights);
|
||||
empty(gameState.texts);
|
||||
gameState.bricks = []
|
||||
gameState.bricks = [];
|
||||
for (let i = 0; i < lvl.size * lvl.size; i++) {
|
||||
setBrick(gameState, i,lvl.bricks[i])
|
||||
setBrick(gameState, i, lvl.bricks[i]);
|
||||
}
|
||||
|
||||
// Balls color will depend on most common brick color sometimes
|
||||
|
@ -607,11 +605,13 @@ export async function setLevel(gameState: GameState, l: number) {
|
|||
}
|
||||
|
||||
function setBrick(gameState: GameState, index: number, color: string) {
|
||||
gameState.bricks[index] = color||'';
|
||||
gameState.brickHP[index] = (color === 'black' && 1) ||(color && 1+gameState.perks.sturdy_bricks)||0
|
||||
gameState.bricks[index] = color || "";
|
||||
gameState.brickHP[index] =
|
||||
(color === "black" && 1) ||
|
||||
(color && 1 + gameState.perks.sturdy_bricks) ||
|
||||
0;
|
||||
}
|
||||
|
||||
|
||||
export function rainbowColor(): colorString {
|
||||
return `hsl(${(Math.round(gameState.levelTime / 4) * 2) % 360},100%,70%)`;
|
||||
}
|
||||
|
@ -722,7 +722,6 @@ export function attract(gameState: GameState, a: Ball, b: Ball, power: number) {
|
|||
}
|
||||
|
||||
export function coinBrickHitCheck(gameState: GameState, coin: Coin) {
|
||||
|
||||
// Make ball/coin bonce, and return bricks that were hit
|
||||
const radius = coin.size / 2;
|
||||
const { x, y, previousX, previousY } = coin;
|
||||
|
@ -735,7 +734,6 @@ export function coinBrickHitCheck(gameState: GameState, coin: Coin) {
|
|||
hitsSomething(x, y, radius)) ||
|
||||
undefined;
|
||||
if (!gameState.perks.ghost_coins) {
|
||||
|
||||
if (typeof vhit !== "undefined" || typeof chit !== "undefined") {
|
||||
coin.y = coin.previousY;
|
||||
coin.vy *= -1;
|
||||
|
@ -1004,7 +1002,10 @@ export function gameStateTick(
|
|||
}
|
||||
}
|
||||
|
||||
if ((!gameState.perks.ghost_coins && typeof hitBrick !== "undefined") || hitBorder) {
|
||||
if (
|
||||
(!gameState.perks.ghost_coins && typeof hitBrick !== "undefined") ||
|
||||
hitBorder
|
||||
) {
|
||||
coin.vx *= 0.8;
|
||||
coin.vy *= 0.8;
|
||||
coin.sa *= 0.9;
|
||||
|
@ -1449,7 +1450,7 @@ export function ballTick(gameState: GameState, ball: Ball, delta: number) {
|
|||
});
|
||||
}
|
||||
ball.hitItem = [];
|
||||
if (!ball.hitSinceBounce && gameState.bricks.find(i=>i)) {
|
||||
if (!ball.hitSinceBounce && gameState.bricks.find((i) => i)) {
|
||||
gameState.runStatistics.misses++;
|
||||
if (gameState.perks.forgiving) {
|
||||
const loss = Math.floor(
|
||||
|
@ -1509,20 +1510,26 @@ export function ballTick(gameState: GameState, ball: Ball, delta: number) {
|
|||
const hitBrick = vhit ?? hhit ?? chit;
|
||||
|
||||
if (typeof hitBrick !== "undefined") {
|
||||
|
||||
ball.hitSinceBounce++;
|
||||
let pierce = false;
|
||||
let damage= 1+(shouldPierceByColor(gameState, vhit, hhit, chit) ? gameState.perks.pierce_color :0)
|
||||
let damage =
|
||||
1 +
|
||||
(shouldPierceByColor(gameState, vhit, hhit, chit)
|
||||
? gameState.perks.pierce_color
|
||||
: 0);
|
||||
|
||||
gameState.brickHP[hitBrick]-=damage
|
||||
gameState.brickHP[hitBrick] -= damage;
|
||||
|
||||
const used = Math.min(ball.piercePoints, Math.max(1,gameState.brickHP[hitBrick]))
|
||||
gameState.brickHP[hitBrick]-=used
|
||||
ball.piercePoints-=used
|
||||
const used = Math.min(
|
||||
ball.piercePoints,
|
||||
Math.max(1, gameState.brickHP[hitBrick]),
|
||||
);
|
||||
gameState.brickHP[hitBrick] -= used;
|
||||
ball.piercePoints -= used;
|
||||
|
||||
if (gameState.brickHP[hitBrick] < 0) {
|
||||
gameState.brickHP[hitBrick]=0
|
||||
pierce=true
|
||||
gameState.brickHP[hitBrick] = 0;
|
||||
pierce = true;
|
||||
}
|
||||
if (typeof vhit !== "undefined" || typeof chit !== "undefined") {
|
||||
if (!pierce) {
|
||||
|
@ -1547,7 +1554,7 @@ export function ballTick(gameState: GameState, ball: Ball, delta: number) {
|
|||
initialBrickColor !== "black" && // don't replace a brick that bounced with sturdy_bricks
|
||||
!gameState.bricks[hitBrick]
|
||||
) {
|
||||
setBrick(gameState, hitBrick, "black")
|
||||
setBrick(gameState, hitBrick, "black");
|
||||
ball.sapperUses++;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -66,12 +66,12 @@ export function pickedUpgradesHTMl(gameState: GameState) {
|
|||
return list;
|
||||
}
|
||||
export function levelsListHTMl(gameState: GameState) {
|
||||
if(!gameState.perks.clairvoyant) return ''
|
||||
if (!gameState.perks.clairvoyant) return "";
|
||||
let list = "";
|
||||
for (let i = 0; i < max_levels(gameState); i++) {
|
||||
list += `<span style="opacity: ${i >= gameState.currentLevel ? 1 : 0.2}">${icons[gameState.runLevels[i].name]}</span>`;
|
||||
}
|
||||
return `<p>${t('score_panel.upcoming_levels')}</p><p>${list}</p>`;
|
||||
return `<p>${t("score_panel.upcoming_levels")}</p><p>${list}</p>`;
|
||||
}
|
||||
|
||||
export function currentLevelInfo(gameState: GameState) {
|
||||
|
|
|
@ -303,7 +303,9 @@ export function render(gameState: GameState) {
|
|||
} else {
|
||||
drawText(
|
||||
ctx,
|
||||
comboTextWidth > gameState.puckWidth ? gameState.combo.toString() : comboText,
|
||||
comboTextWidth > gameState.puckWidth
|
||||
? gameState.combo.toString()
|
||||
: comboText,
|
||||
"#000",
|
||||
comboTextWidth > gameState.puckWidth ? 12 : 20,
|
||||
gameState.puckPosition,
|
||||
|
@ -387,7 +389,8 @@ export function renderAllBricks() {
|
|||
gameState.perks.picky_eater &&
|
||||
!isOptionOn("basic");
|
||||
|
||||
const clairVoyance= gameState.perks.clairvoyant && gameState.brickHP.reduce((a,b)=>a+b,0)
|
||||
const clairVoyance =
|
||||
gameState.perks.clairvoyant && gameState.brickHP.reduce((a, b) => a + b, 0);
|
||||
|
||||
const newKey =
|
||||
gameState.gameZoneWidth +
|
||||
|
@ -400,7 +403,8 @@ export function renderAllBricks() {
|
|||
gameState.ballsColor +
|
||||
"_" +
|
||||
gameState.perks.pierce_color +
|
||||
"_"+ clairVoyance;
|
||||
"_" +
|
||||
clairVoyance;
|
||||
if (newKey !== cachedBricksRenderKey) {
|
||||
cachedBricksRenderKey = newKey;
|
||||
|
||||
|
@ -432,8 +436,15 @@ export function renderAllBricks() {
|
|||
canctx.globalCompositeOperation = "source-over";
|
||||
drawBrick(canctx, color, (redBorder && "red") || color, x, y);
|
||||
if (gameState.brickHP[index] > 1 && gameState.perks.clairvoyant) {
|
||||
canctx.globalCompositeOperation="destination-out"
|
||||
drawText(canctx, gameState.brickHP[index].toString(), "white", gameState.puckHeight, x,y )
|
||||
canctx.globalCompositeOperation = "destination-out";
|
||||
drawText(
|
||||
canctx,
|
||||
gameState.brickHP[index].toString(),
|
||||
"white",
|
||||
gameState.puckHeight,
|
||||
x,
|
||||
y,
|
||||
);
|
||||
}
|
||||
|
||||
if (color === "black") {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue