1pub struct Config {
2 pub width: u32,
4
5 pub height: u32,
7
8 pub gravity: f64,
10
11 pub flap_speed: f64,
13
14 pub pipe_width: u32,
16
17 pub pipe_interval: u32,
19
20 pub pipe_mouth_height: u32,
22
23 pub pipe_speed: f64,
25}
26
27impl Default for Config {
28 fn default() -> Self {
29 Self {
30 width: 80,
31 height: 24,
32 gravity: 0.005,
33 #[allow(deprecated)]
34 flap_speed: 0.2,
35 pipe_width: 5,
36 pipe_interval: 40,
37 pipe_mouth_height: 10,
38 pipe_speed: 0.3,
39 }
40 }
41}
42
43use lazy_static::lazy_static;
44lazy_static! {
45 pub static ref CONFIG: Config = Config::default();
46}