use macroquad::color::Color;
use macroquad::prelude::{draw_circle, screen_height, screen_width};
use rand::prelude::SmallRng;
use rand::{RngExt, SeedableRng};

pub fn star_field() {
    let mut rng = SmallRng::seed_from_u64(0x55);

    for x in (0..screen_width() as u32).step_by(5) {
        for y in (0..screen_height() as u32).step_by(5) {
            if rng.random_bool(0.01) {
                let brightness = rand::random_range(0.75..1.0);

                let color = Color::new(brightness, brightness, brightness, 1.0);

                draw_circle(x as f32, y as f32, screen_height() * 0.001, color);
            }
        }
    }
}
