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