From 271659506955334129b2c8d9e51aa871f92e300c Mon Sep 17 00:00:00 2001 From: eri Date: Wed, 13 Dec 2023 22:37:05 +0100 Subject: [PATCH] =?UTF-8?q?feat:=20input=20movement=20axis=20=F0=9F=8E=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/jump.rs | 27 ++++-- src/data.rs | 73 ++++++++------- src/input.rs | 228 ++++++++++++++++++++++++++++++++++++++--------- src/lib.rs | 7 +- src/ui.rs | 1 - src/ui/menu.rs | 17 ++-- 6 files changed, 258 insertions(+), 95 deletions(-) diff --git a/examples/jump.rs b/examples/jump.rs index 966844c..33fe2aa 100644 --- a/examples/jump.rs +++ b/examples/jump.rs @@ -1,5 +1,7 @@ #![allow(clippy::too_many_arguments)] +use std::cmp::Ordering; + use bevy::{ prelude::*, sprite::MaterialMesh2dBundle, @@ -10,8 +12,9 @@ use hello_bevy::{ GameOptions, GamePlugin, GameState, - Keybind, + KeyBind, Keybinds, + Movement, }; const SIZE: Vec2 = Vec2::new(600., 600.); @@ -118,10 +121,11 @@ fn init_sample( fn update_sample( time: Res