bevy-rust-arcade

Crates.iobevy-rust-arcade
lib.rsbevy-rust-arcade
version0.1.0
sourcesrc
created_at2022-06-17 00:34:37.235725
updated_at2022-06-17 00:34:37.235725
descriptionA Bevy plugin for making games compatible with the Rust Arcade.
homepage
repositoryhttps://github.com/rust-arcade/bevy-rust-arcade
max_upload_size
id607754
size86,349
Carlo Supina (cdsupina)

documentation

README

bevy-rust-arcade

A plugin for the Bevy Engine that allows you to easily make your games compatible with Rust Arcade Machine. Learn more about the Rust Arcade project here.

arcade-cabinet

This plugin wraps the relevent Bevy gamepad events in more descriptive names specific to the arcade cabinet, according to the image below.

arcade-input-diagram

You can test these inputs without accessing the arcade machine by using an xbox controller, they are mapped accordingly to the buttons below.

xbox-diagram

Below is some simple code from the input example to get you started.

use bevy::prelude::*;
use bevy_rust_arcade::{ArcadeInputEvent, RustArcadePlugin};

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_plugin(RustArcadePlugin)
        .add_system(arcade_event_system)
        .run();
}

// Read arcade input events
fn arcade_event_system(mut arcade_input_events: EventReader<ArcadeInputEvent>) {
    for event in arcade_input_events.iter() {
        info!(
            "{:?} of {:?} is changed to {}",
            event.arcade_input, event.gamepad, event.value
        );
    }
}

Commit count: 10

cargo fmt