mirror of
https://github.com/doukutsu-rs/doukutsu-rs
synced 2025-11-30 08:08:18 +00:00
Persistent damage numbers
This commit is contained in:
parent
12d7758ea7
commit
e1b33aa0e9
|
|
@ -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(())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)?;
|
||||
|
|
|
|||
Loading…
Reference in a new issue