Crates.io | nesbox_utils |
lib.rs | nesbox_utils |
version | 0.0.3 |
source | src |
created_at | 2023-03-28 15:26:21.120022 |
updated_at | 2023-04-11 17:20:24.937332 |
description | Quickly develop NESBox games |
homepage | |
repository | |
max_upload_size | |
id | 823174 |
size | 28,048 |
A utils functional for developing games for the NESBox
use nesbox_utils::prelude::*;
fn global_handle(input: Res<ButtonInput>, mut next: ResMut<NextState<AppState>>) {
if input.get_input(Player::One).just_pressed(Button::Reset) {
log!("pressed reset button!");
}
}
#[nesbox_bevy]
fn create_app() -> App {
let mut app = create_bevy_app(256, 240, Color::default());
let mut assets_resource = app.world.get_resource_mut::<AssetsResource>().unwrap();
assets_resource.load_audio("select", decode_qoi_frame(include_bytes!("../assets/select-an-item.mp3.data")));
app.add_state::<AppState>().add_system(global_handle);
app
}