Skip to content

Commit

Permalink
Update floors without graphics
Browse files Browse the repository at this point in the history
  • Loading branch information
tonybaloney committed Jan 27, 2025
1 parent f8ad772 commit 4fb02b1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
9 changes: 5 additions & 4 deletions src/panel/effects/snow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ export class SnowEffect implements Effect {
pAmount: number = 2500; // Snowiness
pSize: number[] = [0.5, 1.5]; // min and max size
pSwing: number[] = [0.1, 1]; // min and max oscillation speed for x movement
pSpeed: number[] = [40, 100]; // min and max y speed
pAmplitude: number[] = [25, 50]; // min and max distance for x movement
pSpeed: number[] = [10, 50]; // min and max y speed
pAmplitude: number[] = [5, 20]; // min and max distance for x movement

floor: number = 0;

Expand Down Expand Up @@ -169,8 +169,8 @@ export class SnowEffect implements Effect {
particle.update(timeDelta);

if (
particle.position.y - particle.size - this.floor >
this.canvas.height
particle.position.y - particle.size >
this.canvas.height - this.floor
) {
// reset the particle to the top and a random x position
particle.position.y = -particle.size;
Expand All @@ -189,6 +189,7 @@ export class SnowEffect implements Effect {
console.log('Canvas context not initialized');
return;
}
// TODO: Vary the alpha based on the size of the particle
this.ctx.fillStyle = 'rgb(255,255,255)';

for (var i = 0; i < this.particles.length; i++) {
Expand Down
8 changes: 4 additions & 4 deletions src/panel/themes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,14 @@ class WinterThemeInfo extends ThemeInfo {
floor(size: PetSize): number {
switch (size) {
case PetSize.small:
return 60;
return 20;
case PetSize.medium:
return 80;
return 30;
case PetSize.large:
return 120;
return 45;
case PetSize.nano:
default:
return 45;
return 62;
}
}
}
Expand Down

0 comments on commit 4fb02b1

Please sign in to comment.