Skip to content
Snippets Groups Projects
mod.rs 717 B
Newer Older
mod _plugin {
	use crate::system::AppState;
	use bevy::prelude::*;
Louis's avatar
Louis committed
	use bevy::time::common_conditions::on_fixed_timer;
	use bevy_rapier2d::prelude::*;
Louis's avatar
Louis committed
	use std::time::Duration;

	pub struct DebugPlugin;
	impl Plugin for DebugPlugin {
		fn build(&self, app: &mut App) {
			app.add_systems(OnEnter(AppState::InGame), |mut commands: Commands| {
				commands.spawn((
					TransformBundle::from_transform(Transform::from_xyz(0.0, -400.0, 0.0)),
					RigidBody::Fixed,
					Collider::cuboid(200.0, 50.0),
				));
Louis's avatar
Louis committed
			})
			// .add_systems(
			// 	Update,
			// 	(|gamepads: Res<Gamepads>| info!("{:?}", gamepads))
			// 		.run_if(on_fixed_timer(Duration::from_secs(5))),
			// )
			;
		}
	}
}

pub use _plugin::DebugPlugin;