projectile system

This commit is contained in:
Jim 2025-08-31 19:00:19 -04:00
parent 918b4884b2
commit ad4a2cf393
Signed by: jim
GPG key ID: 3D7D94BA53088BF4
17 changed files with 400 additions and 23 deletions

View file

@ -39,16 +39,34 @@ fn resource_ui(
.anchor(Align2::RIGHT_TOP, [0., 0.])
.show(ctx, |ui| {
ui.label(RichText::new(format!("Souls: {}", resources.souls)).size(large_font_size));
ui.label(RichText::new(format!("Bones: {}", resources.bones)).size(large_font_size));
ui.heading(RichText::new("Buildings").underline());
for (info, cost, name) in buildings.iter() {
if !info.unlocked {
continue;
}
let souls_text = if cost.souls > 0 {
format!("{} souls", cost.souls)
} else {
"".to_string()
};
let divider_text = if cost.souls > 0 && cost.bones > 0 {
", "
} else if cost.souls == 0 && cost.bones == 0 {
"FREE!!!"
} else {
""
};
let bones_text = if cost.bones > 0 {
format!("{} bones", cost.bones)
} else {
"".to_string()
};
if ui
.button(
RichText::new(format!(
"{} - {} souls, {} bones",
name, cost.souls, cost.bones
"{} - {}{}{}",
name, souls_text, divider_text, bones_text
))
.size(font_size),
)