Skip to content

Commit

Permalink
bootstrapped ggez
Browse files Browse the repository at this point in the history
  • Loading branch information
Dylan Donahue committed Jan 13, 2024
1 parent e25c9c6 commit 1c7580d
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
use ggez::*;

struct State {
dt: std::time::Duration,
}

fn main() {
println!("Hello, world!");
let state = State {
dt: std::time::Duration::new(0, 0)
};

let c = conf::Conf::new();
let (ctx, event_loop) = ContextBuilder::new("arcade_game", "dyl")
.default_conf(c)
.build()
.unwrap();

event::run(ctx, event_loop, state);
}

impl ggez::event::EventHandler<GameError> for State {
fn update(&mut self, ctx: &mut Context) -> GameResult {
self.dt = ctx.time.delta();
Ok(())
}
fn draw(&mut self, ctx: &mut Context) -> GameResult {
Ok(())
}
}

0 comments on commit 1c7580d

Please sign in to comment.