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