1
0
Fork 0
mirror of https://github.com/doukutsu-rs/doukutsu-rs synced 2025-11-30 16:18:00 +00:00

Persistent damage numbers

This commit is contained in:
dawnDus 2022-01-23 19:29:41 -05:00
parent 12d7758ea7
commit e1b33aa0e9
No known key found for this signature in database
GPG key ID: 972AABDE81848F21
3 changed files with 10 additions and 3 deletions

View file

@ -657,8 +657,6 @@ impl GameEntity<([&mut Player; 2], &NPCList, &mut Stage, &mut BulletManager, &mu
);
batch.draw(ctx)?;
self.popup.draw(state, ctx, frame)?;
Ok(())
}
}

View file

@ -215,6 +215,7 @@ impl NPC {
npc.cond.set_alive(true);
npc.x = self.x;
npc.y = self.y;
npc.popup = self.popup;
*self = npc;
}
@ -313,7 +314,6 @@ impl NPCList {
state.game_flags.set(npc.flag_num as usize, true);
if npc.npc_flags.show_damage() {
// todo show damage
if vanish {
npc.vanish(state);
}

View file

@ -206,6 +206,13 @@ impl GameScene {
Ok(())
}
fn draw_npc_popup(&self, state: &mut SharedGameState, ctx: &mut Context) -> GameResult {
for npc in self.npc_list.iter_alive() {
npc.popup.draw(state, ctx, &self.frame)?;
}
Ok(())
}
fn draw_bullets(&self, state: &mut SharedGameState, ctx: &mut Context) -> GameResult {
let batch = state.texture_set.get_or_load_batch(ctx, &state.constants, "Bullet")?;
let mut x: i32;
@ -1771,6 +1778,8 @@ impl Scene for GameScene {
self.whimsical_star.draw(state, ctx, &self.frame)?;
}
self.draw_npc_popup(state, ctx)?;
self.water_renderer.draw(state, ctx, &self.frame)?;
self.tilemap.draw(state, ctx, &self.frame, TileLayer::Foreground, stage_textures_ref, &self.stage)?;
self.tilemap.draw(state, ctx, &self.frame, TileLayer::Snack, stage_textures_ref, &self.stage)?;