From 230e82613d6179c7a37f5f547f2694c5e04f9394 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Sun, 27 Aug 2023 08:00:22 -0500 Subject: [PATCH] stylistic changes --- front/index.js | 2 +- pirates/src/lib.rs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/front/index.js b/front/index.js index 78bc873..fa8081a 100644 --- a/front/index.js +++ b/front/index.js @@ -11,7 +11,7 @@ function blit_frame() { function blit_text(text, len, x, y, size) { let decoded = (new TextDecoder()) .decode(new Uint8Array(memory.buffer, text, len)); - ctx.font = size +'vh serif' + ctx.font = size +'px serif' ctx.fillText(decoded,x,y); } diff --git a/pirates/src/lib.rs b/pirates/src/lib.rs index b3338c1..4202f6a 100644 --- a/pirates/src/lib.rs +++ b/pirates/src/lib.rs @@ -55,14 +55,15 @@ fn render_frame(buffer: &mut [u32; WIDTH*HEIGHT]) { for y in 0..HEIGHT { for x in 0..WIDTH { - let point = Vector2::new((x+frame as usize) as f32,y as f32)* 2.0; + let point = Vector2::new((x+frame as usize) as f32,y as f32)* 3.0; let mut n = 0.0; n += noise::noise(point / 64.0, rand) / 1.0; n += noise::noise(point / 32.0, rand) / 2.0; n += noise::noise(point / 16.0, rand) / 4.0; n += noise::noise(point / 8.0, rand) / 8.0; + n += noise::noise(point / 4.0, rand) / 16.0; //buffer[y*WIDTH + x] = (((n*0.5+0.5)*256.0) as u32) << 16| 0xFF005000; - buffer[y*WIDTH + x] = if n > 0.02 { + buffer[y*WIDTH + x] = if n > 0.002 { 0xFF00FF00 } else { 0xFFFF0000