show health

This commit is contained in:
Corwin 2023-06-03 23:29:54 +01:00
parent 1c58a419ec
commit 95b28983ff
No known key found for this signature in database

View file

@ -198,18 +198,24 @@ impl<'a> FractionDisplay<'a> {
for i in 0..digits { for i in 0..digits {
let mut left_digit = obj.object_sprite(SMALL_SPRITES.number(0)); let mut left_digit = obj.object_sprite(SMALL_SPRITES.number(0));
left_digit.set_position(pos + (i as i32 * 4, 0).into()); left_digit
.set_position(pos + (i as i32 * 4, 0).into())
.show();
sprites.push(left_digit); sprites.push(left_digit);
let mut right_digit = obj.object_sprite(SMALL_SPRITES.number(0)); let mut right_digit = obj.object_sprite(SMALL_SPRITES.number(0));
right_digit.set_position(pos + (i as i32 * 4 + digits as i32 * 4 + 7, 0).into()); right_digit
.set_position(pos + (i as i32 * 4 + digits as i32 * 4 + 7, 0).into())
.show();
sprites.push(right_digit); sprites.push(right_digit);
} }
let mut slash = obj.object_sprite(SMALL_SPRITES.slash()); let mut slash = obj.object_sprite(SMALL_SPRITES.slash());
slash.set_position(pos + (digits as i32 * 4 + 1, 0).into()); slash
.set_position(pos + (digits as i32 * 4 + 1, 0).into())
.show();
sprites.push(slash); sprites.push(slash);
Self { Self {