Commit | Line | Data |
---|---|---|
296187ca TW |
1 | extern crate rand; |
2 | extern crate sdl2; | |
3 | extern crate time; | |
60276654 | 4 | extern crate noise; |
296187ca | 5 | |
b0566120 | 6 | use core::game::GameState; |
3d049b50 | 7 | use core::app::*; |
296187ca | 8 | |
953b4c96 TW |
9 | mod core; |
10 | mod geometry; | |
cdf8f998 | 11 | mod sprites; |
953b4c96 | 12 | mod teststate; |
5433a77f | 13 | mod util; |
296187ca | 14 | |
77034de9 TW |
15 | const SCREEN_WIDTH: u16 = 1280; |
16 | const SCREEN_HEIGHT: u16 = (SCREEN_WIDTH as f64 * (1440.0 / 2560.0)) as u16; | |
296187ca | 17 | |
296187ca TW |
18 | fn main() { |
19 | println!("starting..."); | |
6edafdc0 | 20 | let mut app = App::new() |
77034de9 | 21 | .with_resolution(SCREEN_WIDTH, SCREEN_HEIGHT) |
b0566120 TW |
22 | // .with_state(Box::new(ActiveState::new((SCREEN_WIDTH as u32, SCREEN_HEIGHT as u32)))) |
23 | .with_state(Box::new(GameState::new())) | |
6ba7aef1 TW |
24 | .with_title("SDL test") |
25 | .build() | |
26 | .unwrap(); | |
27 | app.load_sprites(&[("block", "res/block.bmp"), ("mario", "res/mario-trans.png")]); | |
28 | ||
29 | app.start(); | |
296187ca | 30 | } |