PageSourceSearch

https://bug-fix.org/siid/_next/static/chunks/1087.79732a0d9063c883.js

js bug-fix.org collected 2026-10-04 13:30:15 UTC 7,836 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1087],{1087:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>m});var s=i(5155),a=i(2115),h=i(5154),r=i.n(h),l=i(3095);let n=Math.round(888.8888888888889),d="siid_404_high_score",o="reducedMotion",c="autostart",p='"Bagor", "Poppins", sans-serif',u=[{key:"player",file:"player.png"},{key:"heart-full",file:"heart-full.png"},{key:"heart-empty",file:"heart-empty.png"},{key:"bee",file:"bee.png"},{key:"snake",file:"snake.png"},{key:"brick",file:"brick.png"},{key:"cloud-a",file:"cloud-a.png"},{key:"cloud-b",file:"cloud-b.png"},{key:"cloud-c",file:"cloud-c.png"},{key:"plane",file:"plane.png"},{key:"signboard",file:"signboard.png"},{key:"cat",file:"cat.png"},{key:"flowers",file:"flowers.png"},{key:"ground",file:"ground-tile.png"}];var g=i(7249),y=i.n(g);class f extends r().Scene{gameWidth(){return this.scale.width}init(){this.gameState="idle",this.speed=380,this.distance=0,this.elapsedSec=0,this.lives=3,this.invincibleUntil=0,this.playerVy=0,this.grounded=!0,this.hearts=[],this.skyDecors=[],this.groundDecors=[],this.obstacles=[],this.overlayObjects=[],this.spawnTimer=void 0,this.blinkTimer=void 0,this.reducedMotion=!0===this.registry.get(o),this.highScore=this.readHighScore()}preload(){u.forEach(e=>{let{key:t,file:i}=e;this.load.image(t,"/siid/images/404/".concat(i))})}create(){this.createSky(),this.createGround(),this.createPlayer(),this.createHud(),this.bindInput(),!0===this.registry.get(c)&&(this.registry.set(c,!1),this.startRun())}addImage(e,t,i){return this.add.image(t,i,e).setOrigin(0,0).setScale(.5)}createSky(){[["cloud-a",64,104],["cloud-b",561,45],["cloud-c",1191,52],["plane",761,33]].forEach(e=>{let[t,i,s]=e;this.skyDecors.push(this.addImage(t,i,s+52))})}createGround(){this.ground=this.add.tileSprite(0,361,this.gameWidth(),139,"ground").setOrigin(0,0).setTileScale(.5),[["flowers",638,313],["signboard",1164,252],["cat",1190,206]].forEach(e=>{let[t,i,s]=e;this.groundDecors.push(this.addImage(t,i,s+52))})}createPlayer(){this.player=this.add.image(203,401,"player").setOrigin(0,1).setScale(.5)}createHud(){for(let e=0;e<3;e+=1)this.hearts.push(this.addImage("heart-full",48+33*e,24));this.scoreText=this.add.text(this.gameWidth()-48,24,"",{fontFamily:p,fontSize:"24px",color:"#ffffff"}).setOrigin(1,0),this.updateScoreText(),this.promptText=this.add.text(this.gameWidth()/2,200,"PRESS SPACE / TAP TO START",{fontFamily:p,fontSize:"32px",color:"#ffffff",stroke:"#342525",strokeThickness:6}).setOrigin(.5,.5)}bindInput(){var e,t,i;null==(e=this.input.keyboard)||e.addCapture(["SPACE","UP"]),null==(t=this.input.keyboard)||t.on("keydown-SPACE",this.handleAction,this),null==(i=this.input.keyboard)||i.on("keydown-UP",this.handleAction,this),this.input.on("pointerdown",this.handleAction,this)}handleAction(){return"idle"===this.gameState?void this.startRun():"running"===this.gameState?void this.jump():void(this.registry.set(c,!0),this.scene.restart())}startRun(){this.gameState="running",this.promptText.setVisible(!1),this.spawnTimer=this.time.delayedCall(2500,()=>{this.spawnObstacle(),this.scheduleNextSpawn()})}jump(){this.grounded&&(this.grounded=!1,this.playerVy=-950)}scheduleNextSpawn(){let e=380/this.speed,t=Math.max(650,r().Math.Between(1400,2200)*e);this.spawnTimer=this.time.delayedCall(t,()=>{this.spawnObstacle(),this.scheduleNextSpawn()})}spawnObstacle(){let e=this.gameWidth()+100,t=Math.random(),i=[],s=0,a=!1,h=!1;if(t<.4){h=!0;let t=this.addImage("snake",e,0);t.setY(401-t.displayHeight),i.push(t)}else if(t<.7){a=!0;let t=this.addImage("bee",e,0);s=401-t.displayHeight-55,t.setY(s),i.push(t)}else{let s=t<.9?1:2;for(let t=0;t<s;t+=1){let s=this.addImage("brick",e,0);s.setY(401-s.displayHeight*(t+1)),i.push(s)}}this.obstacles.push({sprites:i,baseY:s,bobPhase:Math.random()*Math.PI*2,isBee:a,isSnake:h})}update(e,t){if("running"!==this.gameState)return;let i=t/1e3;this.elapsedSec+=i,this.speed=Math.min(820,380+14*this.elapsedSec),this.distance+=this.speed*i,this.updateScoreText(),this.ground.tilePositionX+=this.speed*i/.5,this.scrollWithWrap(this.groundDecors,this.speed*i),this.scrollWithWrap(this.skyDecors,.35*this.speed*i),this.updatePlayer(i),this.updateObstacles(e,i)}
1scrollWithWrap(e,t){e.forEach(e=>{e.x-=t,e.x<-e.displayWidth-50&&(e.x+=this.gameWidth()+200)})}updatePlayer(e){if(!this.grounded){this.playerVy+=2200*e;let t=this.player.y+this.playerVy*e;t>=401?(this.player.setY(401),this.playerVy=0,this.grounded=!0):this.player.setY(t)}}updateObstacles(e,t){let i=new(r()).Geom.Rectangle(this.player.x+8,this.player.y-this.player.displayHeight+8,this.player.displayWidth-16,this.player.displayHeight-16),s=this.time.now<this.invincibleUntil;this.obstacles=this.obstacles.filter(a=>{let h=!1,l=this.speed+40*!!a.isSnake;return(a.sprites.forEach(i=>{i.x-=l*t,a.isBee&&!this.reducedMotion&&i.setY(a.baseY+12*Math.sin(.006*e+a.bobPhase)),i.x<-i.displayWidth-50&&(h=!0)}),h)?(a.sprites.forEach(e=>e.destroy()),!1):(!s&&a.sprites.some(e=>r().Geom.Intersects.RectangleToRectangle(i,new(r()).Geom.Rectangle(e.x+8,e.y+8,e.displayWidth-16,e.displayHeight-16)))&&this.onHit(),!0)})}onHit(){var e;if(this.lives-=1,this.hearts.forEach((e,t)=>{e.setTexture(t<this.lives?"heart-full":"heart-empty")}),this.invincibleUntil=this.time.now+1500,this.lives<=0)return void this.gameOver();null==(e=this.blinkTimer)||e.remove();let t=this.reducedMotion?250:100;this.player.setAlpha(.15),this.blinkTimer=this.time.addEvent({delay:t,repeat:Math.floor(1500/t)-1,callback:()=>{this.player.setAlpha(this.player.alpha<1?1:.15)}}),this.time.delayedCall(1500,()=>this.player.setAlpha(1))}gameOver(){var e,t;this.gameState="gameover",null==(e=this.spawnTimer)||e.remove(),null==(t=this.blinkTimer)||t.remove(),this.player.setAlpha(1);let i=this.currentScore();i>this.highScore&&(this.highScore=i,this.writeHighScore(i)),this.updateScoreText();let s=this.add.rectangle(0,0,this.gameWidth(),500,3417381,.6).setOrigin(0,0),a=this.add.text(this.gameWidth()/2,170,"GAME OVER",{fontFamily:p,fontSize:"56px",color:"#ffffff"}).setOrigin(.5,.5),h=this.add.text(this.gameWidth()/2,240,"SCORE ".concat(i,"   HI ").concat(this.highScore),{fontFamily:p,fontSize:"32px",color:"#ffffff"}).setOrigin(.5,.5),r=this.add.text(this.gameWidth()/2,300,"PRESS SPACE / TAP TO RESTART",{fontFamily:p,fontSize:"24px",color:"#ffffff"}).setOrigin(.5,.5);this.overlayObjects=[s,a,h,r]}currentScore(){return Math.floor(this.distance/100)}updateScoreText(){this.scoreText.setText("SCORE ".concat(this.currentScore(),"   HI ").concat(this.highScore))}readHighScore(){try{return Number(window.localStorage.getItem(d))||0}catch(e){return 0}}writeHighScore(e){try{window.localStorage.setItem(d,String(e))}catch(e){}}constructor(){super("main"),this.gameState="idle",this.reducedMotion=!1,this.speed=380,this.distance=0,this.elapsedSec=0,this.lives=3,this.invincibleUntil=0,this.playerVy=0,this.grounded=!0,this.highScore=0,this.hearts=[],this.skyDecors=[],this.groundDecors=[],this.obstacles=[],this.overlayObjects=[]}}function m(){let e=(0,a.useRef)(null),t=(0,a.useRef)(null);return(0,a.useEffect)(()=>{let i=e.current;if(!i||t.current)return;let s=window.matchMedia("(prefers-reduced-motion: reduce)").matches,a=window.matchMedia("(min-width: ".concat(l.L,"px)")),h=()=>{let e=new(r()).Game({type:r().AUTO,parent:i,width:a.matches?1440:n,height:500,backgroundColor:"#29bdf3",pixelArt:!0,scale:{mode:r().Scale.FIT,autoCenter:r().Scale.CENTER_BOTH},scene:[f]});e.registry.set(o,s),t.current=e},d=()=>{var e;null==(e=t.current)||e.destroy(!0),t.current=null,h()};return h(),a.addEventListener("change",d),()=>{var e;a.removeEventListener("change",d),null==(e=t.current)||e.destroy(!0),t.current=null}},[]),(0,s.jsx)("div",{ref:e,className:y().GameCanvas})}},3095:(e,t,i)=>{"use strict";i.d(t,{L:()=>s});let s=1280},7249:e=>{e.exports={GameCanvas:"GameCanvas_GameCanvas__1_wA7"}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.