From e876f65c376207ae84ae324fe21fa5cd2f007174 Mon Sep 17 00:00:00 2001 From: AlexTVL Date: Sun, 8 Dec 2024 18:50:03 -0800 Subject: [PATCH] final background update --- assets/js/platformer/BackgroundSnowfall.js | 26 ++++++------------ assets/js/platformer/GameSetterWinter.js | 2 +- .../backgrounds/bee__1_-removebg-preview.png | Bin 0 -> 3881 bytes images/platformer/backgrounds/beefall (2).png | Bin 0 -> 284 bytes .../backgrounds/beetuah-removebg-preview.png | Bin 0 -> 608 bytes images/platformer/backgrounds/beetuah.png | Bin 0 -> 571 bytes 6 files changed, 10 insertions(+), 18 deletions(-) create mode 100644 images/platformer/backgrounds/bee__1_-removebg-preview.png create mode 100644 images/platformer/backgrounds/beefall (2).png create mode 100644 images/platformer/backgrounds/beetuah-removebg-preview.png create mode 100644 images/platformer/backgrounds/beetuah.png diff --git a/assets/js/platformer/BackgroundSnowfall.js b/assets/js/platformer/BackgroundSnowfall.js index fe22708..84a1692 100644 --- a/assets/js/platformer/BackgroundSnowfall.js +++ b/assets/js/platformer/BackgroundSnowfall.js @@ -5,7 +5,7 @@ export class BackgroundSnowfall extends Background { super(canvas, image, data); this.snowflakes = []; this.snowflakeImage = new Image(); - this.snowflakeImage.src = '/images/platformer/backgrounds/beefall.png'; // Correct path to the image + this.snowflakeImage.src = 'images/platformer/backgrounds/bee__1_-removebg-preview.png'; // Correct path to the image this.snowflakeImage.onload = () => { console.log('Snowflake image loaded successfully'); this.createSnowflakes(); @@ -17,11 +17,11 @@ export class BackgroundSnowfall extends Background { } createSnowflakes() { - for (let i = 0; i < 75; i++) { // Number of snowflakes + for (let i = 0; i < 10; i++) { // Number of snowflakes this.snowflakes.push({ x: Math.random() * this.canvas.width, y: Math.random() * this.canvas.height, - radius: Math.random() * 1.0 + 0.25, // Size of snowflakes + radius: Math.random() * 4.5 + 3.0, // Size of snowflakes speed: Math.random() * 0.5 + 0.2 // Speed of snowflakes }); } @@ -29,10 +29,10 @@ export class BackgroundSnowfall extends Background { update() { for (let flake of this.snowflakes) { - flake.y += flake.speed; - if (flake.y > this.canvas.height) { - flake.y = 0; - flake.x = Math.random() * this.canvas.width; + flake.x -= flake.speed; + if (flake.x < 0) { + flake.x = this.canvas.width; + flake.y = Math.random() * this.canvas.height; } } super.update(); @@ -41,18 +41,10 @@ export class BackgroundSnowfall extends Background { draw() { this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height); for (let flake of this.snowflakes) { - if (this.snowflakeImage.complete) { - this.ctx.drawImage(this.snowflakeImage, flake.x, flake.y, flake.radius * 2, flake.radius * 2); - } else { - // Draw a placeholder circle if the image is not loaded - this.ctx.beginPath(); - this.ctx.arc(flake.x, flake.y, flake.radius, 0, Math.PI * 2); - this.ctx.fillStyle = 'white'; - this.ctx.fill(); - } + this.ctx.drawImage(this.snowflakeImage, flake.x, flake.y, flake.radius * 2, flake.radius * 2); } super.draw(); } } -export default BackgroundSnowfall; \ No newline at end of file +export default BackgroundSnowfall; diff --git a/assets/js/platformer/GameSetterWinter.js b/assets/js/platformer/GameSetterWinter.js index 66afdab..a8db2e7 100644 --- a/assets/js/platformer/GameSetterWinter.js +++ b/assets/js/platformer/GameSetterWinter.js @@ -117,7 +117,7 @@ const assets = { space: { src: "/images/platformer/backgrounds/planet.jpg" }, castles: { src: "/images/platformer/backgrounds/castles.png" }, winter: { src: "/images/platformer/backgrounds/flowerBoy3.webp" }, - snow: { src: "/images/platformer/backgrounds/beefall.png" }, + snow: { src: "/images/platformer/backgrounds/beefall (2).png" }, icewater: { src: "/images/platformer/backgrounds/icewater.png" }, narwhal: { src: "/images/platformer/backgrounds/narwhal.png", parallaxSpeed: 2 }, mini: { src: "/images/platformer/backgrounds/mini.png" }, diff --git a/images/platformer/backgrounds/bee__1_-removebg-preview.png b/images/platformer/backgrounds/bee__1_-removebg-preview.png new file mode 100644 index 0000000000000000000000000000000000000000..3b50d013e4b53c3e72f56592efda8767da43d23e GIT binary patch literal 3881 zcmV+^57zLBP)Px@<4Ht8RA@u(nF(-I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i=`E{Ja^=-(SfTT%CXa+$(1cgin znk2x`B*Gy-+FM)j$@_1B6|A7e03cQ4in0onEnfD5!Z2s!WOZH^kJttWOB^nHJ#cGCUxPktisdgj~wN>-CQBWU-4oK_p&Rsr8S1*Wl-#`H!B*pV~C#M+IUr z_lgta;tc*Xzcg5F&yIHcqultu}mcA>$@fe_26dhV=J#h&~Soqh1exFbomI=V@6vHxL97 znT(+qYJ1s1EZyDNAR}EKw;O70JZL$S{mo?WLIzH>{<4F7Wynxp$0H)6`lHEY@=w&b r$+Y{yKqh0<#kBn=$iPx%8c9S!R5(v#WS}x&q_TMo!@$7*f8IW4WD%AmHfV5qdGGeMtN;D^9HOiw#;|qc zHqG3sDL1eg`v2-xHb!mjU;jUT6k_1x`;65<4+qOtGBN_8>MG(47tbGNP*GAoskl%PaoGYG7Qb%YPkpSq2StX@)h+=P>;H z{ga`zq=MnX#jDSZjm=+bYZ?SHNd9`t@JY<*+O-R1JUjxo1mqNY`1!TpVKp$&Rr|lK zxi$my-|q}t*KB4G;$vV)NeW{4_wO5nva&M6kwa%0tSo##Nyup>@ffOYW@Oa<1#>md zFl^5E`hV%vafUCi-ZOYOTQVpsu`%fA$S{2R@R8y1gVzlI{s=KVd;9-~p<}>dT?@NZ zPARR2AVcw{!^RA+|2oPV3@WlhmV5TiKknmY&2ZuTc?Nk|6^7e4Uovp<%P<_cc#}cj z(&>L}LQds>Ce}4XC+uyLa@m>KKK$6fcQ=EUrVhi2<7XL+EgTrm-+IXK`420Dnx+v$ zS$WMWq76h&GV?nN|2%wjoB73?w+ye}eq&(c6k;$iwqhtLDZfOPfiT10K0PJ-`#VeN z-~VjdQi_^)eti3Snq&i0LLKf{Ss92X6;9yCme5Hy5M;=r>D7D1#U-}52j%vo8%mae uAVba_-79Zo?F>#T$bf7EaTOMW-#`G~(Y0d1+zm7U0000>@M( literal 0 HcmV?d00001 diff --git a/images/platformer/backgrounds/beetuah.png b/images/platformer/backgrounds/beetuah.png new file mode 100644 index 0000000000000000000000000000000000000000..fafbb85bd7fbbf2d016dd9a2034575bb3718afeb GIT binary patch literal 571 zcmV-B0>u4^P)xN#0002hP)t-s_VxAU z;M?iuh|~d`1tts_4V@d^ZNSw{QUgs=<43t)ac{i;oR5E#J%|X z{_pGLlY(&5(a~o^8_chMw5_X>cUjTP#;~TJyRoKtQZt)mAGD#5h-*dlswbj~ZGuu3 zr+q!Xi8ZiyC*I4d!@RUmM>~mnZmWe<#lXPe)52m?Ku|OpJ0=oyOd;6S*4VRpmuoA< zltAm^(8r=&rJI%8)61QaiM^Cg`SRZC(THC`DXNxm^4_VvzQNazE!Mh>ns-9coa70O zKK4i1Xxp!$*@#UZ{6