use bevy::prelude::*; use bevy_retro_camera::{RetroCameraBundle, RetroCameraPlugin}; // Create a stage label that will be used for our game logic stage #[derive(StageLabel, Debug, Eq, Hash, PartialEq, Clone)] struct GameStage; fn main() { App::new() .insert_resource(WindowDescriptor { title: "Bevy Retro Camera - Hello World".into(), ..Default::default() }) .add_plugins(RetroCameraPlugin::default()) .add_startup_system(setup) .add_system(move_player) .run(); } #[derive(Component)] struct Player; fn setup(mut commands: Commands, asset_server: Res) { // Load our sprites let red_radish_image = asset_server.load("redRadish.png"); // Spawn the camera with a fixed height of 80 in-game pixels and a width determined by the // window aspect. commands.spawn_bundle(RetroCameraBundle::fixed_height(80.0)); // Spawn a red radish commands .spawn_bundle(SpriteBundle { texture: red_radish_image, transform: Transform::from_xyz(0., 0., 0.), ..Default::default() }) // Add our player marker component so we can move it .insert(Player); } fn move_player( keyboard_input: Res>, mut query: Query<&mut Transform, With>, time: Res