-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
890 additions
and
273 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,36 @@ | ||
//! Some common components and their associated systems. | ||
|
||
use bevy::sprite::MaterialMesh2dBundle; | ||
|
||
use crate::prelude::*; | ||
|
||
pub mod camera; | ||
pub mod music; | ||
|
||
pub(super) fn plugin(app: &mut App) { | ||
app.add_plugins((camera::plugin, music::plugin)); | ||
app.add_plugins((camera::plugin, music::plugin)) | ||
.add_systems(OnEnter(GameState::Play), init); | ||
} | ||
|
||
/// The prelude for this module. | ||
pub mod prelude { | ||
pub use super::camera::GameCamera; | ||
pub use super::camera::{FinalCamera, GameCamera}; | ||
} | ||
|
||
/// Spawn test mesh (DELETE) | ||
fn init( | ||
mut cmd: Commands, | ||
mut meshes: ResMut<Assets<Mesh>>, | ||
mut materials: ResMut<Assets<ColorMaterial>>, | ||
) { | ||
let color: Color = css::SEA_GREEN.into(); | ||
cmd.spawn(( | ||
MaterialMesh2dBundle { | ||
mesh: meshes.add(Capsule2d::default()).into(), | ||
transform: Transform::from_xyz(0., 0., 2.).with_scale(Vec3::splat(32.)), | ||
material: materials.add(color), | ||
..default() | ||
}, | ||
StateScoped(GameState::Play), | ||
)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.