extern crate piston_window; use piston_window::*; use piston_window::math::{Scalar}; mod game; use game::Game; const XDIM: u32 = 600; const YDIM: u32 = 600; fn main() { let mut window: PistonWindow = WindowSettings::new( "rust-pilot", [XDIM, YDIM] ) .exit_on_esc(true) .samples(8) .vsync(true) .build() .unwrap(); // Create a new game and run it. let mut game = Game::new(XDIM as Scalar, YDIM as Scalar); while let Some(e) = window.next() { match e { Event::Loop(Loop::Update(upd)) => { game.update(upd); } Event::Loop(Loop::Render(ren)) => { game.render(ren, &mut window, &e); } Event::Input(inp) => { let ev = Event::Input(inp); game.input(&ev); } _ => { } } } }