Skip to content

Commit

Permalink
yeah
Browse files Browse the repository at this point in the history
  • Loading branch information
timelessnesses committed Dec 31, 2023
1 parent 3fc0471 commit a09799f
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 16 deletions.
14 changes: 7 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ chrono = "0.4.31"
chrono-tz = "0.8.4"
clap = { version = "4.4.11", features = ["derive"] }
rand = "0.8.5"
sdl2 = { version = "0.36.0", features = ["use-pkgconfig", "ttf"], default-features = false }
sdl2 = { version = "0.36.0", features = ["use-vcpkg", "ttf", "static-link"], default-features = false }
serde_json = "1.0.108"
slicestring = "0.3.3"

Expand Down
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"am_pm": false,
"am_pm": true,
"clocks": [
"local",
"America/Argentina/Buenos_Aires",
Expand Down
3 changes: 2 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// #![windows_subsystem = "windows"]
use chrono_tz;
use clap::{self, Parser};
use clock::Clock;
Expand Down Expand Up @@ -448,7 +449,7 @@ fn create_surfaces<'a>(
surface_width,
surface_height,
);
let s = snow::SnowParticles::new(20, &mut surface);
let s = snow::SnowParticles::new(100, &mut surface);
x.push((surface_rect, surface, s));
// println!("{:?}", surface_rect)
}
Expand Down
12 changes: 6 additions & 6 deletions src/snow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ impl Snowflake {
pub fn new(w: i32, h: i32, size: i32) -> Self {
let mut rng = rand::thread_rng();
return Snowflake {
x: rng.gen_range(0..w),
y: 0,
speed: rng.gen_range(1..5),
x: rng.gen_range(0..w+10),
y: -2,
speed: rng.gen_range(1..4),
window_height: h,
window_width: w,
window_width: w + 10,
size,
};
}
Expand All @@ -30,9 +30,9 @@ impl Snowflake {
self.y += self.speed;
let mut rng = rand::thread_rng();
if self.y > self.window_height {
self.y = 0;
self.y = -2;
self.x = rng.gen_range(0..self.window_width);
self.speed = rng.gen_range(1..3);
self.speed = rng.gen_range(1..4);
}
}

Expand Down

0 comments on commit a09799f

Please sign in to comment.