Level management & win
This commit is contained in:
parent
55ab83588a
commit
214e55d7ac
7 changed files with 355 additions and 151 deletions
36
src/levels/game_over.rs
Normal file
36
src/levels/game_over.rs
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
use crate::game::*;
|
||||
|
||||
use bevy::prelude::*;
|
||||
|
||||
pub fn setup(commands: &mut Commands, asset_server: &Res<AssetServer>) {
|
||||
let font = asset_server.get_handle("Cantarell-VF.otf");
|
||||
commands
|
||||
.spawn_bundle(Text2dBundle {
|
||||
text: Text::from_section(
|
||||
"GAME OVER",
|
||||
TextStyle {
|
||||
font: font.clone(),
|
||||
font_size: 48.0,
|
||||
color: Color::WHITE,
|
||||
},
|
||||
)
|
||||
.with_alignment(TextAlignment::CENTER),
|
||||
transform: Transform::from_xyz(0., -128.0, 0.),
|
||||
..Default::default()
|
||||
})
|
||||
.insert(Level);
|
||||
commands
|
||||
.spawn_bundle(Text2dBundle {
|
||||
text: Text::from_section(
|
||||
"There is no more light to combine.",
|
||||
TextStyle {
|
||||
font,
|
||||
font_size: 32.0,
|
||||
color: Color::WHITE,
|
||||
},
|
||||
)
|
||||
.with_alignment(TextAlignment::CENTER),
|
||||
..Default::default()
|
||||
})
|
||||
.insert(Level);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue