Crates.io | bevy-rust-arcade |
lib.rs | bevy-rust-arcade |
version | 0.1.0 |
source | src |
created_at | 2022-06-17 00:34:37.235725 |
updated_at | 2022-06-17 00:34:37.235725 |
description | A Bevy plugin for making games compatible with the Rust Arcade. |
homepage | |
repository | https://github.com/rust-arcade/bevy-rust-arcade |
max_upload_size | |
id | 607754 |
size | 86,349 |
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.
This plugin wraps the relevent Bevy gamepad events in more descriptive names specific to the arcade cabinet, according to the image below.
You can test these inputs without accessing the arcade machine by using an xbox controller, they are mapped accordingly to the buttons below.
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
);
}
}