mirror of
https://gitlab.com/lecarore/breakout71.git
synced 2025-04-21 04:26:14 -04:00
Automatic deploy 28999931
This commit is contained in:
parent
0e95dbcbc8
commit
1141ffaf39
5 changed files with 143 additions and 96 deletions
|
@ -57,6 +57,9 @@ There's also an easy mode for kids (slower ball) and a color-blind mode (no colo
|
|||
- coins of different colors repulse
|
||||
- bricks follow game of life pattern with one update every second
|
||||
- 2x coins when ball goes downward / upward, half that amount otherwise ?
|
||||
- new ball spawns when reaching combo X
|
||||
- missing with combo triggers explosive lightning strike
|
||||
- correction : pick one past upgrade to remove and replace by something else
|
||||
|
||||
## Engine ideas
|
||||
|
||||
|
|
|
@ -11,8 +11,8 @@ android {
|
|||
applicationId = "me.lecaro.breakout"
|
||||
minSdk = 21
|
||||
targetSdk = 34
|
||||
versionCode = 28999417
|
||||
versionName = "28999417"
|
||||
versionCode = 28999931
|
||||
versionName = "28999931"
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
vectorDrawables {
|
||||
useSupportLibrary = true
|
||||
|
|
|
@ -72,6 +72,7 @@ function resetCombo(x, y) {
|
|||
});
|
||||
}
|
||||
}
|
||||
return lost
|
||||
}
|
||||
|
||||
function decreaseCombo(by, x, y) {
|
||||
|
@ -199,7 +200,6 @@ function spawnExplosion(count, x, y, color, duration = 150, size = coinSize) {
|
|||
}
|
||||
|
||||
|
||||
|
||||
let score = 0;
|
||||
let scoreStory = [];
|
||||
|
||||
|
@ -337,7 +337,13 @@ function getLevelStats() {
|
|||
}
|
||||
|
||||
function pickedUpgradesHTMl() {
|
||||
return upgrades.filter(u => perks[u.id]).map(u => u.icon).join(' ')
|
||||
let list=''
|
||||
for(let u of upgrades){
|
||||
for(let i=0;i< perks[u.id];i++)
|
||||
list+=u.icon+' '
|
||||
}
|
||||
|
||||
return list
|
||||
}
|
||||
|
||||
async function openUpgradesPicker() {
|
||||
|
@ -457,9 +463,13 @@ const upgrades = [
|
|||
{
|
||||
"threshold": 0,
|
||||
"id": "viscosity",
|
||||
"name": "Slower coins fall",
|
||||
"name": "Viscosity",
|
||||
"max": 3,
|
||||
"help": "Coins quickly decelerate."
|
||||
"help": "Slower coins fall.",
|
||||
tryout: {
|
||||
perks: {viscosity: 3, base_combo: 3},
|
||||
level: 'Waves'
|
||||
}
|
||||
},
|
||||
{
|
||||
"threshold": 0,
|
||||
|
@ -480,7 +490,7 @@ const upgrades = [
|
|||
{
|
||||
"threshold": 0,
|
||||
"id": "skip_last",
|
||||
"name": "Last brick breaks",
|
||||
"name": "Easy Cleanup",
|
||||
"max": 7,
|
||||
"help": "The last brick will self-destruct."
|
||||
},
|
||||
|
@ -495,9 +505,12 @@ const upgrades = [
|
|||
{
|
||||
"threshold": 1000,
|
||||
"id": "coin_magnet",
|
||||
"name": "Puck attracts coins",
|
||||
"name": "Coins magnet",
|
||||
"max": 3,
|
||||
"help": "Coins are drawn toward the puck."
|
||||
"help": "Puck attracts coins.",
|
||||
tryout: {
|
||||
perks: {coin_magnet: 3, base_combo: 3}
|
||||
}
|
||||
},
|
||||
{
|
||||
"threshold": 1500,
|
||||
|
@ -505,7 +518,7 @@ const upgrades = [
|
|||
"giftable": true,
|
||||
"name": "+1 ball",
|
||||
"max": 3,
|
||||
"help": "Start with one more balls."
|
||||
"help": "Start with one more balls.",
|
||||
},
|
||||
{
|
||||
"threshold": 2000,
|
||||
|
@ -518,26 +531,35 @@ const upgrades = [
|
|||
"threshold": 3000,
|
||||
"id": "pierce",
|
||||
"giftable": true,
|
||||
"name": "Ball pierces bricks",
|
||||
"name": "Heavy ball",
|
||||
"max": 3,
|
||||
"help": "Destroy 3 blocks before bouncing."
|
||||
"help": "Ball pierces bricks."
|
||||
},
|
||||
{
|
||||
"threshold": 4000,
|
||||
"id": "picky_eater",
|
||||
"giftable": true,
|
||||
"name": "Single color streak",
|
||||
"name": "Picky eater",
|
||||
"color_blind_exclude": true,
|
||||
"max": 1,
|
||||
"help": "Break bricks color by color."
|
||||
"help": "Break bricks color by color.",
|
||||
|
||||
tryout: {
|
||||
perks: {picky_eater: 1},
|
||||
level: 'Mountain'
|
||||
}
|
||||
},
|
||||
{
|
||||
"threshold": 5000,
|
||||
"id": "metamorphosis",
|
||||
"name": "Coins stain bricks",
|
||||
"name": "Stain",
|
||||
"color_blind_exclude": true,
|
||||
"max": 1,
|
||||
"help": "Coins color the bricks they touch."
|
||||
"help": "Coins color the bricks they touch.",
|
||||
tryout: {
|
||||
perks: {metamorphosis: 3},
|
||||
level: 'Lines'
|
||||
}
|
||||
},
|
||||
{
|
||||
"threshold": 6000,
|
||||
|
@ -559,16 +581,21 @@ const upgrades = [
|
|||
"threshold": 9000,
|
||||
"id": "sapper",
|
||||
"giftable": true,
|
||||
"name": "Bricks become bombs",
|
||||
"name": "Sapper",
|
||||
"max": 1,
|
||||
"help": "Broken blocks become bombs."
|
||||
"help": "Bricks become bombs."
|
||||
},
|
||||
{
|
||||
"threshold": 11000,
|
||||
"id": "bigger_explosions",
|
||||
"name": "Bigger explosions",
|
||||
"name": "Kaboom",
|
||||
"max": 1,
|
||||
"help": "Larger bomb area of effect."
|
||||
"help": "Bigger explosions.",
|
||||
|
||||
tryout: {
|
||||
perks: {bigger_explosions: 1},
|
||||
level: 'Ship'
|
||||
}
|
||||
},
|
||||
{
|
||||
"threshold": 13000,
|
||||
|
@ -595,25 +622,31 @@ const upgrades = [
|
|||
{
|
||||
"threshold": 21000,
|
||||
"id": "ball_repulse_ball",
|
||||
"name": "Balls repulse balls",
|
||||
"name": "Personal space",
|
||||
requires: 'multiball',
|
||||
"max": 3,
|
||||
"help": "Only has an effect with 2+ balls."
|
||||
"help": "Balls repulse balls.",
|
||||
tryout: {
|
||||
perks: {ball_repulse_ball: 1, multiball: 2},
|
||||
}
|
||||
},
|
||||
{
|
||||
"threshold": 25000,
|
||||
"id": "ball_attract_ball",
|
||||
requires: 'multiball',
|
||||
"name": "Balls attract balls",
|
||||
"name": "Gravity",
|
||||
"max": 3,
|
||||
"help": "Only has an effect with 2+ balls."
|
||||
"help": "Balls attract balls.",
|
||||
tryout: {
|
||||
perks: {ball_attract_ball: 1, multiball: 2},
|
||||
}
|
||||
},
|
||||
{
|
||||
"threshold": 30000,
|
||||
"id": "puck_repulse_ball",
|
||||
"name": "Puck repulse balls",
|
||||
"name": "Soft landing",
|
||||
"max": 3,
|
||||
"help": "Prevents the puck from touching the balls.",
|
||||
"help": "Puck repulses balls.",
|
||||
},
|
||||
]
|
||||
|
||||
|
@ -629,16 +662,21 @@ function getPossibleUpgrades() {
|
|||
|
||||
|
||||
function shuffleLevels(nameToAvoid = null) {
|
||||
const target = nextRunOverrides?.level;
|
||||
if (target) {
|
||||
runLevels = allLevels.filter(l => l.name === target)
|
||||
nextRunOverrides.level = null
|
||||
if (runLevels.length) return
|
||||
console.log('target level not found, will take random one : ' + target)
|
||||
}
|
||||
|
||||
runLevels = allLevels
|
||||
.filter(l => nextRunOverrides.level ? l.name === nextRunOverrides.level : true)
|
||||
.filter((l, li) => totalScoreAtRunStart >= l.threshold)
|
||||
.filter(l => l.name !== nameToAvoid || allLevels.length === 1)
|
||||
.sort(() => Math.random() - 0.5)
|
||||
.slice(0, 7 + 3)
|
||||
.sort((a, b) => a.sortKey - b.sortKey);
|
||||
|
||||
nextRunOverrides.level = null
|
||||
}
|
||||
|
||||
function getUpgraderUnlockPoints() {
|
||||
|
@ -668,6 +706,10 @@ function getUpgraderUnlockPoints() {
|
|||
|
||||
let lastOffered = {}
|
||||
|
||||
function dontOfferTooSoon(id){
|
||||
lastOffered[id] = Math.round(Date.now() / 1000)
|
||||
}
|
||||
|
||||
function pickRandomUpgrades(count) {
|
||||
|
||||
let list = getPossibleUpgrades()
|
||||
|
@ -679,7 +721,7 @@ function pickRandomUpgrades(count) {
|
|||
|
||||
list.forEach(u => {
|
||||
incrementRunStatistics('offered_upgrade.' + u.id, 1)
|
||||
lastOffered[u.id] = Math.round(Date.now() / 1000)
|
||||
dontOfferTooSoon(u.id)
|
||||
})
|
||||
|
||||
return list.map(u => ({
|
||||
|
@ -717,6 +759,7 @@ function restart() {
|
|||
const randomGift = reset_perks();
|
||||
|
||||
incrementRunStatistics('starting_upgrade.' + randomGift, 1)
|
||||
dontOfferTooSoon(randomGift)
|
||||
|
||||
setLevel(0);
|
||||
scoreStory.push(`You started playing with the upgrade "${upgrades.find(u => u.id === randomGift)?.name}" on the level "${runLevels[0].name}". `,);
|
||||
|
@ -1043,11 +1086,11 @@ function ballTick(ball, delta) {
|
|||
attract(ball, b2, perks.ball_attract_ball)
|
||||
}
|
||||
}
|
||||
if (perks.puck_repulse_ball) {
|
||||
if (perks.puck_repulse_ball && Math.abs(ball.x-puck)<puckWidth/2+ballSize*(9+perks.puck_repulse_ball)/10) {
|
||||
repulse(ball, {
|
||||
x: puck,
|
||||
y: gameZoneHeight,
|
||||
color: currentLevelInfo().black_puck ? '#000' : '#FFF',
|
||||
color: currentLevelInfo()?.black_puck ? '#000' : '#FFF',
|
||||
}, perks.puck_repulse_ball, false)
|
||||
}
|
||||
|
||||
|
@ -1079,16 +1122,18 @@ function ballTick(ball, delta) {
|
|||
if (!ball.hitSinceBounce) {
|
||||
incrementRunStatistics('miss')
|
||||
levelMisses++;
|
||||
flashes.push({
|
||||
type: "text",
|
||||
text: 'miss',
|
||||
time: levelTime,
|
||||
color: ball.color,
|
||||
x: ball.x,
|
||||
y: ball.y - ballSize,
|
||||
duration: 450,
|
||||
size: puckHeight,
|
||||
})
|
||||
const loss=resetCombo(ball.x,ball.y)
|
||||
//
|
||||
// flashes.push({
|
||||
// type: "text",
|
||||
// text: 'miss',
|
||||
// time: levelTime,
|
||||
// color: ball.color,
|
||||
// x: ball.x,
|
||||
// y: ball.y - ballSize,
|
||||
// duration: 450,
|
||||
// size: puckHeight,
|
||||
// })
|
||||
if (ball.bouncesList?.length ) {
|
||||
ball.bouncesList.push({
|
||||
x: ball.previousx,
|
||||
|
@ -1108,7 +1153,7 @@ function ballTick(ball, delta) {
|
|||
ethereal: true,
|
||||
time: levelTime,
|
||||
size: coinSize / 2,
|
||||
color: ball.color,
|
||||
color: loss?'red':ball.color,
|
||||
x: start.x + (i / (parts - 1)) * (end.x - start.x),
|
||||
y: start.y + (i / (parts - 1)) * (end.y - start.y),
|
||||
vx: (Math.random() - 0.5) * baseSpeed,
|
||||
|
@ -2096,7 +2141,7 @@ function createExplosionSound(pan = 0.5) {
|
|||
let levelTime = 0;
|
||||
|
||||
setInterval(() => {
|
||||
document.body.className = (running ? " running " : " paused ") + (currentLevelInfo().black_puck ? ' black_puck ' : ' ');
|
||||
document.body.className = (running ? " running " : " paused ") + (currentLevelInfo()?.black_puck ? ' black_puck ' : ' ');
|
||||
}, 100);
|
||||
|
||||
window.addEventListener("visibilitychange", () => {
|
||||
|
@ -2298,12 +2343,12 @@ async function openSettingsPanel() {
|
|||
name,
|
||||
max,
|
||||
help, id,
|
||||
threshold, icon
|
||||
threshold, icon, tryout
|
||||
}) => ({
|
||||
text: name,
|
||||
help: ts >= threshold ? help : `Unlocks at total score ${threshold}.`,
|
||||
disabled: ts < threshold,
|
||||
value: {perks: {[id]: 1}},
|
||||
value: tryout || {perks: {[id]: max}},
|
||||
icon
|
||||
})
|
||||
)
|
||||
|
@ -2386,7 +2431,7 @@ Click an item above to start a test run with it.
|
|||
}
|
||||
],
|
||||
textAfterButtons: `
|
||||
<p>Made in France by <a href="https://lecaro.me">Renan LE CARO</a><br/>
|
||||
<p>Breakout 71 build ${window.appVersion}, made in France by <a href="https://lecaro.me">Renan LE CARO</a><br/>
|
||||
<a href="./privacy.html" target="_blank">privacy policy</a> -
|
||||
<a href="https://play.google.com/store/apps/details?id=me.lecaro.breakout" target="_blank">Google Play</a> -
|
||||
<a href="https://renanlecaro.itch.io/breakout71" target="_blank">itch.io</a>
|
||||
|
@ -2408,7 +2453,7 @@ function distanceBetween(a, b) {
|
|||
}
|
||||
|
||||
function rainbowColor() {
|
||||
return `hsl(${(levelTime / 2) % 360},100%,70%)`
|
||||
return `hsl(${Math.round((levelTime / 4)) * 2 % 360},100%,70%)`
|
||||
}
|
||||
|
||||
function repulse(a, b, power, impactsBToo) {
|
||||
|
@ -2420,8 +2465,6 @@ function repulse(a, b, power, impactsBToo) {
|
|||
// Unit vector
|
||||
const dx = (a.x - b.x) / distance
|
||||
const dy = (a.y - b.y) / distance
|
||||
// TODO
|
||||
|
||||
const fact = -power * (max - distance) / (max * 1.2) / 3 * Math.min(500, levelTime) / 500
|
||||
if (impactsBToo) {
|
||||
b.vx += dx * fact
|
||||
|
|
|
@ -8,14 +8,15 @@
|
|||
/>
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
|
||||
<title>Breakout 71</title>
|
||||
<link rel="stylesheet" href="style.css?v=28999417" />
|
||||
<link rel="stylesheet" href="style.css?v=28999931" />
|
||||
<link rel="icon" href="./icon.svg" />
|
||||
</head>
|
||||
<body>
|
||||
<button id="menu">☰<span> menu</span></button>
|
||||
<button id="score"></button>
|
||||
<canvas id="game"></canvas>
|
||||
<script src="levels.js?v=28999417"></script>
|
||||
<script src="game.js?v=28999417"></script>
|
||||
<script>window.appVersion="?v=28999931".slice(3)</script>
|
||||
<script src="levels.js?v=28999931"></script>
|
||||
<script src="game.js?v=28999931"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -12,7 +12,7 @@ sed -i -e "s/^[[:space:]]*versionCode = .*/ versionCode = $versionCode/"
|
|||
|
||||
|
||||
|
||||
# Invalidate web cache
|
||||
# Invalidate web cache and update version
|
||||
sed -i "s/\?v=[0-9]*/\?v=$versionCode/g" ./app/src/main/assets/index.html
|
||||
|
||||
# remove all exif metadata from pictures, because i think fdroid doesn't like that. odd
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue