#developing #input #button #player #log #nesbox #nes-box

nesbox_utils

Quickly develop NESBox games

3 releases

0.0.3 Apr 11, 2023
0.0.2 Mar 30, 2023
0.0.1 Mar 28, 2023

#1858 in Game dev

30 downloads per month

MIT license

29KB
794 lines

nesbox_utils

A utils functional for developing games for the NESBox

Example

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
}

Dependencies

~19–57MB
~1M SLoC