Splash arrows in lava
This commit is contained in:
1 parent
3b710516d8
commit
ee88fc04a5
3 files changed
+116
-7
No files matched your search
+13
-7
@@ -1124,6 +1124,7 @@ impl R3d {
|
||||
draw_marks(g, t);
|
||||
draw_overlay(&g.map, ov, self.wall_sub);
|
||||
draw_entry_warnings(g, t, self.wall_sub);
|
||||
draw_scorch_glow(g);
|
||||
// translucent glows and effects last (they write depth, see glow_material)
|
||||
draw_landmarks_glow(g, t, cam.basis().1);
|
||||
draw_towers_glow(g, t);
|
||||
@@ -2455,27 +2456,32 @@ fn draw_traps_glow(g: &Game, t: f32) {
|
||||
}
|
||||
|
||||
// particles that glow (embers, sparks, smoke, flashes, shock waves)
|
||||
fn draw_parts_glow(g: &Game) {
|
||||
fn draw_scorch_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);
|
||||
let at = vec3(p.x, floor_y(g, p.x, p.y) + 0.018, p.y);
|
||||
disc(at, p.size, Color::new(0.02, 0.017, 0.017, 0.78 * fade), 14);
|
||||
ring(at + Vec3::Y * 0.002, p.size * 1.06, Color::new(0.55, 0.22, 0.06, 0.22 * fade));
|
||||
}
|
||||
}
|
||||
|
||||
fn draw_parts_glow(g: &Game) {
|
||||
use crate::particles::*;
|
||||
for p in &g.parts {
|
||||
let c = rgba(p.col);
|
||||
let life = (p.t / p.max).clamp(0.0, 1.0);
|
||||
let at = vec3(p.x, p.h, p.y);
|
||||
match p.kind {
|
||||
EMBER | SPARK | MOTE => {
|
||||
EMBER | SPARK | MOTE | SPLASH => {
|
||||
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.18 * (1.0 - life))),
|
||||
SMOKE => draw_sphere(at, p.size, None, Color::new(c.r, c.g, c.b, 0.14 * (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));
|
||||
draw_sphere(at, r, None, Color::new(c.r, c.g, c.b, 0.6 * (1.0 - life)));
|
||||
draw_sphere(at, r * 0.6, None, Color::new(1.0, 0.9, 0.7, 0.7 * (1.0 - life)));
|
||||
draw_sphere(at, r, None, Color::new(c.r, c.g, c.b, 0.35 * (1.0 - life)));
|
||||
}
|
||||
RING => ring(at, p.size * (0.2 + life), Color::new(c.r, c.g, c.b, 0.8 * (1.0 - life))),
|
||||
_ => {}
|
||||
|
||||
Reference in new issue
Block a user