mirror of
https://gitlab.com/lecarore/breakout71.git
synced 2025-05-05 03:07:14 -04:00
wip
This commit is contained in:
parent
19ec28a027
commit
d572467e99
6 changed files with 39 additions and 26 deletions
|
@ -1249,9 +1249,6 @@ export function gameStateTick(
|
|||
coin.x,
|
||||
(clamp(speed, 20, 100) / 100) * 0.2,
|
||||
);
|
||||
if (gameState.perks.compound_interest) {
|
||||
resetCombo(gameState, coin.x, coin.y);
|
||||
}
|
||||
if (!isOptionOn("basic")) {
|
||||
makeParticle(
|
||||
gameState,
|
||||
|
@ -1263,6 +1260,12 @@ export function gameStateTick(
|
|||
false,
|
||||
);
|
||||
}
|
||||
|
||||
if (gameState.perks.compound_interest && !gameState.perks.buoy) {
|
||||
// If you dont have buoy, we directly declare the coin "lost" to make it clear
|
||||
resetCombo(gameState, coin.x, coin.y);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (
|
||||
|
@ -1285,6 +1288,10 @@ export function gameStateTick(
|
|||
) {
|
||||
gameState.levelLostCoins += coin.points;
|
||||
destroy(gameState.coins, coinIndex);
|
||||
if (gameState.perks.compound_interest && gameState.perks.buoy) {
|
||||
// If you have buoy, we wait a bit more before declaring a coin "lost"
|
||||
resetCombo(gameState, coin.x, coin.y);
|
||||
}
|
||||
|
||||
if (
|
||||
gameState.combo < gameState.perks.fountain_toss * 30 &&
|
||||
|
@ -1652,9 +1659,8 @@ export function ballTick(gameState: GameState, ball: Ball, frames: number) {
|
|||
speedLimitDampener += 3;
|
||||
|
||||
ball.vx +=
|
||||
((gameState.puckPosition - ball.x) / 1000) *
|
||||
(gameState.puckPosition > ball.x ? 1 :-1) *
|
||||
frames *
|
||||
gameState.perks.yoyo *
|
||||
yoyoEffectRate(gameState, ball);
|
||||
}
|
||||
|
||||
|
|
|
@ -202,12 +202,10 @@ export function telekinesisEffectRate(gameState: GameState, ball: Ball) {
|
|||
}
|
||||
|
||||
export function yoyoEffectRate(gameState: GameState, ball: Ball) {
|
||||
return (
|
||||
(gameState.perks.yoyo &&
|
||||
ball.vy > 0 &&
|
||||
clamp(1 - (ball.y / gameState.gameZoneHeight) * 1.1 + 0.1, 0, 1)) ||
|
||||
0
|
||||
);
|
||||
if(ball.vy < 0) return 0
|
||||
if(!gameState.perks.yoyo) return 0
|
||||
return Math.abs(gameState.puckPosition - ball.x)/gameState.gameZoneWidth * gameState.perks.yoyo/2
|
||||
|
||||
}
|
||||
|
||||
export function findLast<T>(
|
||||
|
@ -284,7 +282,7 @@ export function isMovingWhilePassiveIncome(gameState: GameState) {
|
|||
gameState.lastPuckMove &&
|
||||
gameState.perks.passive_income &&
|
||||
gameState.lastPuckMove >
|
||||
gameState.levelTime - 250 * gameState.perks.passive_income
|
||||
gameState.levelTime - (100 * gameState.perks.passive_income - 50)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ import { isOptionOn } from "./options";
|
|||
import {
|
||||
ballTransparency,
|
||||
catchRateBest,
|
||||
catchRateGood,
|
||||
catchRateGood, clamp,
|
||||
coinsBoostedCombo,
|
||||
levelTimeBest,
|
||||
levelTimeGood,
|
||||
|
@ -401,11 +401,11 @@ export function render(gameState: GameState) {
|
|||
) {
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(gameState.puckPosition, gameState.gameZoneHeight);
|
||||
ctx.globalAlpha =
|
||||
ctx.globalAlpha =clamp(
|
||||
Math.max(
|
||||
telekinesisEffectRate(gameState, ball),
|
||||
yoyoEffectRate(gameState, ball),
|
||||
) * ballAlpha;
|
||||
) * ballAlpha,0,1);
|
||||
ctx.strokeStyle = gameState.puckColor;
|
||||
ctx.bezierCurveTo(
|
||||
gameState.puckPosition,
|
||||
|
|
|
@ -926,10 +926,10 @@ export const rawUpgrades = [
|
|||
max: 4,
|
||||
name: t("upgrades.passive_income.name"),
|
||||
help: (lvl: number) =>
|
||||
t("upgrades.passive_income.tooltip", { time: lvl * 0.25, lvl }),
|
||||
t("upgrades.passive_income.tooltip", { time: lvl * 0.10-0.05, lvl }),
|
||||
fullHelp: (lvl: number) =>
|
||||
t("upgrades.passive_income.verbose_description", {
|
||||
time: lvl * 0.25,
|
||||
time: lvl * 0.10-0.05,
|
||||
lvl,
|
||||
}),
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue