migrate to comfy
This commit is contained in:
parent
96e3f6982e
commit
e83ec5ce20
4 changed files with 1223 additions and 1925 deletions
9
src/game.rs
Normal file
9
src/game.rs
Normal file
|
@ -0,0 +1,9 @@
|
|||
use comfy::*;
|
||||
|
||||
use crate::State;
|
||||
|
||||
pub fn update(_state: &mut State, _engine: &mut EngineContext) {}
|
||||
|
||||
pub fn draw(_state: &State, _engine: &EngineContext) {
|
||||
draw_circle(vec2(0.0, 0.0), 0.5, RED, 0);
|
||||
}
|
38
src/main.rs
38
src/main.rs
|
@ -1,7 +1,35 @@
|
|||
use bevy::prelude::*;
|
||||
mod game;
|
||||
|
||||
use comfy::*;
|
||||
|
||||
const GAME_NAME: &str = "Powercreep";
|
||||
|
||||
#[derive(Debug)]
|
||||
struct State {}
|
||||
|
||||
impl GameLoop for State {
|
||||
fn new(_c: &mut EngineState) -> Self {
|
||||
State {}
|
||||
}
|
||||
|
||||
fn update(&mut self, engine: &mut EngineContext) {
|
||||
game::update(self, engine);
|
||||
game::draw(self, engine);
|
||||
}
|
||||
}
|
||||
|
||||
fn config(config: GameConfig) -> GameConfig {
|
||||
config
|
||||
}
|
||||
|
||||
async fn run() {
|
||||
init_game_config(GAME_NAME.to_string(), env!("CARGO_PKG_VERSION"), config);
|
||||
let mut engine = EngineState::new();
|
||||
let game = State::new(&mut engine);
|
||||
run_comfy_main_async(game, engine).await;
|
||||
}
|
||||
|
||||
fn main() {
|
||||
App::new()
|
||||
.add_plugins(DefaultPlugins)
|
||||
.run();
|
||||
}
|
||||
//my_env_logger_style::just_log();
|
||||
pollster::block_on(run());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue