asteroids-genetic/src/main.rs

36 lines
769 B
Rust
Raw Normal View History

2022-10-08 13:15:07 +00:00
mod asteroids;
2022-10-09 18:14:22 +00:00
mod nn;
2022-10-08 13:15:07 +00:00
mod player;
2022-10-09 20:11:24 +00:00
mod population;
2022-10-08 15:27:05 +00:00
mod world;
2022-10-08 13:15:07 +00:00
use macroquad::prelude::*;
2022-10-10 18:36:14 +00:00
use population::Population;
2022-10-08 15:27:05 +00:00
use world::World;
2022-10-08 13:15:07 +00:00
#[macroquad::main("Camera")]
async fn main() {
rand::srand(macroquad::miniquad::date::now() as _);
let cam = Camera2D {
2022-10-09 05:40:56 +00:00
zoom: vec2(2. / screen_width(), -2. / screen_height()),
2022-10-08 13:15:07 +00:00
..Default::default()
};
set_camera(&cam);
2022-10-10 18:36:14 +00:00
let mut pop = Population::new(5);
2022-10-08 13:15:07 +00:00
loop {
2022-10-10 10:13:06 +00:00
clear_background(BLACK);
2022-10-10 18:36:14 +00:00
pop.update();
pop.draw();
2022-10-08 13:15:07 +00:00
next_frame().await
}
2022-10-10 18:36:14 +00:00
// let mut world = World::new();
// loop {
// clear_background(BLACK);
// if !world.over {
// world.update();
// }
// world.draw();
// next_frame().await
// }
2022-10-08 13:15:07 +00:00
}