Keep scorch marks visible under smoke

This commit is contained in:
Richard Zink committed 2026-11-05 13:57:58 +01:00
1 parent af89eacd3e
commit 1e839cbb29
2 files changed
+8 -8

No files matched your search

+6 -6
View File
@@ -2457,6 +2457,11 @@ fn draw_traps_glow(g: &Game, t: f32) {
// particles that glow (embers, sparks, smoke, flashes, shock waves)
fn draw_parts_glow(g: &Game) {
use crate::particles::*;
// scorch marks on the floor: drawn before smoke/flash so they are not depth-occluded
for p in g.stuck.iter().filter(|p| p.kind == SCORCH) {
let fade = 1.0 - (p.t / p.max).clamp(0.0, 1.0);
disc(vec3(p.x, floor_y(g, p.x, p.y) + 0.02, p.y), p.size, Color::new(0.025, 0.018, 0.018, 0.70 * fade), 14);
}
for p in &g.parts {
let c = rgba(p.col);
let life = (p.t / p.max).clamp(0.0, 1.0);
@@ -2466,7 +2471,7 @@ fn draw_parts_glow(g: &Game) {
let s = p.size * (1.0 - life * 0.6);
draw_cube(at, Vec3::splat(s), None, Color::new(c.r, c.g, c.b, 1.0 - life * life));
}
SMOKE => draw_sphere(at, p.size, None, Color::new(c.r, c.g, c.b, 0.35 * (1.0 - life))),
SMOKE => draw_sphere(at, p.size, None, Color::new(c.r, c.g, c.b, 0.18 * (1.0 - life))),
FLASH => {
let r = p.size * (0.3 + life * 0.9);
draw_sphere(at, r * 0.6, None, Color::new(1.0, 0.95, 0.75, 1.0 - life));
@@ -2476,11 +2481,6 @@ fn draw_parts_glow(g: &Game) {
_ => {}
}
}
// scorch marks on the floor
for p in g.stuck.iter().filter(|p| p.kind == SCORCH) {
let fade = 1.0 - (p.t / p.max).clamp(0.0, 1.0);
disc(vec3(p.x, floor_y(g, p.x, p.y) + 0.015, p.y), p.size, Color::new(0.03, 0.02, 0.02, 0.55 * fade), 14);
}
}
// solid particles: debris, coins and the arrows stuck in walls and floors