1
Fork 0

stylistic changes

This commit is contained in:
Andy Killorin 2023-08-27 08:00:22 -05:00
parent 1bf702cd99
commit 230e82613d
Signed by: ank
GPG key ID: B6241CA3B552BCA4
2 changed files with 4 additions and 3 deletions

View file

@ -11,7 +11,7 @@ function blit_frame() {
function blit_text(text, len, x, y, size) { function blit_text(text, len, x, y, size) {
let decoded = (new TextDecoder()) let decoded = (new TextDecoder())
.decode(new Uint8Array(memory.buffer, text, len)); .decode(new Uint8Array(memory.buffer, text, len));
ctx.font = size +'vh serif' ctx.font = size +'px serif'
ctx.fillText(decoded,x,y); ctx.fillText(decoded,x,y);
} }

View file

@ -55,14 +55,15 @@ fn render_frame(buffer: &mut [u32; WIDTH*HEIGHT]) {
for y in 0..HEIGHT { for y in 0..HEIGHT {
for x in 0..WIDTH { 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; let mut n = 0.0;
n += noise::noise(point / 64.0, rand) / 1.0; n += noise::noise(point / 64.0, rand) / 1.0;
n += noise::noise(point / 32.0, rand) / 2.0; n += noise::noise(point / 32.0, rand) / 2.0;
n += noise::noise(point / 16.0, rand) / 4.0; n += noise::noise(point / 16.0, rand) / 4.0;
n += noise::noise(point / 8.0, rand) / 8.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] = (((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 0xFF00FF00
} else { } else {
0xFFFF0000 0xFFFF0000