Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Create an App API that's basically a complete rip-off of Bevy #367

Open
Tracked by #227
kanerogers opened this issue Sep 26, 2022 · 1 comment
Open
Tracked by #227
Assignees

Comments

@kanerogers
Copy link
Collaborator

kanerogers commented Sep 26, 2022

Background

The Hotham API is kind of unpleasant to deal with.

This could make it a lot nicer.

pub struct GameState {
  splines: usize;
}

/// Called **once** before your game starts.
pub fn init_game(engine: &mut Engine, world: &mut World) -> GameState {
  // Import models, load scene, etc.
  GameState {
   splines: 0
  }
}

/// Called each frame, **after** input has been collected and the physics simulation has run, but **before** rendering occurs.
/// All Android and XR lifecycle, etc. will be handled for you.
pub fn game_system(engine: &mut Engine, world: &mut World, game_state: &mut GameState) {
  // Update the game simulation.
  game_state.splines += 1;
}

pub fn main() {
  App::builder().add_init(init_game).add_system(game_system).run();
}
@kanerogers kanerogers changed the title Create App API in Engine that's basically a complete rip-off of Bevy [Feature] Create App API in Engine that's basically a complete rip-off of Bevy Sep 26, 2022
@kanerogers kanerogers changed the title [Feature] Create App API in Engine that's basically a complete rip-off of Bevy [Feature] Create an App API that's basically a complete rip-off of Bevy Sep 26, 2022
@kanerogers kanerogers self-assigned this Sep 26, 2022
@kanerogers
Copy link
Collaborator Author

I've been thinking about this a little more. On reflection it might not actually be so bad to have the user's game code drive the while loop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant