feat: Player, assets and basic movement

This commit is contained in:
Alexey 2026-02-12 17:09:57 +03:00
commit 10afe6fd08
22 changed files with 87 additions and 55 deletions

34
src/lib.rs Normal file
View file

@ -0,0 +1,34 @@
pub mod player;
pub mod layout;
use bevy::prelude::*;
pub struct ExpeditionPlugin;
fn camera_bundle() -> impl Bundle {
(
Camera2d,
Camera {
clear_color: ClearColorConfig::Custom(Color::hsl(0.02, 0.67, 0.65)),
..default()
},
Projection::Orthographic(OrthographicProjection {
scaling_mode: bevy::camera::ScalingMode::FixedVertical {
viewport_height: 384.,
},
scale: 1.,
..OrthographicProjection::default_2d()
}),
)
}
fn setup_global(mut commands: Commands) {
commands.spawn(camera_bundle());
}
impl Plugin for ExpeditionPlugin {
fn build(&self, app: &mut App) {
app.add_systems(Startup, (player::setup_player, setup_global))
.add_systems(Update, player::handle_input);
}
}