//! Renders a 2D scene containing pixelated bevy logo in a pixel perfect style use bevy::prelude::*; fn main() { App::new() .add_plugins(DefaultPlugins.set( // This sets image filtering to nearest // This is done to prevent textures with low resolution (e.g. pixel art) from being blurred // by linear filtering. ImagePlugin::default_nearest(), )) .add_systems(Startup, setup) .add_systems(Update, sprite_movement) .run(); } #[derive(Component)] enum Direction { Left, Right, } fn setup(mut commands: Commands, asset_server: Res) { commands.spawn(Camera2dBundle::default()); commands.spawn(( SpriteBundle { texture: asset_server.load("pixel/bevy_pixel_light.png"), transform: Transform::from_xyz(100., 0., 0.), ..default() }, Direction::Right, )); } fn sprite_movement(time: Res