mirror of
https://github.com/Xevion/Pac-Man.git
synced 2025-12-15 08:12:32 -06:00
fix: set PlayerLives default to 3, use resource for HUD lives count in top left
yes I am fully aware that the UP is not the player lives, I'm just wanting the indicator to be somewhere and I'll make the proper indicator tomorrow probably
This commit is contained in:
@@ -2,7 +2,7 @@ use crate::map::builder::Map;
|
||||
use crate::systems::input::TouchState;
|
||||
use crate::systems::{
|
||||
debug_render_system, BatchedLinesResource, Collider, CursorPosition, DebugState, DebugTextureResource, DeltaTime,
|
||||
DirectionalAnimation, Dying, Frozen, GameStage, LinearAnimation, Looping, Position, Renderable, ScoreResource,
|
||||
DirectionalAnimation, Dying, Frozen, GameStage, LinearAnimation, Looping, PlayerLives, Position, Renderable, ScoreResource,
|
||||
StartupSequence, SystemId, SystemTimings, TtfAtlasResource, Velocity,
|
||||
};
|
||||
use crate::texture::sprite::SpriteAtlas;
|
||||
@@ -204,6 +204,7 @@ pub fn hud_render_system(
|
||||
mut backbuffer: NonSendMut<BackbufferResource>,
|
||||
mut canvas: NonSendMut<&mut Canvas<Window>>,
|
||||
mut atlas: NonSendMut<SpriteAtlas>,
|
||||
player_lives: Res<PlayerLives>,
|
||||
score: Res<ScoreResource>,
|
||||
stage: Res<GameStage>,
|
||||
mut errors: EventWriter<GameError>,
|
||||
@@ -212,7 +213,7 @@ pub fn hud_render_system(
|
||||
let mut text_renderer = TextTexture::new(1.0);
|
||||
|
||||
// Render lives and high score text in white
|
||||
let lives = 3; // TODO: Get from actual lives resource
|
||||
let lives = player_lives.0;
|
||||
let lives_text = format!("{lives}UP HIGH SCORE ");
|
||||
let lives_position = glam::UVec2::new(4 + 8 * 3, 2); // x_offset + lives_offset * 8, y_offset
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ pub struct PlayerLives(pub u8);
|
||||
|
||||
impl Default for PlayerLives {
|
||||
fn default() -> Self {
|
||||
Self(1)
|
||||
Self(3)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user