generated from 2ndbeam/bevy-template
feat: Player, assets and basic movement
This commit is contained in:
parent
975e065fde
commit
10afe6fd08
22 changed files with 87 additions and 55 deletions
34
src/lib.rs
Normal file
34
src/lib.rs
Normal 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);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue