diff --git a/assets/.gitkeep b/assets/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/assets/fonts/plop.ttf b/assets/fonts/plop.ttf new file mode 100644 index 0000000..1b658d2 Binary files /dev/null and b/assets/fonts/plop.ttf differ diff --git a/src/main.rs b/src/main.rs index 0ab1bdd..3dc4c7c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -72,6 +72,7 @@ fn main() { Update, (main_menu_input).run_if(in_state(GameState::MainMenu)), ) + .add_systems(OnExit(GameState::MainMenu), remove_text) .add_systems( Update, transition_to_gameplay.run_if(in_state(GameState::TransitionToGamePlay)), @@ -80,11 +81,31 @@ fn main() { .run(); } +fn remove_text(mut commands: Commands, query: Query>) { + for entity in query.iter() { + commands.entity(entity).despawn_recursive(); + } +} + fn setup(mut commands: Commands, asset_server: Res) { commands.spawn(Camera2dBundle { transform: Transform::from_translation(Vec3::new(-500.0, 0.0, 100.0)), ..default() }); + + commands.spawn(Text2dBundle { + text: Text::from_section( + "Hold The Line", + TextStyle { + font: asset_server.load("fonts/plop.ttf"), + font_size: 99.0, + color: Color::rgb(1.0, 1.0, 0.0), + }, + ) + .with_alignment(TextAlignment::Center), + transform: Transform::from_translation(Vec3::new(-500.0, 200.0, 0.0)), + ..default() + }); commands.spawn(SpriteBundle { texture: asset_server.load("sprites/map/map.png"), transform: Transform::from_scale(Vec3::new(1.25, 1.25, 1.0))