Automatic deploy 29000798

This commit is contained in:
Renan LE CARO 2025-02-20 11:38:38 +01:00
parent 54512644ab
commit 8e258d77a3
3 changed files with 15 additions and 15 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 = 29000794 versionCode = 29000798
versionName = "29000794" versionName = "29000798"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables { vectorDrawables {
useSupportLibrary = true useSupportLibrary = true

View file

@ -2645,7 +2645,7 @@ function recordOneFrame() {
if (!running) return; if (!running) return;
drawMainCanvasOnSmallCanvas() drawMainCanvasOnSmallCanvas()
// Start recording after you hit something // Start recording after you hit something
if(levelSpawnedCoins && levelGif) { if (levelSpawnedCoins && levelGif) {
recordGifFrame() recordGifFrame()
} }
if (captureStream.requestFrame) { if (captureStream.requestFrame) {
@ -2670,17 +2670,18 @@ function drawMainCanvasOnSmallCanvas() {
} }
let nthFrame = 0, gifFrameReduction = 2 let nthFrame = 0, gifFrameReduction = 2
function recordGifFrame(){
function recordGifFrame() {
gifCtx.globalCompositeOperation = 'screen' gifCtx.globalCompositeOperation = 'screen'
gifCtx.globalAlpha = 1 / gifFrameReduction gifCtx.globalAlpha = 1 / gifFrameReduction
gifCtx?.drawImage(canvas, offsetXRoundedDown, 0, gameZoneWidthRoundedUp, gameZoneHeight, 0, 0, gifCanvas.width, gifCanvas.height) gifCtx?.drawImage(canvas, offsetXRoundedDown, 0, gameZoneWidthRoundedUp, gameZoneHeight, 0, 0, gifCanvas.width, gifCanvas.height)
nthFrame++ nthFrame++
if (nthFrame === gifFrameReduction) { if (nthFrame === gifFrameReduction) {
levelGif.addFrame(gifCtx, {delay: Math.round(gifFrameReduction * 1000 / 60), copy: true}); levelGif.addFrame(gifCtx, {delay: Math.round(gifFrameReduction * 1000 / 60), copy: true});
gifCtx.globalCompositeOperation = 'source-over' gifCtx.globalCompositeOperation = 'source-over'
gifCtx.fillStyle = 'black' gifCtx.fillStyle = 'black'
gifCtx.fillRect(0, 0, gifCanvas.width, gifCanvas.height) gifCtx.fillRect(0, 0, gifCanvas.width, gifCanvas.height)
nthFrame=0 nthFrame = 0
} }
} }
@ -2707,7 +2708,8 @@ function startRecordingGame() {
gifCanvas.width = Math.floor(gameZoneWidthRoundedUp * scale / 2) gifCanvas.width = Math.floor(gameZoneWidthRoundedUp * scale / 2)
gifCanvas.height = Math.floor(gameZoneHeight * scale / 2) gifCanvas.height = Math.floor(gameZoneHeight * scale / 2)
// if(isSettingOn('basic')){ // Gif worker won't work there
if (window.location.protocol !== "file:") {
levelGif = new GIF({ levelGif = new GIF({
workers: 2, workers: 2,
quality: 10, quality: 10,
@ -2716,10 +2718,8 @@ function startRecordingGame() {
width: gifCanvas.width, width: gifCanvas.width,
height: gifCanvas.height, height: gifCanvas.height,
dither: false, dither: false,
}); });
// }else{ }
// levelGif=null
// }
// drawMainCanvasOnSmallCanvas() // drawMainCanvasOnSmallCanvas()
const recordedChunks = []; const recordedChunks = [];

View file

@ -8,16 +8,16 @@
/> />
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> <meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Breakout 71</title> <title>Breakout 71</title>
<link rel="stylesheet" href="style.css?v=29000794" /> <link rel="stylesheet" href="style.css?v=29000798" />
<link rel="icon" href="./icon.svg" /> <link rel="icon" href="./icon.svg" />
</head> </head>
<body> <body>
<button id="menu"><span> menu</span></button> <button id="menu"><span> menu</span></button>
<button id="score"></button> <button id="score"></button>
<canvas id="game"></canvas> <canvas id="game"></canvas>
<script>window.appVersion="?v=29000794".slice(3)</script> <script>window.appVersion="?v=29000798".slice(3)</script>
<script src="gif.js"></script> <script src="gif.js"></script>
<script src="levels.js?v=29000794"></script> <script src="levels.js?v=29000798"></script>
<script src="game.js?v=29000794"></script> <script src="game.js?v=29000798"></script>
</body> </body>
</html> </html>