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

+2 -2
View File
@@ -252,7 +252,7 @@ impl Game {
self.part(RING, (x, y, 0.05), (0.0, 0.0, 0.0), 0.5, abgr(255, 120, 40), 1.4 * size);
self.burst(EMBER, at, (24.0 * size) as usize, 2.8 * size, 3.0, 1.2, abgr(255, 140, 40), 0.05);
self.burst(SPARK, at, 10, 3.5, 2.5, 0.7, abgr(255, 230, 120), 0.035);
self.burst(SMOKE, (x, y, 0.3), 8, 0.6, 0.7, 2.2, abgr(70, 60, 60), 0.22);
self.burst(SMOKE, (x, y, 0.45), 8, 0.6, 0.7, 2.2, abgr(70, 60, 60), 0.20);
self.stick(Part { kind: SCORCH, x, y, h: 0.0, vx: 0.0, vy: 0.0, vh: 0.0, t: 0.0, max: 25.0, col: 0, size: 0.7 * size });
}
ST_CANNON => {
@@ -263,7 +263,7 @@ impl Game {
self.burst(DEBRIS, at, 16, 3.0, 3.5, 1.6, abgr(84, 70, 64), 0.07);
self.burst(DEBRIS, at, 6, 2.5, 3.0, 1.4, abgr(120, 92, 70), 0.05);
self.burst(SPARK, at, 12, 4.0, 2.5, 0.6, abgr(255, 200, 100), 0.03);
self.burst(SMOKE, (x, y, 0.3), 10, 0.8, 0.6, 2.4, abgr(80, 80, 86), 0.25);
self.burst(SMOKE, (x, y, 0.45), 10, 0.8, 0.6, 2.4, abgr(80, 80, 86), 0.23);
self.stick(Part { kind: SCORCH, x, y, h: 0.0, vx: 0.0, vy: 0.0, vh: 0.0, t: 0.0, max: 20.0, col: 0, size: 0.6 });
}
ST_ARROW | ST_ARROW_WALL => {
+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